Learn Labs
Messaging

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

ListsPub/SubStreams
StoredYes, until poppedNoYes, until trimmed
DeliveryEach message to one consumerTo every current subscriberPer group: each to one consumer
AcknowledgementNo (build it with BLMOVE)NoYes (XACK, PEL)
Replay historyNoNoYes (XRANGE, new groups from 0)
Several independent consumersNoYes (everyone gets everything)Yes (consumer groups)
GuaranteeAt most once (or at least once with BLMOVE)At most onceAt least once
Best forSimple task queuesLive notifications, invalidation hintsReliable 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 StreamsKafka
StorageRAM (with RDB/AOF persistence)Disk, retained for days or forever
RetentionBounded by memory: millions of entriesBounded by disk: billions
ThroughputVery high per node, single-threadedVery high, scales by partitions
DurabilityAsync replication; can lose recent entries on failoverReplicated to N brokers before ack (acks=all)
OrderingOne stream = one orderPer partition
EcosystemRedis clientsConnect, Streams, Schema Registry, many integrations
OperationsYou probably already run RedisA 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

  1. Losing a message is fine → Pub/Sub.
  2. Background jobs for one app → Streams with consumer groups (or a library like BullMQ, Sidekiq, Celery on Redis).
  3. Events many teams consume, retained and replayed → Kafka.
  4. Complex routing between many producers and consumers → RabbitMQ.

On this page