Grokking System Design Fundamentals
0% completed
RabbitMQ vs. Kafka vs. ActiveMQ
Here are the top differences between RabbitMQ, Kafka, and ActiveMQ:
| Dimension | RabbitMQ | Kafka | ActiveMQ |
|---|---|---|---|
| Architecture | Smart broker, dumb consumer. Routes via exchanges and queues. | Distributed commit log. Dumb broker, smart consumer. | Classic JMS broker with queues and topics. |
| Built on | Erlang | Scala and Java (JVM) | Java (JVM) |
| Message model | Queue based. Exchanges route to queues. | Append only log. Topics split into partitions. | JMS queues (point to point) and topics (pub/sub). |
| Protocol support | AMQP 0.9.1, MQTT, STOMP, HTTP | Custom Kafka binary protocol over TCP | OpenWire, AMQP, MQTT, STOMP, JMS |
| Throughput | Tens of thousands of messages per second per node. | Millions of messages per second across a cluster. | Tens of thousands per second. Artemis scales higher. |
| Latency | Very low. Microseconds to low milliseconds. | Low. Optimized for throughput over latency. | Low milliseconds. |
| Message retention | Deleted once acknowledged. | Kept for a configurable time or size, even after consumption. | Deleted once acknowledged. |
| Replay | Not natively supported. | First class. Consumers reset offsets to replay. | Limited. Some support via message stores. |
| Ordering | Per queue, with single consumer. | Strict per partition. | Per queue. Message groups for finer control. |
| Consumer model | Push based. Broker delivers to consumers. | Pull based. Consumers fetch at their own pace. | Push based. Pull also supported. |
| Routing | Rich. Direct, topic, fanout, headers exchanges. | Minimal. Partition key on producer side. | Selectors, virtual topics, composite destinations. |
| Scalability | Vertical first. Clustering and quorum queues for HA. | Horizontal. Built for distributed scale. | Vertical first. Network of brokers for federation. |
| Delivery guarantees | At most once, at least once. | At most once, at least once, exactly once with transactions. | At most once, at least once, exactly once. |
| Best for | Task queues, RPC, complex routing, microservice messaging. | Event streaming, log aggregation, analytics pipelines, event sourcing. | Enterprise integration, legacy JMS apps, hybrid messaging. |
| Weak spot | Slows when queues grow very large. | Heavier ops. Overkill for simple task queues. | Lower throughput than Kafka. Less momentum than RabbitMQ. |
A quick way to read it:
- RabbitMQ is the smart router for traditional messaging.
- Kafka is the durable log built for streaming and replay.
- ActiveMQ is the JMS workhorse for enterprise Java systems.
Mark as Completed