BusiRocket

Technology

Redis

Redis does one thing extremely well: answer in microseconds with data that has already been computed. That is why it fits in three specific places - cache, queues and sessions - and sits awkwardly almost everywhere else.

The decision that matters is not installing it. It is what gets stored and when it stops being valid. A cache with no invalidation policy does not make a site faster; it makes it a site that serves old data unpredictably. The key has to include everything that changes the answer - language, permissions, deployed version - or sooner or later one user sees another user's content.

The second decision is what happens when it is not there. A cache has to be able to fail without taking the site down: the application loses speed and keeps answering. A session store or a job queue does not allow that, and this is where the high-availability topology comes in - a replica and Sentinel, so promotion is automatic and the application never has to know which node is in charge.

In practice that comes down to unglamorous things: the version pinned per environment instead of following the latest tag, the connection string injected as a secret rather than written into the image, and a memory limit with an eviction policy chosen deliberately instead of whatever the default is.

What almost nobody measures is the hit rate. A cache running at 30% hits adds a dependency and a network round trip in exchange for very little, and until it is instrumented it looks like it works because the site has not broken. Measuring hits and misses per key type is what separates a cache that earns its place from one that only occupies memory.

There is also a prior question worth asking before installing anything: why is the query you want to cache slow. Very often the reason is a missing index or a query pulling columns nobody reads, and there a cache does not fix the problem - it hides it, and adds something to maintain. Caching a query that is already fast makes sense when it runs thousands of times a minute; caching a slow one usually just covers up the real fix.

The specifics

  • Redis in high availability with Sentinel, deployed through Helm and with the connection injected as a secret, never written into the image.

  • Cache and sessions on platforms at 372 million sessions a year and 18,000 concurrent users at peak.

  • Versions pinned per environment (Redis 6.2 and 7) rather than following whatever the latest tag happens to be.

Projects built this way

How we work

Four steps, no surprises

The same process on a three-week engagement and on a two-year platform.

  1. 01

    Scope

    One session to understand the business process, not to show templates. We leave with priorities and a phased price.

  2. 02

    Architecture

    Data model, integrations and a performance budget before the first screen is written.

  3. 03

    Build

    Weekly releases to an environment you can visit. What gets approved gets deployed, it does not pile up.

  4. 04

    Operation

    Monitoring, verified backups and deployments anyone on the team can run.

Frequently asked questions

Do I need Redis, or is the database enough?

The database is usually enough, and saying so is part of the job. Redis earns its place when an expensive query repeats often, when sessions cannot live on a single server, or when background work has to be queued. If the problem is one slow query running once per page, the fix is normally an index, not a cache.

What happens when Redis goes down?

That question decides the design. A cache must be able to fail without taking the site with it: the application falls back to the database and answers more slowly. A queue or a session store does not forgive the same way, which is why those run with Sentinel and a replica. Turning Redis into a single point of failure is the most common mistake, and it is a design mistake rather than a Redis one.

Can it be the primary database?

It can, and it almost never should be. Redis persists, but its durability model is not a relational database's and memory is expensive. As a cache, a queue, a counter or a session store it is excellent; as the system of record for your invoices, it is not.

How do you avoid serving stale content?

By deciding invalidation before deciding the cache. Time-based expiry when the data tolerates minutes of lag, explicit invalidation on write when it does not, and a key that includes everything which changes the answer: language, permissions and deployment version. Most cache bugs are incomplete keys, not badly chosen lifetimes.

Next step

Tell us what the system has to do

We reply within one business day with a phased scope proposal, or with the reason we are not the right studio for it.