DEV Community

Discussion on: Apache Kafka - Fundamentals, Use cases and Trade-Offs

ziggo profile image

Please, can you explain better when to use Kafka instead of Rabbit MQ? I haven't really understand, you said that Kafka is used for log storage, but in the official tutorial of RabbitMQ there is also an example about log storage. What are the differences?

dhruvesh_patel profile image
Dhruvesh Patel Author

Kafka uses a distributed commit log as its storage layer. Writes are appended to the end of the log and Reads are sequential starting from an offset. This suites best for event streaming use cases.

Conversely, RabbitMQ uses index-based storage systems. These keep data in a tree structure to provide the fast access necessary for acknowledging individual messages, but fast individual reads comes at the cost of write overhead, which leads to either decreased write throughput and increased write latency compared to a log.

RabbitMQ is designed to store messages for a short period of time only. Kafka can retain messages indefinitely.

Hope this helps.