Skip to main content
Intermediatecomparison

Kafka vs a message queue like RabbitMQ or SQS?

Source: Apache Kafka documentation: introduction and design

Quick answer

Kafka keeps an ordered log for a retention period; many independent consumer groups can read and replay it, and ordering is per partition. Traditional queues deliver each message to one consumer and remove it after acknowledgement, with per-message routing and acknowledgements.

Kafka keeps an ordered log for a retention period; many independent consumer groups can read and replay it, and ordering is per partition. Traditional queues deliver each message to one consumer and remove it after acknowledgement, with per-message routing and acknowledgements. Choose Kafka for event streams, replay and high throughput; a queue for task distribution where replay is not needed.

Animated explanation

Kafka

  • Ordered log kept for retention
  • Many groups read and replay
  • Order per partition

Queue (RabbitMQ, SQS)

  • Message removed after ack
  • Each message to one consumer
  • Task distribution, no replay
Events to replay: Kafka. Jobs to hand out: a queue.

Key points

  • log vs queue
  • replay
  • multiple consumers
  • use cases

References

Discussion