Skip to the page

Messaging patterns · senior

Choosing Kafka, RabbitMQ or SQS

Choose from the needs: replay, throughput, routing, retries and what the team can run. Standardise on a short list, with reasons.

The notes

What you must know

  • Criteria: delivery and ordering, replay, throughput, latency, routing, retries and dead-lettering, cost to run, managed options, team skills and where data must live.
  • Kafka suits event logs: many readers, replay, long retention, per-key order at scale, and an ecosystem (Connect, CDC with Debezium, Kafka Streams, Flink).
  • RabbitMQ suits work queues and routing: per-message acks, retries, delays, dead-lettering, topic and headers exchanges, priorities and request-reply.
  • SQS suits small AWS teams: almost nothing to operate, pay per request, standard or FIFO.
  • RabbitMQ streams are an append-only log inside RabbitMQ, so replay of a week is possible. Bind a stream to the exchange the publisher already uses, so there is no dual write.
  • Moderate volume and only replay: a RabbitMQ stream. A move toward event streaming with many consumers, CDC and stream processing: Kafka, introduced deliberately.
  • A table-based queue (SELECT ... FOR UPDATE SKIP LOCKED, or a library such as pg-boss) is enough for a few hundred jobs a day on Postgres.
  • Cost shape: a Kafka cluster costs money and on-call time even when idle. Standardise on a short list: one event log and one job queue, with templates, monitoring and runbooks.

The red pen

Common traps: mistake → fix

  • Mistake: One tool for everything, no reasons

    Fix: choose by needs.

  • Mistake: Kafka is always better

    Fix: it costs more to run for simple jobs.

  • Mistake: RabbitMQ cannot replay

    Fix: streams can.

  • Mistake: Have the app publish to both systems

    Fix: that is a dual write.

Easy to hard

Questions interviewers ask, easy to hard

  1. Payments events, WhatsApp jobs and a small AWS team: what do you choose for each?
  2. Kafka or RabbitMQ streams for replaying seven days of order events?
  3. What do you standardise on, and why?

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview