Comparison

Kafka vs RabbitMQ

Kafka is a distributed event log, RabbitMQ is a classic message broker. Different model, different jobs.

AspectApache KafkaRabbitMQ
ModelImmutable partitioned log, consumers read by offsetQueues and exchanges, the broker pushes messages to consumers
RetentionMessages stay by time or size, replayableMessages are removed after ack, though Streams exist
ThroughputVery high, hundreds of thousands to millions of events per second on a clusterTens of thousands per second per node, lower per-message latency
RoutingSimple topics and partitions, routing logic lives in the appFlexible: direct, topic, fanout, headers, priorities, TTL, dead letter
Ops complexityHigher: cluster, partitions, rebalancing (KRaft removes ZooKeeper)Lower for small systems, clustering needs care
License and maintainerApache-2.0, Apache Software FoundationMPL-2.0, Broadcom (VMware)
EcosystemKafka Connect, Kafka Streams, Schema Registry, Flink, SparkClients for nearly every language, AMQP, MQTT, STOMP plugins
Best forEvent streams, analytics, event sourcing, integrating many systemsBackground 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).