Choosing a Messaging Tool
Lists, Pub/Sub, and Streams versus Kafka and RabbitMQ
Redis offers three messaging primitives, and this repo has Kafka and RabbitMQ modules ahead. They overlap, so it's worth being precise about which one fits which job.
Inside Redis
| Lists | Pub/Sub | Streams | |
|---|---|---|---|
| Stored | Yes, until popped | No | Yes, until trimmed |
| Delivery | Each message to one consumer | To every current subscriber | Per group: each to one consumer |
| Acknowledgement | No (build it with BLMOVE) | No | Yes (XACK, PEL) |
| Replay history | No | No | Yes (XRANGE, new groups from 0) |
| Several independent consumers | No | Yes (everyone gets everything) | Yes (consumer groups) |
| Guarantee | At most once (or at least once with BLMOVE) | At most once | At least once |
| Best for | Simple task queues | Live notifications, invalidation hints | Reliable queues, event logs |
Redis Streams vs Kafka
They share a model (an append-only log with consumer groups), but differ in scale and durability:
| Redis Streams | Kafka | |
|---|---|---|
| Storage | RAM (with RDB/AOF persistence) | Disk, retained for days or forever |
| Retention | Bounded by memory: millions of entries | Bounded by disk: billions |
| Throughput | Very high per node, single-threaded | Very high, scales by partitions |
| Durability | Async replication; can lose recent entries on failover | Replicated to N brokers before ack (acks=all) |
| Ordering | One stream = one order | Per partition |
| Ecosystem | Redis clients | Connect, Streams, Schema Registry, many integrations |
| Operations | You probably already run Redis | A separate cluster to run |
Use Redis Streams for job queues, short-lived event fan-out, and real-time pipelines where retention is minutes to hours and you already run Redis. Use Kafka when events are the system's source of truth, must be retained and replayed for days, feed many downstream systems, or need the integration ecosystem. Your Kafka notes cover the durability guarantees in depth.
Redis vs RabbitMQ
RabbitMQ is a full message broker: exchanges with routing rules (direct, topic, fanout, headers), per-message acknowledgement and redelivery, dead-letter exchanges, priorities, TTLs per message, and delivery to consumers by push. You'd pick it over Redis when you need complex routing ("orders from EU with priority high go to queue X") or strict per-message semantics, without building them yourself on lists and streams.
Rules of thumb
- Losing a message is fine → Pub/Sub.
- Background jobs for one app → Streams with consumer groups (or a library like BullMQ, Sidekiq, Celery on Redis).
- Events many teams consume, retained and replayed → Kafka.
- Complex routing between many producers and consumers → RabbitMQ.
Whatever you choose, the hard parts are the same: idempotent consumers,
dead-letter handling for poison messages, monitoring consumer lag,
and deciding what happens when the queue fills up. For Redis Streams,
lag is in XINFO GROUPS (lag and pending). Export it, and alert
when it keeps growing.