Kafka vs RabbitMQ vs SQS: choosing a message queue or event stream

Kafka, RabbitMQ and Amazon SQS compared on delivery model, ordering, replay, throughput, operations and cost, with picks for jobs and event streams.

INDI TECHNOLOGY5 min read

Almost every growing system needs to move work and events between services asynchronously: send emails, process payments, update search indexes, feed analytics. The three tools teams consider most are Apache Kafka, RabbitMQ and Amazon SQS (with SNS or EventBridge). They overlap, but they're built for different jobs.

Two recent changes matter. Kafka 4.0 (March 2025) removed ZooKeeper entirely, so clusters run in KRaft mode and are simpler to operate. And Kafka's "queues for Kafka" share groups became production-ready in 4.2, giving Kafka queue-style consumption alongside its log model.

At a glance

Kafka RabbitMQ SQS (+ SNS / EventBridge)
Core model Durable, partitioned log; consumers track their position Message broker; routes messages to queues; consumers acknowledge Managed queue; consumers poll and delete
Replay old messages Yes, by design (retention by time or size) Streams support it; classic queues don't No (dead-letter queues only)
Ordering Per partition Per queue (single consumer) FIFO queues; standard queues are best-effort
Throughput Very high High High, scales automatically
Routing Topics and partitions Rich: exchanges, routing keys, headers Fan-out with SNS or EventBridge rules
Delivery At least once; exactly-once within Kafka with transactions At least once At least once (standard); exactly-once processing on FIFO within limits
Operations Moderate to high (simpler with KRaft); managed options: MSK, Confluent Cloud, Aiven Moderate; managed options exist None: fully managed
Cost model Cluster or throughput-based Server or managed instance Per request
Best at Event streaming, data pipelines, event sourcing, many consumers Task queues, complex routing, RPC-style messaging Simple background jobs on AWS

The key difference: log vs queue

A queue (RabbitMQ, SQS) hands each message to one consumer, which processes and acknowledges it, and then the message is gone. That's perfect for work: "send this email", "generate this invoice", "resize this image".

A log (Kafka) keeps messages for a retention period. Many independent consumers read the same stream at their own pace and can rewind. That's perfect for events: "payment captured" can feed the ledger, notifications, analytics, fraud models and a search index, each reading independently, and a new consumer added next year can replay history.

Kafka

Use it when: many systems need the same events, you need replay, you're building data pipelines or change data capture (CDC) streams, or volume is very high.

Watch out for: partition design (it decides ordering and parallelism), consumer lag monitoring, schema management (use a schema registry with Avro, Protobuf or JSON Schema), and operating costs. Managed services (Amazon MSK, Confluent Cloud, Aiven) remove most of the operational work, but cost more than SQS for small workloads.

RabbitMQ

Use it when: you need flexible routing (topic exchanges, priorities, delayed messages, per-message TTL), request-reply patterns, or a broker that runs on-premises or on any cloud. RabbitMQ also offers streams, a log-like feature, for replay needs.

Watch out for: queue build-up under load, memory and disk alarms, and cluster operations. It's simpler than Kafka for task queues, but someone still has to run it, unless you use a managed offering.

SQS (with SNS and EventBridge)

Use it when: you're on AWS and need reliable background jobs with no infrastructure. Combine SNS or EventBridge for fan-out (one event, many queues) and SQS for each consumer's work queue. Add dead-letter queues for failures. It's the lowest-effort option and scales automatically.

Watch out for: no replay, visibility timeout tuning, message size limits (larger payloads go in S3 with a pointer), and AWS lock-in. FIFO queues have throughput limits per message group, so check them for high-volume ordered work.

Patterns that apply to all three

  • Idempotent consumers. Every option can deliver a message more than once. Make handlers safe to repeat, using idempotency keys, upserts or a processed-messages table. This is critical for payments.
  • Transactional outbox. Write the event to an outbox table in the same database transaction as the business change, then publish it from there. This avoids "saved the order but lost the event" bugs.
  • Dead-letter queues and alerts for messages that keep failing.
  • Schemas and versioning for event payloads.
  • Monitor lag and age of the oldest message, not just queue length.

Choose Kafka if…

  • many services consume the same events, or you need replay
  • you're building streaming data pipelines, CDC or event sourcing
  • throughput is very high
  • you'll use a managed service or have the skills to run it

Choose RabbitMQ if…

  • you need flexible routing, priorities or delayed messages
  • you run on-premises or across clouds
  • workloads are task queues and RPC-style messaging

Choose SQS if…

  • you're on AWS and want zero operations
  • you need reliable background jobs and simple fan-out
  • you don't need replay

Recommendation by use case

Use case Pick
Background jobs on AWS (emails, PDFs, image processing) SQS
Domain events consumed by many services Kafka (or EventBridge for modest volume)
Payment events feeding ledger, fraud and analytics Kafka
CDC from Postgres to a warehouse or search Kafka (with Debezium)
Task queues with priorities in a multi-cloud setup RabbitMQ
Webhook ingestion buffer SQS or RabbitMQ
Startup MVP SQS, or a Postgres-backed job queue

For small systems, a Postgres-backed job queue (pg-boss, Graphile Worker, Oban, Solid Queue and similar) is often enough and avoids running another system at all.

Summary

Use SQS (with SNS or EventBridge) for simple jobs on AWS, RabbitMQ for flexible task routing anywhere, and Kafka when events must feed many consumers, be replayed or stream at high volume. Whichever you pick, idempotent consumers and the outbox pattern matter more than the tool.

We design event-driven systems and data pipelines through our product engineering, cloud and data teams. Talk to us about your architecture.

Any idea in mind? Let's make it real.

Tell us what you're building. You'll hear back from an engineer, not a sales team, usually within one working day.

Book a 30-min call