vishal patel
UnderstoodIntermediateUpdated 2026-09-23

Message Queues vs Event Streams

RabbitMQ/SQS-style queues distribute work; Kafka-style logs retain ordered events for many consumers and replay. Know which one your problem needs.

kafkarabbitmqsqsmessagingasync

Two different models

diagram
QueueStream
ModelWork distribution, competing consumersAppend-only log, many independent readers
After consumptionMessage removedRetained (days, or forever with compaction)
OrderingBest effort (FIFO queues exist)Guaranteed per partition
ReplayNoYes, reset the offset
Typical useBackground jobs, emails, bulk tasksEvent backbone, CDC, analytics, event sourcing

Semantics to know

  • At-most-once / at-least-once / exactly-once. In practice, design for at-least-once + idempotent consumers.
  • Kafka ordering: only within a partition, so choose the partition key (e.g. entryId) to order what matters.
  • Backpressure and DLQs: poison messages go to a dead-letter queue after N attempts.
  • Visibility timeout (SQS) / ack deadline: set it longer than the worst-case processing time, or you'll get duplicates.
Architect's tip

Rule of thumb: "do this job once" → queue. "This happened, and several systems care now or later" → stream.

Cheatsheet

The whole topic on one page. Click to open full screen.

Sources & further learning

Videos, courses, docs and books I recommend for this topic.

Related topics