Video in progress
A team wants to use Redis Streams for an event stream instead of Kafka because Redis is already there. When is that enough, and when is it a mistake?
Streams are good for small and medium volume, short-retention queues between one or two services: low latency, consumer groups, simple operation. If you need long retention, large volume, many independent consumers, replay and strong durability, use Kafka.
📖 Answer
The comparison on practical points:
| Redis Streams | Kafka | |
|---|---|---|
| Storage | in RAM, trimmed with MAXLEN |
on disk, days/months |
| Volume | limited by memory | terabytes |
| Durability | AOF + async replica | acks=all, ISR, synchronous replication |
| Scaling | one stream, one node | a topic is split into partitions |
| Replay | back to whatever is left in the stream | from any offset within retention |
| Ecosystem | simple | Connect, Streams, schema registry |
| Latency | sub-millisecond | usually milliseconds |
The cases where Redis Streams is enough:
- a work queue inside a service (image processing, sending email), hundreds of thousands of messages per hour;
- messages are processed within minutes/hours and aren't needed afterwards;
- one or two consumer groups;
- if something is lost, it can be recreated from the source (the DB).
The cases where it's a mistake:
- event sourcing or audit: if the event is the single source of truth, RAM and asynchronous replication aren't suitable;
- a slow consumer: if one analytics consumer falls a day behind, the stream fills memory, or
MAXLENdeletes its unread messages; - dozens of consumers, each at its own pace: in Kafka this is natural, in Redis it's memory pressure;
- high throughput: one stream lives on one thread of one node. To split it you have to manage several streams by hand (partitioning it yourself).
The condition I set: if Streams is chosen, there should be a clear path to move the flow to Kafka. The message format should be independent of the transport (JSON/Avro), with the producer/consumer behind an abstraction. That way the short-term benefit of "Redis is already there" doesn't become a future lock-in.
Often the right answer is both: Kafka for organization-level events, Redis Streams for short work queues inside a service.
Sign up to mark studied questions and save your progress.