Scrivio Interview library
DesignIntermediate7 min read · updated 12 November 2026

A team proposes Redis Streams instead of Kafka for order events between six services, about 2,000 events per second, with a need to replay the last 7 days. How do you evaluate the choice?

At 2,000 events per second Redis Streams can easily keep up, so throughput is not the deciding question. The deciding questions are retention, durability and scaling: seven days of events must sit in memory, replication is asynchronous so entries can be lost on failover, and one stream lives on one shard. For cross-service order events that need a week of replay, Kafka is the better fit; Redis Streams suit short-lived work queues inside one service.

Why this question is asked

Choosing a messaging backbone is a decision that is cheap to make and expensive to undo, because once six services publish and consume order events, everything depends on how that log behaves. A team often proposes Redis Streams because Redis is already running and the API is pleasant. Interviewers ask this to see whether we evaluate a design against its actual requirements instead of against general reputation. In this answer, we will put numbers on the memory needed for seven days, compare durability under failure, look at how each system scales and replays, weigh the ecosystem, and reach a recommendation along with the cases where Redis would win.

1A Quick Recap of the Two Systems

Redis Streams are an append-only log stored in a single Redis key, held in memory. Producers XADD entries, consumer groups track which entries each group has processed, and XACK confirms them. Persistence to disk comes from Redis's usual mechanisms, RDB snapshots and the AOF (append-only file), and high availability from asynchronous replicas.

Kafka is an append-only log stored on disk. A topic is split into partitions, each partition is replicated to several brokers, and consumers in a consumer group divide the partitions among themselves and record their position as offsets. Retention is a setting, such as retention.ms for seven days, and old segments are deleted by time or size. Both systems therefore offer a log with consumer groups. The differences are in where the log lives and what happens when a machine dies.

2Throughput Is Not the Problem; Retention Is

2,000 events per second is modest for either system. A single Redis instance handles tens of thousands of XADD calls per second. So we should spend our evaluation on the requirement that actually hurts: replay of the last seven days.

Let us do the arithmetic. Seven days is 604,800 seconds, so we keep about 1.2 billion entries. If an order event is around 500 bytes of fields, and Redis's per-entry overhead in its compact listpack encoding brings that to, say, 600 bytes, the stream needs roughly 725 GB of RAM before replicas. With one replica that doubles to about 1.45 TB of memory, plus headroom for fork-based snapshots.

Seven days at 2,000 events per second
AspectRedis StreamsKafka
Entries keptabout 1.2 billionabout 1.2 billion
Where they liveRAM, about 725 GB per copyDisk, about 600 GB per copy
CopiesPrimary + replicas (async)Replication factor 3
Replay of 7 daysReads from memory of the same shardSequential disk reads, isolated
Retention controlMAXLEN or MINID trimmingretention.ms per topic
Rough figures with 500-byte events; measure your own sizes.

Kafka keeps the same data on disk: about 600 GB per copy, 1.8 TB with replication factor 3, on ordinary SSDs that cost a small fraction of the same amount of RAM. Kafka also reads old data sequentially from disk and the page cache, so a replay of a week does not disturb the brokers' handling of new writes much. The exact numbers depend on event size and encoding, which we would measure, but the ratio is what matters: memory for a week of history is the expensive part of the proposal.

3What Happens When a Node Fails

Order events between services usually carry money, so we must ask what is lost when the primary dies. Redis replicates asynchronously: the primary acknowledges XADD to the producer and sends it to replicas a moment later. If the primary crashes in between, the promoted replica does not have those entries, and the producer believes they were written. AOF with appendfsync everysec adds disk persistence, but it can still lose about a second of writes on a crash. The WAIT command can make a producer wait for replicas, but it reduces the window rather than making failover lossless.

Kafka was designed for this case. A producer with acks=all, a topic with replication factor 3 and min.insync.replicas=2 gets an acknowledgement only after two brokers have the record, and a leader election picks only an in-sync replica. Losing one broker loses no acknowledged events. Enabling idempotence on the producer, the default in recent clients, also stops retries from creating duplicates.

Step throughFailover just after a write
Order serviceRedis primaryRedis replica
XADD orders * orderId 1005
id returned: write acknowledged
crashes before replicating
promoted to primary
XREADGROUP: entry 1005 is missing

5 messages in order. Play them, or step through them one at a time.

Asynchronous replication acknowledges before the replica has the entry.

4Scaling and Replay

