All articles
SoftwareOct 30, 2026· 2 min read

Two well understood tools cover most of what a new product needs. What each one is for, and the rule that keeps them apart.

A new product has many unknowns. The database does not have to be one of them. We like to start with PostgreSQL for what must not be lost and Redis for what may be lost. This website works that way too.

PostgreSQL holds the truth

Accounts, articles, projects and messages live in Postgres. It gives a small team a lot for free:

  • Transactions: a change happens completely or not at all.
  • Constraints: a unique address or a required field is checked by the database, whatever the code does.
  • Arrays and JSON for data whose shape is still moving.
  • Full-text search, often good enough for the first years.

Put the rules in the database when you can. Code changes every week, and a constraint protects the data from all of it.

Redis holds what is temporary

Next to it, Redis does a few small jobs:

  1. Cache: the homepage data is built from several queries and kept for a short time.
  2. Rate limits: a counter per address that expires by itself.
  3. Queue: the API adds a message to a list and a worker sends the email.
INCR   ratelimit:contact:203.0.113.7
EXPIRE ratelimit:contact:203.0.113.7 3600

The rule: know what happens when Redis is gone

For each use of Redis, decide what should happen when it does not answer. For us:

  • The cache misses, and the page reads from Postgres. It is slower, not broken.
  • A sign-in rate limit lets people in, so an outage does not lock everybody out. Whether that is right depends on the product, so decide it on purpose.
  • A contact message is saved in Postgres first and queued second. The queue may lose a job, but not the message.

If losing a value would hurt a user, it does not belong only in Redis.

Mistakes to avoid

  • Caching before measuring. An index is often enough, and it never shows old data.
  • Caches that never expire. Give every key a lifetime, even a long one.
  • Two sources of truth. If the same value is written in both places, one of them will be wrong.
  • No backup test. A backup counts after you have restored it once.

When to add more

A search engine, a message broker or an analytics database can be the right choice. Wait for the signal: a query that stays slow with the right index, a queue that must replay its history, or reports that slow the product down. Until then, each new system is one more thing to update, back up and watch at night.

Ready to Build Something Great?

Whether you’re launching a startup, building a product, or scaling an existing business, we can help bring your vision to life.

Start a project

Tell us about your idea. We usually reply within one business day.