Rabbit Vs Kafka

Phani Susarla
2 min readNov 11, 2020

RabbitMQ and Kafka are the two popular technologies for asynchronous communication. Both technologies are fundamentally different. Kafka is newer and comes with lot more features when compared to Rabbit but at the same time is much more complex. Below are few details and comparison between these two technologies.

Rabbit

Messages are published to Exchange, which then distributes message copies to Queues using rules called Bindings.

When a message is delivered to a consumer the consumer sends message acknowledgment to the broker, which then deletes the message from the queue.

Exchanges and Queues can be either transient or durable. A durable one survives broker restarts whereas transient one does not.

Kafka

Zookeeper manages Kafka brokers. Consumers poll messages. Offset is a consumer’s pointer on the last message it polled.

Messages are stored in Topics. A topic can have one or more partitions. Partitions are for scalability. Replicas are backups for partitions.

Comparison

Producer has to publish messages to Kafka/Rabbit, there is no difference here. Consumer has to poll from Kafka. Rabbit pushes messages to the consumer.

Kafka is designed for high scale and is less resource intensive, Rabbit is not.

Kafka is durable, it keeps the messages for a set period of time. Rabbit deletes messages as soon as the consumer receives it.

Everything in Kafka is based on Topics, routing is simple. Rabbit supports Queues and Topics, it also supports complex routing.

By default, messages are not ordered in Kafka. Ordering is guaranteed in Rabbit.

Conclusion

This was a very high level comparison between these two technologies. Both are open sourced, popular and well supported. If you are weighing between them, pick the one that suits your use cases and beware of the scalability but operational complexity that comes with Kafka.

References

--

--

Phani Susarla

Software professional with a passion for new technologies