Live data from Hacker News

Ask HN: What's your go-to message queue in 2025?

news.ycombinator.com

51–60 of 99 posts

Re: Ask HN: What's your go-to message queue in 2025?

#51
I would highlight a distinction between Queues and Streams, as I think this is an important factor in making this choice.

In the case of a queue, you put an item in the queue, and then something removes it later. There is a single flow of items. They are put in. They are taken out.

In the case of a stream, you put an item in the queue, then it can be removed multiple times by any other process that cares to do so. This may be called 'fan out'.

This is an important distinction and really effects how one designs software that uses these systems. Queues work just fine for, say, background jobs. A user signs up, and you put a task in the 'send_registration_email' queue.[1]

However, what if some _other_ system then cares about user sign ups? Well, you have to add another queue, and the user sign-up code needs to be aware of it. For example, a 'add_user_to_crm' queue.

The result here is that choosing a queue early on leads to a tight-coupling of services down the road.

The alternative is to choose streams. In this case, instead of saying what _should_ happen, you say what _did_ happen (past tense). Here you replace 'send_registration_email' and 'add_user_to_crm' with a single stream called 'used_registered'. Each service that cares about this fact is then free to subscribe to that steam and get its own copy of the events (it does so via a 'consumer group', or something of a similar name).

This results in a more loosely coupled system, where you potentially also have access to an event history should you need it (if you configure your broker to keep the events around).

--

This is where Postgresql and SQS tend to fall down. I've yet to hear of an implementation of streams in Postgresql[2]. And SQS is inherently a queue.

I therefore normally reach for Redis Steams, but mostly because it is what I am familiar with.

Note: This line of thinking leads into Domain Driven Design, CQRS, and Event Sourcing. Each of which is interesting and certainly has useful things to offer, although I would advise against simply consuming any of them wholesale.

[1] Although this is my go-to example, I'm actually unconvinced that email sending should be done via a queue. Email is just a sequence of queues anyway.

[2] If you know of one please tell me!

Re: Ask HN: What's your go-to message queue in 2025?

#52

For my extremely specialized case, I use a SQLite database as a message queue. It absolutely wouldn't scale, but it doesn't need to. It works extremely well for what I need it to do.

Have you written up about it? I'd love to read it if so. Thought of using SQLite several times like this but never mustered the courage to try.

Re: Ask HN: What's your go-to message queue in 2025?

#53
post #7

NATS

I use NATS too! It has worked very well for me, using it to collect data from IoT devices. I don't really like all the other bits they tacked on like jetstream and object store, that seems beyond its scope. Subject authorization is also painful to implement. But runtime behaviour has been flawless for me.

Do you have any links explaining the subject authorization? I have recommended NATS for a project that got scrapped.

Re: Ask HN: What's your go-to message queue in 2025?

#54
I got tired of the pricing and/or complexity of running message queues/event brokers, so decided to play around with implementing my own. It utilizes S3 as the source of truth, which makes it orders of magnitude easier to manage and cheaper to run. There's an ongoing blog series on the implementation: https://github.com/micvbang/simple-event-broker

Re: Ask HN: What's your go-to message queue in 2025?

#55

I would highlight a distinction between Queues and Streams, as I think this is an important factor in making this choice. In the case of a queue, you put an item in the queue, and then something removes it later. There is a single flow of items. They are put in. They are taken out. In the case of a stream, you put an item in the queue, then it can be removed multiple times by any other process that cares to do so. Th…

What makes Postgres (or any decent relational DB) fall down in this case?

Re: Ask HN: What's your go-to message queue in 2025?

#56

Earlier quoted context omitted.

I use NATS too! It has worked very well for me, using it to collect data from IoT devices. I don't really like all the other bits they tacked on like jetstream and object store, that seems beyond its scope. Subject authorization is also painful to implement. But runtime behaviour has been flawless for me.

Do you have any links explaining the subject authorization? I have recommended NATS for a project that got scrapped.

Docs: https://docs.nats.io/running-a-nats-service/configuration/se...

Example: https://natsbyexample.com/examples/auth/callout/java

Re: Ask HN: What's your go-to message queue in 2025?

#58

For my extremely specialized case, I use a SQLite database as a message queue. It absolutely wouldn't scale, but it doesn't need to. It works extremely well for what I need it to do.

Have you written up about it? I'd love to read it if so. Thought of using SQLite several times like this but never mustered the courage to try.

I use SQLite as an offline buffer for telemetry data, basically one thread does INSERT of the payloads and another thread does just SELECT and then DELETE when it has successfully transmitted the payload.

Re: Ask HN: What's your go-to message queue in 2025?

#59
Been on Kafka (MSK) for a couple of years. I find the programming model and getting everything perfectly set up to be sitting behind a steep learning curve, to my surprise. For example, at some point I had a timestamp header but only very much later realised that it all ends up as number[] on the consumer side. So I lost data. My fault, but still. I came to the realisation that the programming model especially in MSK is rather unintuitive.

I found it hard to shift mentally from MSK and its even triggers back to regular consumer spun up in containers etc. but that also it rather MSK than Kafka.

I am currently swapping out the whole pub/sub layer to MongoDB change streams, which I have found to be working really well. For queuing it attempts to lock on read so I can scale consumers with retry / backoff etc. Broadcast is simple and without locking, auto delete in Mongo.

I will have to see how it really scales and I'm sure I'm trading one problem for another but, it will definitely help to remove a moving part. Overall, app is rather low volume with the occasional spike. I would have stayed with Kafka were there be let's say >100rpm on the core functions.

Re: Ask HN: What's your go-to message queue in 2025?

#60
After using more than a few, 2025 has been trying to start with Postgres with everything to minimize so many things.

Database functions can remain independent of stack or programming changes.

Complexity comes on it's own, often little need to pile it in from the start to tie ones hands early for relatively simple solutions.

Post reply on HN