Quick revision
The short answer
I would first make memory visible: regular offline RDB analysis that shows memory per team and per key pattern, keys without TTLs, encodings and value sizes, with cost charged back to the owners. Then I would remove waste, right-size and consolidate instances, move data that does not need RAM to cheaper storage, and make the savings last with TTL rules, size limits, key reviews and a quarterly cost review, while writing failover and peak headroom into the targets so savings never come out of safety.
What to remember
In this answer, we saw that cutting Redis cost starts with making memory visible per team and per key pattern through offline RDB analysis and chargeback. Savings then come in order of risk: removing waste, right-sizing and consolidating, and moving data that does not need RAM. Rules on TTLs, sizes, key reviews and quarterly reviews keep the savings, and failover, peak and fork headroom are written into the targets so that safety is never the hidden source of the saving.
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 first make memory visible: regular offline RDB analysis that shows memory per team and per key pattern, keys without TTLs, encodings and value sizes, with cost charged back to the owners. Then I would remove waste, right-size and consolidate instances, move data that does not need RAM to cheaper storage, and make the savings last with TTL rules, size limits, key reviews and a quarterly cost review, while writing failover and peak headroom into the targets so savings never come out of safety.
Why this question is asked
Cost-reduction mandates are a test of leadership more than of Redis knowledge. Cutting 40 percent is easy to do badly: shrink nodes, remove replicas, raise maxmemory, and wait for the next peak to show what we broke. Interviewers ask this at senior levels to hear how we turn an unknown cost into an owned one, in what order we take savings, and which lines we will not cross. In this answer, we will start with visibility, go through the savings in order of risk, set up the rules that keep the savings, and be explicit about safety.
1Why Nobody Knows Where the Memory Goes
Shared Redis fleets grow by accretion. A team adds a cache for a feature, the feature changes, the keys stay. Another team caches the same product data in a slightly different format. Keys are written without a TTL because the first version did not need one. None of this shows in the cloud bill, which only says how many nodes of which size we pay for.
So the first problem is not technical. It is that nobody owns the memory, and an unowned cost never shrinks. Our first job is to give every gigabyte a name.
2Make Usage Visible
We run offline RDB analysis regularly, weekly is usually enough, on snapshots taken from replicas, so production is never touched. An RDB analysis tool reads the file and reports, for every key, its type, encoding, size, element count and TTL. Grouping by key prefix (orders:, session:, reco:) and mapping prefixes to teams gives memory per team and per pattern.
From the same data we list keys without TTLs, the largest keys, values that look like JDK serialization (they start with a recognisable header), and patterns that have not been read for weeks, which we can check with OBJECT IDLETIME on samples. Then we publish it: a dashboard per team, and a monthly cost charged back to each team's budget. Teams start cleaning up as soon as the number has their name on it.
3Remove Waste
The first savings are the safest. Keys without TTL that nobody reads can be expired after a confirmation with the owner. Duplicate caches of the same data, for example product details cached by three services in three formats, can become one shared cache. JDK-serialized values are often three to five times larger than JSON, and a compact binary format such as Protobuf shrinks them further; switching serializers in Spring Data Redis is a configuration change plus a migration. Large values that compress well, such as JSON documents above a few kilobytes, can be compressed in the client.
Finally, oversized headroom: instances provisioned at three times their peak "to be safe" years ago. In many fleets, this first step alone delivers half of the target.
| Step | Typical saving | Risk |
|---|---|---|
| Expire dead keys, add TTLs | 10-20 percent | low, owner confirms |
| Merge duplicate caches | 5-10 percent | low to medium |
| Compact serialization, compression | 10-30 percent of affected data | medium, needs migration |
| Right-size and consolidate nodes | 15-30 percent of cost | medium, needs headroom rules |
| Move cold data out of RAM | varies widely | medium, latency changes |
4Right-Size and Consolidate
With waste removed, we match node types and maxmemory to real peaks plus the agreed headroom. Many instances run at 15 percent of their memory; two or three of them can merge into one, with separate key prefixes and ACL users per team. Memory-optimised instance types often cost less per gigabyte than general-purpose ones.
Engine versions matter too. Newer Redis and Valkey releases have reduced per-key overhead in some cases, and where the release notes and our own tests on our data show a saving, an upgrade is a saving that also brings fixes. We should measure it on our own RDB files before counting it in the plan.
5Move Data That Does Not Need RAM
Some data is in Redis only because it was easy. Order history read once a month, analytics events waiting for a batch job, large documents read rarely: these can live in a database, an object store such as S3, or a log such as Kafka. Where a provider offers RAM-plus-flash tiers and the access pattern has a small hot set and a large cold tail, that can halve the cost of an instance. Each move changes latency for that data, so it is decided with the owning team.
6Make the Savings Last, Safely
Savings decay unless the rules change. On shared clusters, TTLs become required, enforced by review and by alerts on new keys without them. Size limits per value and per key, review of new key patterns in design reviews, and a quarterly cost review with each team keep the fleet from growing back.
And safety must be explicit. The targets include, in writing, the headroom needed for failover (a replica must be able to take a primary's full load), for peak events and for forks. If the only way to reach 40 percent is to remove that headroom, we report a lower achievable number with the reason, rather than meeting the target and causing the incident.
- Quarter 1: visibilityRDB analysis, per-team dashboards, chargeback
- Quarter 1-2: remove wastedead keys, TTLs, duplicates, serialization
- Quarter 2-3: right-sizeconsolidate instances, node types, upgrades
- Quarter 3-4: move cold datadatabases, object storage, flash tiers
- Every quarter: reviewcost per team, new key patterns, headroom
5 steps in order. Play them, or step through them one at a time.
7Follow-up questions
Which savings would you refuse even if they reached the target?
Removing replicas from instances whose loss would cause an outage, running primaries above the memory needed for forks and failover, turning off persistence for data that is not rebuildable, and moving latency-critical data to slower tiers without the owning team's agreement. I would show finance the saving each of these would bring and the risk it carries, and recommend against them.
How do you get teams to cooperate?
By giving them their own numbers and the credit for savings. A dashboard that shows a team's cost and a monthly chargeback creates the motivation; offering a ready migration path, such as a serializer change in a shared library, removes the effort.
What if the analysis shows 40 percent is not possible safely?
Then I say so early with evidence: what we can save, what the rest would cost in risk, and what investment, such as moving a large dataset out of Redis, would close the gap. A credible 30 percent is more useful than a promised 40 that ends in an outage.
8Conclusion
In this answer, we saw that cutting Redis cost starts with making memory visible per team and per key pattern through offline RDB analysis and chargeback. Savings then come in order of risk: removing waste, right-sizing and consolidating, and moving data that does not need RAM. Rules on TTLs, sizes, key reviews and quarterly reviews keep the savings, and failover, peak and fork headroom are written into the targets so that safety is never the hidden source of the saving.
Open with
My first step would be visibility, because nobody can cut a cost nobody owns. I would run regular offline RDB analysis on replica snapshots to get memory per team and per key pattern, keys without TTLs, encodings and value sizes, put it on dashboards and charge the cost back to the owning teams.
Then, if they want more
Then I remove waste, which is the safest saving: keys without TTL that nobody reads, duplicate caches of the same data, JDK-serialized values that are several times bigger than JSON or binary formats, large uncompressed values, and headroom that was oversized years ago.
Next I right-size and consolidate: match node types and maxmemory to real peaks, merge underused instances, and upgrade engine versions where the release notes and our own tests show lower per-key overhead.
After that I move data that does not need RAM, cold data to a database or object store, and use RAM-plus-flash tiers where the provider has them and the access pattern fits. To make it last: required TTLs on shared clusters, size limits, review of new key patterns and a quarterly cost review.
And I write failover and peak headroom into the targets, so if 40 percent would mean giving up safety, I report that clearly instead.
About this answer
- Last updated
- 13 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
- Redis 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 "As the senior technical leader, how do you approach this without causing incidents?": https://scrivio-interview-library.netlify.app/databases/redis-internals/b90d6219ab/