Grokking System Design Fundamentals

0% completed

RabbitMQ vs. Kafka vs. ActiveMQ

Here are the top differences between RabbitMQ, Kafka, and ActiveMQ:

DimensionRabbitMQKafkaActiveMQ
ArchitectureSmart broker, dumb consumer. Routes via exchanges and queues.Distributed commit log. Dumb broker, smart consumer.Classic JMS broker with queues and topics.
Built onErlangScala and Java (JVM)Java (JVM)
Message modelQueue based. Exchanges route to queues.Append only log. Topics split into partitions.JMS queues (point to point) and topics (pub/sub).
Protocol supportAMQP 0.9.1, MQTT, STOMP, HTTPCustom Kafka binary protocol over TCPOpenWire, AMQP, MQTT, STOMP, JMS
ThroughputTens of thousands of messages per second per node.Millions of messages per second across a cluster.Tens of thousands per second. Artemis scales higher.
LatencyVery low. Microseconds to low milliseconds.Low. Optimized for throughput over latency.Low milliseconds.
Message retentionDeleted once acknowledged.Kept for a configurable time or size, even after consumption.Deleted once acknowledged.
ReplayNot natively supported.First class. Consumers reset offsets to replay.Limited. Some support via message stores.
OrderingPer queue, with single consumer.Strict per partition.Per queue. Message groups for finer control.
Consumer modelPush based. Broker delivers to consumers.Pull based. Consumers fetch at their own pace.Push based. Pull also supported.
RoutingRich. Direct, topic, fanout, headers exchanges.Minimal. Partition key on producer side.Selectors, virtual topics, composite destinations.
ScalabilityVertical first. Clustering and quorum queues for HA.Horizontal. Built for distributed scale.Vertical first. Network of brokers for federation.
Delivery guaranteesAt most once, at least once.At most once, at least once, exactly once with transactions.At most once, at least once, exactly once.
Best forTask queues, RPC, complex routing, microservice messaging.Event streaming, log aggregation, analytics pipelines, event sourcing.Enterprise integration, legacy JMS apps, hybrid messaging.
Weak spotSlows 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