InterviewSolution
| 1. |
Does Kafka Scale Better Than Other Messaging Systems Like Rabbitmq? If Yes, How? |
|
Answer» There are a few functional differences that make it possible for Apache Kafka to SCALE better than RabbitMQ: Message ORDERING: RabbitMQ queues are FIFO. In Kafka, you only get FIFO in each partition. In other words, Kafka only guarantees order per-partition. Therefore in this way you can scale Kafka is by adding more partitions. Message offset MANAGEMENT: the RabbitMQ broker keeps TRACK of which messages have already been processed by consumers and deletes them. In Kafka, it’s the responsibility of the consumer to manage the offsets: they can be written back to Kafka to a special topic, or stored entirely on the consumer side. This allows Kafka to be, in essence, a replicated append-only LOG, which is easier to scale than a “stateful” message broker. There are a few functional differences that make it possible for Apache Kafka to scale better than RabbitMQ: Message ordering: RabbitMQ queues are FIFO. In Kafka, you only get FIFO in each partition. In other words, Kafka only guarantees order per-partition. Therefore in this way you can scale Kafka is by adding more partitions. Message offset management: the RabbitMQ broker keeps track of which messages have already been processed by consumers and deletes them. In Kafka, it’s the responsibility of the consumer to manage the offsets: they can be written back to Kafka to a special topic, or stored entirely on the consumer side. This allows Kafka to be, in essence, a replicated append-only log, which is easier to scale than a “stateful” message broker. |
|