TE
ТехЭхо
ГлавнаяТоп за 24 часаНовейшиеЛучшиеВопросыПоказатьВакансии
GitHubTwitter
Главная

ТехЭхо

Платформа технологических новостей, созданная с использованием Next.js, предоставляющая глобальные технологические новости и обсуждения.

GitHubTwitter

Главная

ГлавнаяНовейшиеЛучшиеВопросыПоказатьВакансии

Ресурсы

HackerNews APIОригинальный HackerNewsNext.js

© 2025 ТехЭхо. Все права защищены.

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

66 балловавтор: enether10 дней назад
The space is confusing to say the least.<p>Message queues are usually a core part of any distributed architecture, and the options are endless: Kafka, RabbitMQ, NATS, Redis Streams, SQS, ZeroMQ... and then there&#x27;s the “just use Postgres” camp for simpler use cases.<p>I’m trying to make sense of the tradeoffs between:<p>- async fire-and-forget pub&#x2F;sub vs. sync RPC-like point to point communication<p>- simple FIFO vs. priority queues and delay queues<p>- intelligent brokers (e.g. RabbitMQ, NATS with filters) vs. minimal brokers (e.g. Kafka’s client-driven model)<p>There&#x27;s also a fair amount of ideology&#x2F;emotional attachment - some folks root for underdogs written in their favorite programming language, others reflexively dismiss anything that&#x27;s not &quot;enterprise-grade&quot;. And of course, vendors are always in the mix trying to steer the conversation toward their own solution.<p>If you’ve built a production system in the last few years:<p>1. What queue did you choose?<p>2. What didn&#x27;t work out?<p>3. Where did you regret adding complexity?<p>4. And if you stuck with a DB-based queue — did it scale?<p>I’d love to hear war stories, regrets, and opinions.

38 comments

