Quick revision
The short answer
Redis grew by adding data structures and modules that keep its low latency, which makes it excellent for specific access patterns but not a general replacement for a relational or document database. Its memory cost, durability limits, lack of ad hoc queries across structures and limited transactions are structural, not missing features. So we ask which requirements truly need sub-millisecond access and which need queries, constraints and long retention, check which features exist in which distribution, and set a policy: approved for caching, sessions, rate limits, leaderboards and queues, with other uses needing an architecture decision record.
What to remember
In this answer, we saw that Redis evolved by adding data structures and modules that preserve its low latency, which makes it outstanding for prepared access patterns but not a general database. Memory cost, asynchronous durability, the lack of ad hoc queries and constraints, and limited transactions are structural. We mapped requirements to stores by asking which need sub-millisecond access and which need queries and retention, checked distribution and licence differences for newer features, and set a policy that approves the classic Redis uses and requires an architecture decision record for everything else.
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.
Redis grew by adding data structures and modules that keep its low latency, which makes it excellent for specific access patterns but not a general replacement for a relational or document database. Its memory cost, durability limits, lack of ad hoc queries across structures and limited transactions are structural, not missing features. So we ask which requirements truly need sub-millisecond access and which need queries, constraints and long retention, check which features exist in which distribution, and set a policy: approved for caching, sessions, rate limits, leaderboards and queues, with other uses needing an architecture decision record.
Why this question is asked
Every few years a tool that solved one problem brilliantly is proposed for every problem. Redis is a strong candidate today: it now handles JSON documents, full-text and vector search, time series and probabilistic structures, and teams who love its speed reasonably ask why they need anything else. Interviewers ask this leadership question to see whether we can judge a technology by its design, not its feature list, and turn that judgement into a clear policy that still allows good exceptions. In this answer, we will look at how Redis evolved and why, identify the structural limits that remain, map product requirements to the right store, consider the distribution question, and set the policy.
1How Redis Evolved, and Why It Matters
Redis began as an in-memory key-value store with a few data structures: strings, lists, sets, hashes and sorted sets, each changed by small atomic commands on a single thread. Over time it added streams, then modules that brought JSON documents, search with secondary indexes, time series, Bloom filters and vector similarity. Recent releases bundle much of that into the main distribution.
Notice the pattern: each addition is a new structure with its own commands, designed to keep the core promise of very low latency on data held in memory. That is a sound design, and it explains what Redis is good at. It does not turn Redis into a general database, because the trade-offs that make it fast are still there.
2The Constraints That Are Structural
The first is memory cost. Redis keeps the dataset in RAM, which costs many times more per gigabyte than disk. A 2 TB product database is affordable in PostgreSQL and very expensive in Redis, and the gap grows with retention.
The second is durability. Redis persists through snapshots and an append-only file, with fsync every second by default, and replication to replicas is asynchronous. A failover can lose writes that were acknowledged to the client. That is acceptable for a cache or a session and serious for an order or a payment.
The third is querying. Redis answers questions we prepared for by choosing the right structure and key. It has no general query planner that joins across structures or answers a new business question tomorrow. Search modules add indexes over JSON or hashes, which helps, but ad hoc reporting, joins and constraints such as foreign keys remain outside its design.
The fourth is transactions. MULTI and EXEC run a group of commands without interleaving, and Lua scripts run atomically, but there is no rollback of earlier commands on a logic error, and nothing like multi-statement isolation across a long business operation. These are not features waiting to be built; they follow from being a single-threaded, in-memory structure server.
| Concern | Redis | Relational or document database |
|---|---|---|
| Latency | sub-millisecond for prepared access | milliseconds, indexed queries |
| Cost per GB | RAM, high | disk, much lower |
| Durability | async replication, fsync per second | synchronous commit options |
| New questions | need new structures or keys | ad hoc SQL or queries |
| Constraints | none beyond the structure | unique, foreign keys, checks |
| Retention | expensive to keep years | cheap, partitioned, archived |
3Mapping Requirements to the Right Store
Instead of arguing about Redis in general, we ask each product proposal two questions. Which of its requirements genuinely need sub-millisecond access at high request rates? And which need queries we cannot predict, constraints, joins, reporting or long-term retention? A product usually has both kinds.
Consider a new loyalty programme. Showing a member's current points on every page view and enforcing a rate limit on redemptions are hot paths that suit Redis well. Storing every points transaction for seven years, answering support questions about a disputed balance, and running monthly finance reports suit a relational database. The good design uses both: the database is the source of truth, and Redis holds a fast, rebuildable view.
- Is it a source of truth that must not be lost?YesDurable database firstNoRedis may own it
- Does it need ad hoc queries, joins or constraints?YesDurable databaseNoContinue
- Does it need sub-millisecond access at high rates?YesRedis view in frontNoDatabase alone is enough
- Approved pattern: cache, session, rate limit, leaderboard, queue?YesUse Redis under the standardNoWrite an architecture decision record
4 steps in order. Play them, or step through them one at a time.
4The Distribution Question
Before building on newer features, we also check where they live. In 2024 Redis moved from the BSD licence to source-available licences, the Valkey fork was created under the Linux Foundation, and Redis later added an AGPL option. Cloud providers offer their own managed variants. Core commands are broadly compatible across them, but modules such as search, JSON, time series and vector features differ in availability, version and licence terms between distributions.
So a product that depends on vector search inside Redis may be tied to one distribution or one cloud offering. That can be acceptable, but it must be a conscious decision, with legal and procurement aware of the terms, rather than something we discover during a migration.
5Setting the Policy
The policy we set is simple. Redis is approved, with a standard configuration, for caching, sessions, rate limits, leaderboards and counters, and lightweight queues. Any other use, such as Redis as the primary store for business records, or relying on search, JSON or vector modules for a core feature, needs an architecture decision record. That record must state what data can be lost and how much, the memory cost now and in three years, how the data is backed up and restored, how reporting and support queries will be answered, and which distribution features it depends on.
This keeps teams fast on the patterns Redis serves well and makes the risky uses deliberate. It also shows respect for the proposal: we are not saying no, we are asking for the analysis that a durable decision deserves.
6Follow-up questions
What evidence would change your view?
Evidence that the structural limits no longer apply to a given use. For example, a measured workload where the full dataset is small enough that RAM cost is irrelevant, where losing a second of writes during a failover is acceptable to the business, and where all queries are known in advance. Or a durable, Redis-compatible store with synchronous replication and disk-based storage that our tests show meets our recovery objectives. With that evidence, I would approve the use for that product through its decision record.
Isn't Redis with AOF always and replicas durable enough?
It narrows the loss, but replication remains asynchronous, so a failover can still lose acknowledged writes, and appendfsync everysec allows about a second of loss on a crash. WAIT can make a client wait for replicas, but it does not make the system strongly consistent. For data whose loss is acceptable in small amounts this is fine; for money or orders it usually is not.
Why not let each team decide for itself?
Teams should decide, but with shared information. A team optimising for its launch date may not price the memory bill in year three or the cost of a migration later. The decision record gives them a checklist of the risks the organisation has learned about, and a reviewer who has seen similar cases, without blocking the approved patterns.
7Conclusion
In this answer, we saw that Redis evolved by adding data structures and modules that preserve its low latency, which makes it outstanding for prepared access patterns but not a general database. Memory cost, asynchronous durability, the lack of ad hoc queries and constraints, and limited transactions are structural. We mapped requirements to stores by asking which need sub-millisecond access and which need queries and retention, checked distribution and licence differences for newer features, and set a policy that approves the classic Redis uses and requires an architecture decision record for everything else.
Open with
I would judge it by Redis's design rather than its feature list. Redis grew by adding structures and modules, JSON, search, time series, vectors, each built to keep its core strength: very low latency on data in memory, changed by atomic commands on one thread.
Then, if they want more
That makes it excellent for specific access patterns, but the limits are structural, not missing features: RAM is expensive per gigabyte, persistence is snapshot or append-only with fsync per second by default, replication is asynchronous so failover can lose acknowledged writes, there is no general query planner for ad hoc questions, joins or constraints, and transactions do not roll back.
So for each proposal I ask which requirements truly need sub-millisecond access and which need queries, constraints and long retention, and usually the answer is a durable database as the source of truth with Redis as a fast view.
I would also check which distribution provides the features, because after the 2024 licence change, Valkey and cloud variants differ, especially for modules. My policy would approve Redis for caching, sessions, rate limits, leaderboards and queues under a standard configuration, and require an architecture decision record with data loss, cost, recovery and query analysis for anything else.
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
- 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 "Redis started as a simple in-memory cache and now offers JSON documents, search, time...": https://scrivio-interview-library.netlify.app/databases/redis/2e11e4966a/