On this page
Short answer
Choose Kafka when events are a record that other systems will read later: topics keep data on disk for a retention period you set per topic, seven days by default, any consumer can replay from an earlier offset, and a message counts as committed only once every in-sync replica has it. Choose Redis Streams when Redis is already in production and the events you need fit in memory: consumer groups and per-entry acknowledgement come with no new infrastructure. Use Redis Pub/Sub only for notifications you can afford to miss. Many systems run both, with Kafka as the event log and Redis as the cache built from it.
Redis and Kafka as event and messaging systems, on the same criteria
| Redis | Apache Kafka | |
|---|---|---|
| What it is | In-memory data store with Pub/Sub, Lists and Streams | Distributed log of partitioned, replicated topics |
| Where data lives | Memory, with optional RDB snapshots and an append-only file | Disk, written through the operating system's page cache |
| Loss window on a crash | About one second with appendfsync everysec; minutes with RDB alone | None for committed messages while one in-sync replica survives |
| Replication | Asynchronous; Redis Cluster can lose acknowledged writes | A message is committed once all in-sync replicas apply it |
| Retention | Until trimmed with MAXLEN or MINID, bounded by RAM | Per topic by time or size; 168 hours by default |
| Scaling one stream | A stream is one key, so it lives on one shard | A topic is split into partitions across brokers |
| Consumer groups | XREADGROUP, per-entry XACK and a Pending Entries List | One consumer per partition per group; position is an offset |
| Ordering | Entry ID order within a stream | Order within a partition; equal keys share a partition |
| Ecosystem | Client libraries; streams are one data type among many | Kafka Connect, Kafka Streams, transactions |
Redis Streams, Pub/Sub and Lists vs Kafka topics
Redis offers three ways to move messages. Pub/Sub has at-most-once delivery: a subscriber that is offline or fails mid-message never sees it again. Lists work as simple job queues. Streams are an append-only log with random access by ID and consumer groups, which makes them the only Redis structure comparable to Kafka.
A Kafka topic can have many producers and many subscribers, and events are not deleted when they are read. Each topic is split into partitions spread over brokers, and events with the same key always go to the same partition. Kafka architecture covers brokers, partitions and replication in depth.
Durability: AOF and RDB vs a replicated log
Redis persists an in-memory dataset in two ways. RDB snapshots are usually taken every five minutes or more, so the Redis persistence guide says to expect to lose the latest minutes of data after an unclean stop. The append-only file with appendfsync everysec narrows that to about one second. RDB's fork() can pause Redis for milliseconds, or up to a second on a very large dataset. Replication is asynchronous, and the Redis Cluster documentation states that it can lose writes it has acknowledged to the client.
Kafka writes every message to a log on disk, though not necessarily flushed, and relies on replication for safety. A message is committed only when all in-sync replicas for its partition have applied it, and a committed message is not lost while one broker holding a replica remains alive. The Kafka documentation calls a replication factor of three a common production setting.
Retention and replay
A Redis stream keeps entries until it is trimmed, either with MAXLEN for a fixed length or MINID for entries older than an ID. Replay with XRANGE works for whatever is still in memory. Kafka retention is a per-topic setting: log.retention.hours defaults to 168 and log.retention.bytes is unlimited by default. Kafka's documentation says its performance is effectively constant with data size, so long retention is normal. Log compaction keeps the latest value for each key instead of deleting by age.
Consumer groups in both: XREADGROUP vs Kafka consumer groups
Redis borrowed the term from Kafka, and its documentation says plainly that Redis consumer groups have nothing to do with Kafka's in implementation. With XREADGROUP, each consumer in a group receives different entries, each delivered entry stays in the group's Pending Entries List until XACK, and XAUTOCLAIM hands a dead consumer's entries to a live one. Redis 8.6 added idempotent production, so producer retries do not add duplicate entries.
In Kafka, each partition is read by exactly one consumer in each group, and progress is a single offset per partition. That makes acknowledgement cheap and keeps order per partition, but parallelism inside one group stops at the partition count. Kafka 4.3 also documents share groups, where several consumers can read one partition and acknowledge records individually, which is closer to a work queue.
Ordering and throughput characteristics
A Redis stream is totally ordered by entry ID, but it is one key, and in Redis Cluster every key maps to one hash slot on one primary. One stream therefore scales with one node; more throughput means sharding across several stream keys in application code. Kafka orders events within a partition and scales a topic by adding partitions and brokers. Its design sends data from the page cache straight to the network, which the documentation says lets consumption approach the limit of the network connection.
Benchmarks rarely compare like with like. Test Redis with the persistence your loss tolerance needs against Kafka with the replication and producer acknowledgements you would run, on your own message sizes.
Memory vs disk cost
Every Redis stream entry occupies RAM until trimmed, so a consumer outage grows memory use. Size Redis for the peak backlog, not the average, and keep queue data away from eviction policies meant for cache keys. Kafka keeps the backlog on disk, which costs less per gigabyte, so a slow consumer costs disk space rather than an out-of-memory incident. The trade is operating a broker cluster.
Ecosystem: Kafka Connect and Kafka Streams
Kafka Connect is Kafka's tool for streaming data between Kafka and other systems, from whole databases in to downstream stores out. Kafka Streams is a client library for building applications whose input and output live in Kafka, and transactions give read-process-write pipelines exactly-once semantics. Redis has no built-in counterpart for streams, so pipelines around Redis Streams are application code.
When to use both: cache plus event log
The two often work together. Kafka holds the event history and feeds downstream systems; a consumer keeps Redis up to date as a cache, session store, leaderboard or rate limiter that answers from memory. A lost Redis can be rebuilt by replaying the topic. What Redis is used for lists the jobs Redis does best, and RabbitMQ vs Redis covers the case where the real need is a work queue rather than an event log.
How to choose between Redis and Kafka
- Do several teams or systems need to read the same events, now and later? Kafka.
- Must events survive for days, or be replayed into a new system? Kafka.
- Is Redis already in production, with a short window of events that fits in memory? Redis Streams with consumer groups.
- Is the message a notification nobody needs to recover? Redis Pub/Sub.
- Do you need fast reads of current state built from events? Both: Kafka for the log, Redis for the view.
Frequently asked questions
Is Redis faster than Kafka?
Redis serves each operation from memory; Kafka is built for sustained throughput across partitions with long retention on disk. A fair test runs both with the durability settings you would use in production, on your own message sizes.
Can Redis Streams replace Kafka?
For a short event window that fits in memory, often yes. Redis Streams lack disk-based retention, partitioned scaling of one stream, Kafka Connect and Kafka Streams, so long-lived event logs shared by many systems fit Kafka better.
Are Redis consumer groups the same as Kafka consumer groups?
No. Redis uses the name, but its documentation says the implementation is unrelated. Redis tracks every delivered entry until it is acknowledged; Kafka assigns each partition to one consumer per group and tracks one offset per partition.
Related
Where this gets done
The work behind this page, run by the same engineers who wrote it.
- 24/7 Redis supportOpen-source Redis, Redis Stack and Valkey
- Managed Redis servicesWe run Redis and Valkey, on your infrastructure
- Redis consultingLatency, memory, replication and failover design
- Valkey supportProduction cover for the Linux Foundation fork
- Valkey consulting and licensingTanzu Valkey from an authorized Broadcom partner
- Enterprise support plansSLA tiers and what each covers
- Kubernetes and container servicesRedis on Kubernetes, operated with your team
- RabbitMQ supportIf Redis and RabbitMQ run together
Other Redis guides, comparisons and research
- GuideThe Redis Reliability GuideRead the guide
- GuideBuying Redis and Valkey Support: The GuideRead the guide
- GuideThe Redis Backup and Disaster Recovery GuideRead the guide
- GuideRedis for AI: Vector Search, Agent Memory and MCP in ProductionRead the guide
- ComparisonValkey vs Redis: Where the Fork and Redis 8.0 DivergeSee the comparison
- ComparisonManaged Redis Options ComparedSee the comparison
- ResearchThe Redis and Valkey CVE Register, 2026 EditionRead the research
Recent Redis articles
- Redis Alternatives: Open Source Options Compared (2026)Oct 2026
- Redis Cluster: Hash Slots, Sharding and OperationsOct 2026
- Redis vs Memcached: Which Cache Should You Use?Oct 2026
- Azure Cache for Redis Retirement: Dates and OptionsOct 2026
- Who Offers Valkey Support? Production Options ComparedOct 2026
- Redis Eviction: All 10 Eviction Policies and Which to UseOct 2026
Need this done on your Redis or Valkey estate?
Named senior engineers for latency, memory, replication and failover, 24/7, with a 15-minute emergency SLA.