VictoryForYou
VictoryForYou

Reputation: 81

What's the difference between RabbitMQ and kafka?

Which will fair better under different scenarios?

I know that RabbitMQ is based on AMQP protocol, and has visualization for the developer.

Upvotes: 3

Views: 5660

Answers (2)

Parvinder Kumar
Parvinder Kumar

Reputation: 833

Kafka:

  • Message will be always there. You can manage this by specifying a message retention policy.
  • It is distributed event streaming platform.
  • We can use it as a log
  • Kafka streaming, you can change and process the message automatically.
  • We can not set message priority
  • Retain order only inside a partition. In a partition, Kafka guarantees that the whole batch of messages either fail or pass.
  • Not many mature platforms like RMQ (Scala and Java)

RabbitMQ:

  • RabbitMQ is a queuing system so messages get deleted just after consume.
  • It is distributed, by a message broker.
  • It can not be used like this
  • Streaming is not supported in RMQ
  • We can set the priority of the message and can consume on the basis of the same.
  • Does not support guarantee automaticity even in relation to transactions involving a single queue.
  • Mature platform ( Have the best compatibility with all languages)

Upvotes: 1

ben author
ben author

Reputation: 2955

RabbitMQ, as you noted, is an implementation of AMQP. AMQP is a messaging protocol which originated in the financial industry. Its core metaphors are Messages, Exchanges, and Queues.

Kafka was designed as a log-structured distributed datastore. It has features that make it suitable for use as part of a messaging system, but it also can accommodate other use cases, like stream processing. It originated at LinkedIn and its core metaphors are Messages, Topics, and Partitions.

Subjectively, I find RabbitMQ more pleasant to work with: its web-based management tool is nice; there is little friction in creating, deleting, and configuring queues and exchanges. Library support is good in many languages. As in its default configurations Rabbit only stores messages in memory, latencies are low.

Kafka is younger, the tooling feels more clunky, and it has had relatively poor support in non-JVM languages, though this is getting better. On the other hand, it has stronger guarantees in the face of network partitions and broker loss, and since it is designed to move messages to disk as soon as possible, it can accommodate a larger data set on typical deployments. (Rabbit can page messages to disk but sometimes it doesn't perform well).

In either, you can design for direct (one:one), fanout (one:many), and pub-sub (many:many) communication patterns.

If I were building a system that needed to buffer massive amounts of incoming data with strong durability guarantees, I'd choose Kafka for sure. If I was working with a JVM language or needed to do some stream processing over the data, that would only reinforce the choice.

If, on the other hand, I had a use case in which I valued latency over throughput and could handle loss of transient messages, I'd choose Rabbit.

Upvotes: 10

Related Questions