Comparison
Kafka vs RabbitMQ
Kafka is a distributed event log, RabbitMQ is a classic message broker. Different model, different jobs.
| Aspect | Apache Kafka | RabbitMQ |
|---|---|---|
| Model | Immutable partitioned log, consumers read by offset | Queues and exchanges, the broker pushes messages to consumers |
| Retention | Messages stay by time or size, replayable | Messages are removed after ack, though Streams exist |
| Throughput | Very high, hundreds of thousands to millions of events per second on a cluster | Tens of thousands per second per node, lower per-message latency |
| Routing | Simple topics and partitions, routing logic lives in the app | Flexible: direct, topic, fanout, headers, priorities, TTL, dead letter |
| Ops complexity | Higher: cluster, partitions, rebalancing (KRaft removes ZooKeeper) | Lower for small systems, clustering needs care |
| License and maintainer | Apache-2.0, Apache Software Foundation | MPL-2.0, Broadcom (VMware) |
| Ecosystem | Kafka Connect, Kafka Streams, Schema Registry, Flink, Spark | Clients for nearly every language, AMQP, MQTT, STOMP plugins |
| Best for | Event streams, analytics, event sourcing, integrating many systems | Background jobs, RPC over queues, complex routing |
Choose Apache Kafka when
- Several independent consumers must read and replay each event.
- Volumes are large and you need stream processing.
- You build event-driven architecture with the log as source of truth.
Choose RabbitMQ when
- You need task queues with ack, retries and dead letters.
- You need flexible routing and priorities.
- The team is small, volumes are moderate, you want simpler.
Bottom line
Take RabbitMQ for background job queues and Kafka for replayable event streams. You can use Kafka as a job queue, but you pay in complexity for features you will not use.
Compared
Logos belong to their owners and are used for identification only. Icons: Simple Icons (CC0), Devicon (MIT).