Quick revision
The short answer
I would base the decision on an inventory of why each cache exists: to protect a database, to cut latency, or to hide a poor data model or slow query. From that I would pick a small supported set of caching products and patterns run by a platform team, compare managed services with self-run clusters on total cost, reliability and staff, set standards such as required TTLs, owned key prefixes, size limits and staleness classes, and fund fixing the root causes that caches are masking, because that lowers both cost and incidents.
What to remember
In this answer, we built a long-term caching strategy from evidence. We inventoried why each cache exists and found the ones that protect databases, those that cut latency and those that hide poor queries or models. We chose a small supported set run by a platform team, compared managed and self-run options on cost, reliability and staff, set standards on TTLs, key ownership, sizes and staleness enforced by the client library, and funded root-cause fixes so that removing caches reduces both cost and incidents.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
I would base the decision on an inventory of why each cache exists: to protect a database, to cut latency, or to hide a poor data model or slow query. From that I would pick a small supported set of caching products and patterns run by a platform team, compare managed services with self-run clusters on total cost, reliability and staff, set standards such as required TTLs, owned key prefixes, size limits and staleness classes, and fund fixing the root causes that caches are masking, because that lowers both cost and incidents.
Why this question is asked
A fleet of Redis clusters used by hundreds of services is the kind of thing nobody designed: each team added a cache for a good local reason, and years later the organisation pays for hundreds of gigabytes of memory and keeps having incidents it cannot easily explain. At this level the interviewer is not asking how Redis works. They want to see how a senior leader turns a sprawling, costly situation into a strategy with evidence, choices and owners. In this answer, we will start with how to learn what the caches are really for, then decide on a supported set, weigh managed against self-run, set standards, and use funding to remove the caches that should not exist.
1Start With an Inventory of Why Each Cache Exists
Before changing anything, we need facts. A cache can exist for three quite different reasons. It may protect a database that would fall over without it, such as a product catalogue read 50,000 times per second. It may reduce latency for users, such as session data. Or it may hide a problem: a missing index, a query that joins eight tables, or a data model that forces every page to assemble data from four services. The first two are healthy uses; the third is a symptom.
The inventory lists, for each cluster and key prefix, the owning team, the data it holds, memory used, hit ratio, what happens if it is emptied, and incidents linked to it. Much of this can be gathered automatically from Redis INFO and keyspace statistics plus the service catalogue; the rest comes from short interviews with teams. In a typical fleet we would expect a long tail: a few clusters carry most of the value, and many hold data with low hit ratios that nobody would miss.
| Purpose | Share of memory | Typical hit ratio | Action |
|---|---|---|---|
| Protects a database | 45% | 95%+ | keep, run on the platform |
| Reduces latency | 25% | 80-95% | keep, apply standards |
| Masks a slow query or model | 20% | 60-90% | fund the root-cause fix |
| Unknown or unused | 10% | under 30% | retire |
2Choose a Supported Set and a Platform Team
Hundreds of teams each running their own clusters means hundreds of versions, configurations and on-call habits. A senior leader's job is to narrow the choices. We decide on a small supported set, for example one shared in-memory store such as Redis or a compatible fork, an in-process cache library such as Caffeine for local caching, and the CDN for public content, with documented patterns: cache-aside for reads, invalidation after commit, and no caches for decision data like balances.
A platform team operates the shared store as a product: provisioning, upgrades, monitoring, backups where needed, and a client library with good defaults. Teams keep ownership of what they cache and why; the platform owns how it runs. Anything outside the supported set needs a written exception, which makes unusual choices visible without banning them.
3Managed Service or Self-Run Clusters
The next decision is whether to buy a managed cache from the cloud provider or keep running our own clusters. The honest comparison includes more than the price per gigabyte. A managed service usually costs more in raw infrastructure, but handles patching, failover and scaling, and removes much of the on-call load. Self-run clusters can be cheaper on paper, especially on reserved or owned hardware, but need skilled staff, and a team of three or four engineers costs more each year than many clusters.
| Factor | Managed service | Self-run clusters |
|---|---|---|
| Infrastructure cost | higher per GB | lower per GB |
| Staff | small platform team | dedicated operators, 24x7 on-call |
| Upgrades and patching | provider | us, often delayed |
| Failover and reliability | built in, tested by provider | only as good as our tooling |
| Control and tuning | limited | full |
| Licence and vendor risk | check terms | check the licence of the version |
Often the result is mixed: managed services for the general fleet and self-run only where scale or control truly pays, such as one very large cluster. Licence terms of the store itself have also changed in recent years, so the decision should include a legal check of the version we run; check the current terms for your choice.
4Set Standards That Prevent Incidents
Many cache incidents come from the same few causes: keys with no TTL that fill memory until eviction starts dropping important data, huge values that block the single-threaded server, hot keys, and data nobody knows how to clear after a failover. Standards target exactly these. Every key needs a TTL. Keys follow a naming scheme with an owner prefix, such as orders:svc-checkout:order:42, so we always know who to call. Values have a size limit, for example 100 KB, checked by the client library. Every cached data set declares a staleness class that sets its maximum TTL.
Standards are much more effective when the client library enforces them than when they live in a wiki. A put without a TTL is rejected, a value over the limit logs and fails in tests, and the owner prefix is added automatically. The platform then reports compliance per team, which turns standards into something we can measure.
5Fund the Fixes Caches Are Hiding
The most valuable part of the strategy is often removing caches. When a cache exists only because a query is slow, every incident, every gigabyte and every stale-data bug is a cost of that slow query. Fixing the query or the data model removes the cost permanently. But teams rarely get time for this, because the cache appears to work. So the leader funds it explicitly: a small programme that takes the top masked problems from the inventory, fixes them, and retires the matching caches.
We measure the outcome in money and incidents: memory freed, clusters retired, and the drop in cache-related incidents per quarter. These numbers are what we take back to the leadership group to justify the platform team and the remediation work, and they keep the strategy honest over time.
- Does it protect a database or cut latency?YesKeep: move to the supported platformNoNext question
- Does it hide a slow query or model?YesFund the fix, then retire the cacheNoNext question
- Is anyone using it?YesBring it under the standardsNoRetire it
3 steps in order. Play them, or step through them one at a time.
6Follow-up questions
How do you stop teams adding new caches outside the strategy?
We make the supported path the easiest one. A team that needs a cache gets one from the platform in minutes, through the service template, with the client library and dashboards already set up. Going outside needs an exception with a reason. Combined with cost reporting per team, this usually ends the habit of starting private clusters.
What if a platform team becomes a bottleneck?
It becomes one when every change needs a ticket. We avoid that by giving teams self-service for normal requests, such as creating a namespace or raising a memory quota within limits, and keeping the platform team for operations, upgrades and the hard cases. We also measure how long requests take and treat that as a service level of the platform.
How long would such a strategy take?
The inventory takes a few weeks with tooling. Choosing the set and standing up the platform takes one or two quarters. Migration and the remediation programme run for a year or more, ordered by cost and incident risk, so the biggest savings come early.
7Conclusion
In this answer, we built a long-term caching strategy from evidence. We inventoried why each cache exists and found the ones that protect databases, those that cut latency and those that hide poor queries or models. We chose a small supported set run by a platform team, compared managed and self-run options on cost, reliability and staff, set standards on TTLs, key ownership, sizes and staleness enforced by the client library, and funded root-cause fixes so that removing caches reduces both cost and incidents.
Open with
I would begin with an inventory, because without it any strategy is opinion. For each cluster and key prefix I want the owner, what the data is, memory, hit ratio, and what happens if it is flushed.
Then, if they want more
That lets me sort caches into three groups: those protecting a database, those cutting latency, and those hiding a slow query or a poor data model.
Then I would choose a small supported set, say one shared in-memory store, Caffeine for local caching and the CDN, with documented patterns, and give it to a platform team that runs it as a product with a good client library.
For managed versus self-run I would compare total cost, including the engineers needed for 24-hour on-call and upgrades, not just price per gigabyte; often the answer is managed for most of the fleet and self-run for one or two very large clusters.
I would set standards that address the usual incidents: every key has a TTL, keys carry an owner prefix, values have a size limit, and every data set has a staleness class, all enforced by the library rather than a wiki.
And I would fund fixing the queries and models that caches mask, because retiring those caches removes cost and incident risk at the same time. I would report progress as memory freed, clusters retired and incidents per quarter.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Cloud documentation, Resilience4j documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Your organisation spends heavily on a fleet of Redis clusters used by hundreds of...": https://scrivio-interview-library.netlify.app/spring-boot/distributed-data/eb919aefbe/