Kafka, RabbitMQ or NATS

mino

minoblue

Posted on June 18, 2024

Kafka, RabbitMQ or NATS

RabbitMQ — a traditional message queue and is decent for creating traditional topologies such as fanouts with at-least-once delivery.

Kafka — a distributed, replicated log which can be used as a queue, but is perhaps better described as an append-only database. It has a peculiar design because it's basically written bottom-up for performance, and so it has a data model that will seem odd and cumbersome if you don't understand why it was designed this way. For a lightweight alternative to Kafka, you could consider Redpanda, which implements the Kafka protocol and overall design, but is vastly easier to operate.

NATS — a pub/sub message broker. It's not a message queue and will not store messages. For example, if nobody is subscribing to a topic, the messages go nowhere. Think of NATS more like a fast, distributed replacement for sockets that makes it really easy to implement distributed communication patterns such as fan-out and RPC between elastically scalable services.

You can get a message queue with NATS if you use Jetstream, which is what happens when the author of NATS looks at Kafka for inspiration and says he can do it better. But Jetstream is not NATS; it's a separate project that just happens to use NATS as the protocol.

💖 💪 🙅 🚩
mino
minoblue

Posted on June 18, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Kafka, RabbitMQ or NATS
webdev Kafka, RabbitMQ or NATS

June 18, 2024