speedgoose9 дней назад
I played with most message queues and I go with RabbitMQ in production.<p>Mostly because it has been very reliable for years in production at a previous company, and doesn’t require babysitting. Its recent versions also has new features that make it is a descent alternative to Kafka if you don’t need to scale to the moon.<p>And the logo is a rabbit.
评论 #44019404 未加载
评论 #44027228 未加载
KingOfCoders7 дней назад
NATS.io because I&#x27;m using Go, and I can just embed it for one server [0], one binary to deploy with Systemd, but able to split it out when scaling the MVP.<p>[0] <a href="https:&#x2F;&#x2F;www.inkmi.com&#x2F;blog&#x2F;how-i-made-inkmi-selfhealing" rel="nofollow">https:&#x2F;&#x2F;www.inkmi.com&#x2F;blog&#x2F;how-i-made-inkmi-selfhealing</a>
adamcharnock7 дней назад
I would highlight a distinction between Queues and Streams, as I think this is an important factor in making this choice.<p>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.<p>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 &#x27;fan out&#x27;.<p>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 &#x27;send_registration_email&#x27; queue.[1]<p>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 &#x27;add_user_to_crm&#x27; queue.<p>The result here is that choosing a queue early on leads to a tight-coupling of services down the road.<p>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 &#x27;send_registration_email&#x27; and &#x27;add_user_to_crm&#x27; with a single stream called &#x27;used_registered&#x27;. 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 &#x27;consumer group&#x27;, or something of a similar name).<p>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).<p>--<p>This is where Postgresql and SQS tend to fall down. I&#x27;ve yet to hear of an implementation of streams in Postgresql[2]. And SQS is inherently a queue.<p>I therefore normally reach for Redis Steams, but mostly because it is what I am familiar with.<p>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.<p>[1] Although this is my go-to example, I&#x27;m actually unconvinced that email sending should be done via a queue. Email is just a sequence of queues anyway.<p>[2] If you know of one please tell me!
评论 #44024154 未加载
评论 #44023779 未加载
评论 #44020272 未加载
评论 #44025545 未加载
bilinguliar7 дней назад
I am using Beanstalkd, it is small and fast and you just apt-get it on Debian.<p>However, I have noticed that oftentimes devs are using queues where Workflow Engines would be a better fit.<p>If your message processing time is in tens of seconds – talk to your local Workflow Engine professional (:
评论 #44019522 未加载
评论 #44019401 未加载
wordofx7 дней назад
Postgres. Doing ~ 70k messages&#x2F;second average. Nothing huge but don’t need anything dedicated yet.
评论 #44019364 未加载
评论 #44019616 未加载
评论 #44029804 未加载
lmm7 дней назад
SQS is great if you&#x27;re already on AWS - it works and gets out of your way.<p>Kafka is a great tool with lots of very useful properties (not just queues, it can be your primary datastore), but it&#x27;s not operationally simple. If you&#x27;re going to use it you should fully commit to building your whole system on it and accept that you will need to invest in ops at least a little. It&#x27;s not a good fit for a &quot;side&quot; feature on the edge of your system.
mstaoru6 дней назад
Redis Streams is a &quot;go-to&quot; for me, mostly because of operational simplicity and performance. It&#x27;s also dead simple to write consumers in any language. If I had more stringent durability requirements, I would probably pick Redpanda, but Kafka-esque (!) processing semantics can be daunting sometimes.<p>I didn&#x27;t have anything but bad experiences with RabbitMQ, maybe I cannot &quot;cook&quot; it, but it would always go split-brain, or last issue I had, a part of clients connected to certain clustered nodes just stopped receiving messages. Cluster restart helped, but all logs and all metrics were green and clean. I try to avoid it if I can.<p>ZeroMQ is more like a building block for your applications. If you need something very special, it could be a good fit, but for a typical EDA-ish bus architecture Redis or Kafka&#x2F;Redpanda are both very good.
jolux7 дней назад
Kafka is fairly different from the rest of these — it’s persistent and designed for high read throughput to multiple simultaneous clients at the same time, as some other commenters have pointed out.<p>We wanted replayability and multiple clients on the same topic, so we evaluated Kafka, but we determined it was too operationally complex for our needs. Persistence was also unnecessary as the data stream already had a separate archiving system and existing clients only needed about 24hr max of context. AWS Kinesis ended up being simpler for our needs and I have nothing but good things to say about it for the most part. Streaming client support in Elixir was not as good as Kafka but writing our own adapter wasn’t too hard.
AznHisoka10 дней назад
Sidekiq, Sidekiq, Sidekiq (or just Postgres if Im dealing with something trivial)
vanbashan7 дней назад
I prefer pulsar. Elegant modular design and fully open source ecosystem.<p>Performance is at least as good as Kafka.<p>For simpler workload, beanstalkd could be a good fit, either.
评论 #44025031 未加载
lolc5 дней назад
We use Apache Artemis (Activemq). Mainly because it was the only system that would route large messages. It&#x27;s from the Java ecosystem which is alien to us. So integration was not smooth but now it hums along fine.
j457 дней назад
After using more than a few, 2025 has been trying to start with Postgres with everything to minimize so many things.<p>Database functions can remain independent of stack or programming changes.<p>Complexity comes on it&#x27;s own, often little need to pile it in from the start to tie ones hands early for relatively simple solutions.
matt_s7 дней назад
Google PubSub is what we use as our message queue, mostly for communicating change data capture via messages to other internal systems. Its typically being consumed by some job system polling on an interval and then doing CRUD to sync changes.<p>Its not very complex and feels like we&#x27;re running a lot of compute resources to just sync data between systems. Admittedly there isn&#x27;t good separation of concerns so there is overlap that requires data syncs.<p>I&#x27;ve been looking at things like kafka, etc. thinking there might be some magic there that makes us use less compute or makes data syncs a little easier to deal with but wonder what scale of data throughput is a tipping point where a service like that is really needed. If it turns out its just a different service but same timeliness of data sync and similar compute resources I struggle with what benefits might be provided.<p>I&#x27;d love for almost like a levels.fyi style site where people could anonymously report things like this for the tech stacks being used, throughput of data, amount of compute in play, and ratings&#x2F;comments on their overall solution (&quot;would do again&quot;, &quot;don&#x27;t recommend&quot;, &quot;overkill&quot;, &quot;resume filler&quot;). It feels much like other areas of technology where a use case comes out of a huge company and RDD (resume driven development) takes hold and now there are people out there doing the equivalent of souping up a 1997 honda accord like its a racecar but its only driving grandma to her appointments.
评论 #44022698 未加载
crmd7 дней назад
The US Federal Reserve uses IBM MQ for the FedNow interbank settlement service that went live last year.<p>Architecture info: <a href="https:&#x2F;&#x2F;explore.fednow.org&#x2F;resources&#x2F;technical-overview-guide.pdf" rel="nofollow">https:&#x2F;&#x2F;explore.fednow.org&#x2F;resources&#x2F;technical-overview-guid...</a>
评论 #44019452 未加载
MyOutfitIsVague7 дней назад
For my extremely specialized case, I use a SQLite database as a message queue. It absolutely wouldn&#x27;t scale, but it doesn&#x27;t need to. It works extremely well for what I need it to do.
评论 #44019882 未加载
评论 #44022361 未加载
micvbang7 дней назад
I got tired of the pricing and&#x2F;or complexity of running message queues&#x2F;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&#x27;s an ongoing blog series on the implementation: <a href="https:&#x2F;&#x2F;github.com&#x2F;micvbang&#x2F;simple-event-broker">https:&#x2F;&#x2F;github.com&#x2F;micvbang&#x2F;simple-event-broker</a>
Jemaclus9 дней назад
For large applications in a service-oriented architecture, I leverage Kafka 100% of the time. With Confluent Cloud and Amazon MSK, infra is relatively trivial to maintain. There&#x27;s really no reason to use anything else for this.<p>For smaller projects of &quot;job queues,&quot; I tend to use Amazon SQS or RabbitMQ.<p>But just for clarity, Kafka is not really a message queue -- it&#x27;s a persistent structured log that can be used as a message queue. More specifically, you can replay messages by resetting the offset. In a queue, the idea is once you pop an item off the queue, it&#x27;s no longer in the queue and therefore is gone once it&#x27;s consumed, but with Kafka, you&#x27;re leaving the message where it is and moving an offset instead. This means, for example, that you can have many many clients read from the same topic without issue.<p>SQS and other MQs don&#x27;t have that persistence -- once you consume the message and ack, the message disappears and you can&#x27;t &quot;replay it&quot; via the queue system. You have to re-submit the message to process it. This means you can really only have one client per topic, because once the message is consumed, it&#x27;s no longer available to anyone else.<p>There are pros and cons to either mechanism, and there&#x27;s significant overlap in the usage of the two systems, but they are designed to serve different purposes.<p>The analogy I tend to use is that Kafka is like reading a book. You read a page, you turn the page. But if you get confused, you can flip back and reread a previous page. An MQ like RabbitMQ or Sidekiq is more like the line at the grocery store: once the customer pays, they walk out and they&#x27;re gone. You can&#x27;t go back and re-process their cart.<p>Again, pros and cons to both approaches.<p>&quot;What didn&#x27;t work out?&quot; -- I&#x27;ve learned in my career that, in general, I really like replayability, so Kafka is typically my first choice, unless I know that re-creating the messages are trivial, in which case I am more inclined to lean toward RabbitMQ or SQS. I&#x27;ve been bitten several times by MQs where I can&#x27;t easily recreate the queue, and I lose critical messages.<p>&quot;Where did you regret adding complexity?&quot; -- Again, smaller systems that are just &quot;job queues&quot; (versus service-to-service async communication) don&#x27;t need a whole lot of complexity. So I&#x27;ve learned that if it&#x27;s a small system, go with an MQ first (any of them are fine), and go with Kafka only if you start scaling beyond a single simple system.<p>&quot;And if you stuck with a DB-based queue -- did it scale?&quot; -- I&#x27;ve done this in the past. It scales until it doesn&#x27;t. Given my experience with MQs and Kafka, I feel it&#x27;s a trivial amount of work to set up an MQ&#x2F;Kafka, and I don&#x27;t get anything extra by using a DB-based queue. I personally would avoid these, unless you have a compelling reason to use it (eg, your DB isn&#x27;t huge, and you can save money).
评论 #44019302 未加载
评论 #44019334 未加载
austin-cheney9 дней назад
I have so far gotten by plenty well writing my own queue systems to fit the needs of the consuming application. Normally the only place where I need queue systems is in distributed systems with rapid fire transmissions to ensure messages hit the network in time sequence order. The additional benefit is that network traffic is saved in order when the current network socket fails so that nothing is lost but time.
coolcase7 дней назад
1. Never do greenfield. But usually seen systems set up with the cloud &quot;house white&quot; queue. SQS or the Azure queue whatever its called.<p>2. Nothing. It all worked out.<p>3. Nowhere. Generally used them for queue-y things.<p>4. Not done this. Even back in 2000s when queues weren&#x27;t so well known they&#x27;d be a queue-like system. Polling FTP for example!
dmazin7 дней назад
No one ever seems to use it, but for AMPQ I like Beanstalkd. It’s fast, stable and has not failed me under high RPS.
评论 #44019320 未加载
csomar7 дней назад
Another option to consider: Cloudflare Workers. They have a simple queue but you&#x27;ll need to patch it with a Worker anyway. This means you can programatically manage the queue through the worker and also it makes it easy to send&#x2F;receive HTTP requests.
stephenr7 дней назад
I&#x27;ve used Qless for several years;<p>For those unfamiliar, it&#x27;s a Lua library that gets executed in Redis using one of the various language bindings (which are essentially wrappers around calling the Lua methods).<p>With our multi-node redis setup it seems to be quite reliable.
a_void_sky10 дней назад
Kafka for communication between microservices, and MQTT (VerneMQ) for IOT devices
评论 #43994895 未加载
评论 #43995508 未加载
clark-kent10 дней назад
SQS. For Ruby apps I use Shoryuken with SQS.
z3ugma7 дней назад
Does Google Cloud Tasks count?
yesnomaybe7 дней назад
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.<p>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.<p>I am currently swapping out the whole pub&#x2F;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 &#x2F; backoff etc. Broadcast is simple and without locking, auto delete in Mongo.<p>I will have to see how it really scales and I&#x27;m sure I&#x27;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&#x27;s say &gt;100rpm on the core functions.
tacostakohashi7 дней назад
UUCP
评论 #44019268 未加载
MichaelMoser1237 дней назад
using zeebe&#x2F;Camunda at work. The system gives you a way of designing and partitioning message-based workflows. It has a very thorough design.
评论 #44019448 未加载
kabes7 дней назад
Maybe start by explaining what you want to use it for?
nop_slide10 дней назад
Solid queue in rails
ok198410 дней назад
Surprised no body is mentioning ActiveMQ!
DonHopkins7 дней назад
What do people think of Supabase?
评论 #44020555 未加载
atombender6 дней назад
It&#x27;s important to distinguish between the use cases. Queues, streams, logs, databases, etc. are different kinds of tools you can use, and what the right tool is depends on your semantics.<p>For example: Message queues are good for work that must be done in strict order where you want to deal with one message at a time. They aren&#x27;t such a great fit for large batch movement of data, like logs or high volume events, because having a per-message acknowledgement state requires a lot of round trips over the network that simply isn&#x27;t needed; you want to treat the entire bulk of the flow to carve out big chunks of it, because CPUs wnd networks and disks are more efficient when doing the same operation over large amounts of data in one go.<p>If you are executing &quot;tasks&quot; (like image processing, ML inference, webhooks), ordering by insertion order might not be the right choice, either. Sometimes you want to coalesce (dedupe by key). Sometimes you want to ensure the processing for a key (e.g. a customer ID) is done in the same process and not randomly distributed over all your workers. Sometimes you want delivery to be strictly sequential, requiring an exclusive worker rather than massively parallel fan-out. And so on.<p>Where I work, we use a mix of things depending on the application. I am a big fan of NATS. It&#x27;s not itself a message queue, but its primitives can be combined to handle all sorts of behaviors. Core NATS is more like ephemeral pub&#x2F;sub, while Jetstream gives you durable, highly available Kafka-like streams.<p>I like combining queues with database state. Use the queue as an efficient way to order items (like jobs or events) for massively scalable distribution, and use the database to store the current state of things.<p>For example, imagine you&#x27;re delivering webhook messages. We first store the message in the database with the state &quot;pending&quot;, then write an event to the queue about it. The worker receives the event, double-checks its state is still &quot;pending&quot;, then executes it. If delivered, mark as &quot;done&quot; and ack the message. Otherwise, mark as &quot;failed&quot; and create a new queue message to retry. This way, you have durable state in a solid database, and the queue is an efficient way to coordinate the workers. (There&#x27;s a bit more work here to ensure consistency, but this is the gist of it.)<p>Core NATS is fantastic as a communication primitive between ephemeral processes. You can use it for RPC, for lightweight broadcasts (e.g. reload config everywhere), even for things like leases or caching or similar. Jetstream is like Kafka but more flexible; for example, each message has a wildcard subject that can be filtered on, so different consumers can very efficiently filter a big, commingled stream by interest. In Jetstream streams, messages have per-consumer ack&#x2F;nack state in addition to a position, so you&#x27;re not limited to Kafka&#x27;s linear &quot;position&quot;. Overall, a superb data model, and very easy to manage as infra.<p>One weak point with NATS is a maximum message size of 10MB. This means that you sometimes have to invent your own chunking if your application needs to send larger payloads. Doing this opens up some cans of worms, so I honestly wouldn&#x27;t recommend it. For large batch stuff, Redpanda is a better option.
smittywerben7 дней назад
Kafka is a write-ahead log, not a queue per se. It handles transactions to the disk. Not across the network.<p>RabbitMQ is neat out of the box. But I went with ZeroMQ at the time.<p>ZeroMQ is cool but during current year I&#x27;d only use it to learn from their excellent documentation. Coming from Python, it taught me about Berkeley sockets and the process of building cross-language messaging patterns. After a few projects, it&#x27;s like realizing I didn&#x27;t need ZeroMQ to begin with I could make my own! If ZeroMQ&#x27;s Hintjens were still with us I&#x27;d still be using it.<p>It&#x27;s like the documented incremental process of designing a messaging queue to fit your problem domain, plus a thin wrapper easing some of lower level socket nastiness. At least that&#x27;s my experience using it over the years. Me talking about it won&#x27;t do it enough justice.<p>NATS does the lower level socket wrapper part very nicely. It&#x27;s a but more modern too. Golang&#x27;s designed to be like a slightly nicer C syntax, so it would make sense that it&#x27;s high performance and sturdy. So it&#x27;s similar to ZeroMQ there.<p>I&#x27;m not sure if either persist to disk out of the box. So either of these are going to be simpler and faster than Kafka.<p>The DB people are probably trying too hard to cater to the queues. Ideally I&#x27;d have normalized the data and modeled the relations such transactions don&#x27;t lock up the whole table. Then I started questioning why I needed a queue at all when databases (sans SQLite which is fast enough as is) are made for pooling access to a database.<p>Kafka supports pipelining to a relational database but this part is where you kind of have to be experienced to not footgun and I&#x27;m not at that level. I think using it as a queue in that you&#x27;re short-circuiting it from the relational database pipeline is non-standard for Kafka. I suspect that&#x27;s where a lot of the Kafka hate is from. I could understand if the distributed transactions part is hell but at that point it&#x27;s like why&#x27;d you skip the database then? Trying to get that free lunch I assume.<p>I have an alternative. Try inserting everything into a SQLite file. Running into concurrency issues? Use a second SQLite file. Two computers? send it over the network. More issues? Since it&#x27;s SQL just switch to a real database that will pool the clients. Or switch to five of them. SQL is sorta cool that way. I assume that would avoid the reimplementing half of the JVM to sync across computers where you get Oracle Java showing up to sell you their database halfway into making your galactic scale software or the whatever.<p>I must be stressed today. Thanks for asking.
评论 #44027115 未加载
评论 #44023727 未加载
mlhpdx7 дней назад
SQS
catkitcourt7 дней назад
Pulsar
varbhat10 дней назад
NATS
评论 #44019283 未加载
revskill9 дней назад
A cron job did thd work.