A stream is one key, and in Redis Cluster one key lives on one shard. All 2,000 events per second and the whole week of history sit on one primary's memory and CPU. To spread load we would create several streams, orders:{0} to orders:{7}, and route by order id in every producer and consumer. That works, but it is custom code that every one of six services must get right, including rebalancing when we change the count.

Kafka partitions a topic natively. The producer hashes the key to a partition, which also keeps each order's events in order, and the consumer group rebalances partitions across instances automatically. Replay is a first-class operation too: a new service, or one fixing a bug, resets its group's offsets to a timestamp seven days ago with kafka-consumer-groups --reset-offsets --to-datetime and reprocesses. In Redis we can XREADGROUP from an older id with a new group, which is similar, but the history must still be in memory.

5Ecosystem and Operations

Kafka brings Kafka Connect for moving events into databases and warehouses, a schema registry for evolving event formats safely, stream processing libraries, and wide monitoring support. For cross-service events these matter, because six teams will evolve their payloads independently. Redis Streams have none of this built in, though Spring Data Redis offers a usable listener container.

In fairness, Redis Streams are much simpler to run if Redis is already in production and nobody operates Kafka yet. A Kafka cluster, even in KRaft mode without ZooKeeper since Kafka 4, is another system to patch, size and monitor, unless we use a managed offering.

6Reaching a Recommendation

Putting it together, the requirement for a week of replay across six services points to Kafka. The requirement makes Redis expensive (memory), weaker (failover loss) and more complex (manual sharding), while Kafka gets each of these for free. So I would recommend Kafka for the order event backbone, using a managed service if the company has no Kafka experience.

That does not make the team's idea wrong in general. Redis Streams are a good choice for short-lived work queues inside one service, for example dispatching thumbnail jobs among workers, where entries live for minutes, are trimmed aggressively and could be regenerated if lost. I would document the decision with the numbers above, so it can be revisited if the requirements change.

7Follow-up questions

What would make Redis Streams the better choice?

If retention were short, such as an hour, the memory cost would be a few gigabytes. If the events were reproducible or loss-tolerant, asynchronous replication would be acceptable. If the consumers were inside one service or one team, the lack of schema tooling would matter less. And if the company already ran Redis well but had no Kafka skills or managed option, the operational simplicity could outweigh the rest. With all of those, Redis Streams would be a simpler and cheaper solution.

Could we keep a short window in Redis and archive older events elsewhere?

Yes, a tiered design can work: trim the stream to a few hours and have a consumer copy every entry to object storage or a database for longer replay. But then replay means writing a tool that reads from the archive and republishes, and we have rebuilt part of Kafka with more moving parts. It is usually better to choose the system that offers retention natively.

Is Kafka's ordering stronger than Redis Streams?

A single Redis stream is totally ordered, which is actually stronger than Kafka's ordering per partition. But it stops scaling at one shard. Kafka gives ordering per key, which is what order events need: all events of order 1001 stay in order within its partition, while different orders are processed in parallel.

8Conclusion

In this answer, we saw that throughput was never the issue at 2,000 events per second. Seven days of retention means around 1.2 billion entries, which costs roughly 725 GB of RAM per copy in Redis but cheap disk in Kafka. Redis's asynchronous replication can lose acknowledged events on failover, a stream cannot scale past one shard without custom routing, and Kafka brings Connect and schema tooling. So Kafka fits cross-service events with replay, and Redis Streams fit short-lived work queues inside a service.

What to say in the interviewAbout 80 seconds aloud

Open with

I would first say throughput is not the concern: 2,000 events a second is easy for Redis. The concerns are retention, durability and scaling. Seven days at that rate is about 1.2 billion entries; at around 600 bytes each that is roughly 725 GB of RAM for one copy, double with a replica, whereas Kafka keeps the same data on cheap disk with replication factor 3.

Then, if they want more

On durability, Redis replicates asynchronously, so an XADD acknowledged just before a primary crash can be missing after failover, and AOF everysec can lose about a second; Kafka with acks=all, min.insync.replicas=2 and an idempotent producer does not lose acknowledged records.

On scaling, a stream is one key on one shard, so spreading load means multiple streams and custom routing in all six services, while Kafka partitions by key natively and replays with an offset reset to a timestamp. Kafka also brings Connect and a schema registry, which matter when six teams evolve events.

So my recommendation is Kafka for the cross-service order events, managed if we lack Kafka experience, and Redis Streams for short-lived work queues inside a single service, where entries live minutes and loss is tolerable.

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 "A team proposes Redis Streams instead of Kafka for order events between six services...": https://scrivio-interview-library.netlify.app/databases/redis/26143c754f/