Live data from Hacker News

Redis vs. Kafka vs. RabbitMQ

blog.devgenius.io

21–30 of 44 posts

Re: Redis vs. Kafka vs. RabbitMQ

#21
post #18
post #8

I dont understand why almost nobody wants to understand the difference between message brokers and a distributed log and its implications.

Can you give a tldr/eli5?

Unlike a queue it is common for events to be: Kept indefinitely for future re-consumption. Partitioned with different consumers seeing different slices of the data.

Re: Redis vs. Kafka vs. RabbitMQ

#22
post #7

I treat Redis a bit like I treat PostgreSQL. It's what I use when I don't know what I should use. (In fact these days I might even be tempted to start with a simple PostgreSQL based queue and only swap to Redis later if it becomes clear that's what's needed). I guess a better approach might be to carefully analyse requirements up front but if those requirements aren't known at the time you start the project it's usef…

Same. Kafka might be better for larger datasets/throughput but a much harder to maintain and manage. Redis is much simpler if you know you aren’t going to scale that much

Re: Redis vs. Kafka vs. RabbitMQ

#23
post #8

I dont understand why almost nobody wants to understand the difference between message brokers and a distributed log and its implications.

Because with kafka you can do (almost? exactly once delivery? transactions?) everything you can do with RabbitMq and a lot more, and everybody wants a piece of the action, but not everybody is prepared to pay the costs.

Re: Redis vs. Kafka vs. RabbitMQ

#24
post #18
post #8

I dont understand why almost nobody wants to understand the difference between message brokers and a distributed log and its implications.

Can you give a tldr/eli5?

A log keeps and protects everything it receives in a list, a broker just distributes things and do not keep a record of what it sends/receives

Re: Redis vs. Kafka vs. RabbitMQ

#25
post #8

I dont understand why almost nobody wants to understand the difference between message brokers and a distributed log and its implications.

Because almost everyone refers to Kafka as a queue. And Kafka isn’t a queue.

Doesn't confluent offer a JMS client for kafka? So certainly you can use kafka as a queue.

Re: Redis vs. Kafka vs. RabbitMQ

#26
post #13

Especially if you want one-to-many connections, exactly once delivery and push/ pull consumers, it is worth checking out nats [0, 1]. It is very performant. There are clients for Javascript, Python, Rust and Go [2]. (I am not affiliated with them) [0] https://nats.io/ [1] https://github.com/nats-io/nats-server [2] https://nats.io/download/#nats-clients

that's just not true. NATS does have neither at-least-once nor exactly-once. NATS Jetstream has at-least-once, but it does not have flexible topics anymore like NATS. It's two completely different things.

You may be thinking of NATS Streaming which was a predecessor to JetStream. It was indeed a standalone thing that used NATS under the hood. JetStream is now baked into the NATS server.

Re: Redis vs. Kafka vs. RabbitMQ

#27
post #5

Is anyone else considering using DyanmoDB for event sourcing instead of Kafka? We have a project at work where we store events into an event table. We then had a stream that invokes a distributor lambda. The distributor lambda lookups subscribers to a given event type. For each subscriber for a given event, we place a copy of the event to a SQS queue for the event subscriber. Each subscriber lambda can process events…

Maybe I'm missing something but this setup sounds like a re-creation of Beanstalkd. https://beanstalkd.github.io/

Re: Redis vs. Kafka vs. RabbitMQ

#28
post #25

Earlier quoted context omitted.

Because almost everyone refers to Kafka as a queue. And Kafka isn’t a queue.

Doesn't confluent offer a JMS client for kafka? So certainly you can use kafka as a queue.

You need to pre-commit to the amount of parallelism you want, and work-stealing or any other out-of-order processing is nearly impossible. Any Kafka client bug tracker is full of people who are confused (or worse) about this.

We use Kafka as a queue because we understand it very well, but it has a lot of limitations compared to "purpose-built" queuing services.

Re: Redis vs. Kafka vs. RabbitMQ

#29
post #7

I treat Redis a bit like I treat PostgreSQL. It's what I use when I don't know what I should use. (In fact these days I might even be tempted to start with a simple PostgreSQL based queue and only swap to Redis later if it becomes clear that's what's needed). I guess a better approach might be to carefully analyse requirements up front but if those requirements aren't known at the time you start the project it's usef…

Same. Kafka might be better for larger datasets/throughput but a much harder to maintain and manage. Redis is much simpler if you know you aren’t going to scale that much

It's less about scale and more about availability - by the time I've set up a 3 Redis + 3 sentinel cluster it doesn't look operationally too different in complexity than a small Kafka cluster (and more complex once KRaft is ready). But a single non-HA Redis is way easier. (But if I don't need HA - a single memcache is easier yet...)

Re: Redis vs. Kafka vs. RabbitMQ

#30
post #6

Just a fun question: is there a comparison that compares how well a simple PostgreSQL-based queue[0] fares against these specialized solutions? [0] https://blog.crunchydata.com/blog/message-queuing-using-nati...

You can actually get pretty fancy and lightweight with listen / notify as well if desired (use select for a notify instead of endless queries)

https://www.psycopg.org/docs/advanced.html#asynchronous-noti...

Post reply on HN