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.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe 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
- Payments events, WhatsApp jobs and a small AWS team: what do you choose for each?
- Kafka or RabbitMQ streams for replaying seven days of order events?
- What do you standardise on, and why?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.