Ask HN: Why do message queue-based architectures seem less popular now?
389 points| alexhutcheson | 1 year ago
Now, I almost never see engineering blog posts or HN posts highlighting use of message queues. I see occasional content related to Kafka, but nothing like the hype that message queues used to have.
What changed? Possible theories I'm aware of:
* Redis tackled most of the use-case, plus caching, so it no longer made sense to pay the operational cost of running a separate message broker. Kafka picked up the really high-scale applications.
* Databases (broadly defined) got a lot better at handling high scale, so system designers moved more of the "transient" application state into the main data stores.
* We collectively realize that message queues-based architectures don't work as well as we hoped, so we build most things in other ways now.
* The technology just got mature enough that it's not exciting to write about, but it's still really widely used.
If people have experience designing or implementing greenfield systems based on message queues, I'd be curious to hear about it. I'd also be interested in understanding any war stories or pain points people have had from using message queues in production systems.
[+] [-] hn_throwaway_99|1 year ago|reply
That is, there was a big desire around that time period to "build it how the big successful companies built it." But since then, a lot of us have realized that complexity isn't necessary for 99% of companies. When you couple that with hardware and standard databases getting much better, there are just fewer and fewer companies who need all of these "scalability tricks".
My bar for "Is there a reason we can't just do this all in Postgres?" is much, much higher than it was a decade ago.
[+] [-] ithkuil|1 year ago|reply
[+] [-] peoplefromibiza|1 year ago|reply
I'm not sure people realize this now more than then. I was there back then and we surely knew we would never be Google hence we didn't need to "scale" the same way they did.
Nowadays every project I start begins with a meeting where is presented a document describing the architecture we are going to implement, using AWS of course, because "auto-scale" right?, and 9/10 it includes CloudFront, which is a CDN and I don't really understand why this app I am developing, which is basically an API gateway with some customization that made Ngnix slightly less than ideal (but still perfect for the job), and that averages to 5 rps needs a CDN in front of it... (or AWS or auto-scaling or AWS lambda, for that matter)
[+] [-] steve1977|1 year ago|reply
Is that also why almost no one is using microservices and Kubernetes?
[+] [-] nosefrog|1 year ago|reply
[+] [-] w10-1|1 year ago|reply
True, but the CTO comes from twitter/meta/google/some open-source big-data project, the director loves databases, etc.
So we have 40-100 people managing queues with events driven from database journals.
Everyone sees how and why it evolved that way. No one has the skill or political capital to change it. And we spend most of our time on maintenance tasked as "upgrades", in a culture with "a strong role for devops".
[+] [-] XCSme|1 year ago|reply
[+] [-] bigiain|1 year ago|reply
These days all those people who prioritise career building technical feats over solving actual business problems in pragmatic ways - they're all hyping and blogging about AI, with similar results for the companies they (allegedly) are working for: https://www.theregister.com/2024/06/12/survey_ai_projects/
[+] [-] abeppu|1 year ago|reply
[+] [-] robertlagrant|1 year ago|reply
Yes, that is cynical. People have been building architectures off MQ for a much longer time than microservices have been around. Lots of corporates have used JMS for a long time now.
[+] [-] tuckerconnelly|1 year ago|reply
A while ago I moved from microservices to monolith because they were too complicated and had a lot of duplicated code. Without microservices there's less need for a message queue.
For async stuff, I used RabbitMQ for one project, but it just felt...old and over-architected? And a lot of the tooling around it (celery) just wasn't as good as the modern stuff built around redis (bullmq).
For multi-step, DAG-style processes, I prefer to KISS and just do that all in a single, large job if I can, or break it into a small number of jobs.
If I REALLY needed a DAG thing, there are tools out there that are specifically built for that (Airflow). But I hear they're difficult to debug issues in, so would avoid at most costs.
I have run into scaling issues with redis, because their multi-node architectures are just ridiculously over-complicated, and so I stick with single-node. But sharding by hand is fine for me, and works well.
[+] [-] democracy|1 year ago|reply
Messaging-based architecture is very popular
[+] [-] casper14|1 year ago|reply
[+] [-] bwhaley|1 year ago|reply
[+] [-] spike021|1 year ago|reply
I wouldn't call their use super interesting, though.
The last role was simply because the business required as close to real time message processing as possible for billing analytics. But if I tell someone that, it's not incredibly interesting unless I start diving into messages per second and such.
[+] [-] berniedurfee|1 year ago|reply
Every new idea goes through the same cycle of overuse until it finds its niches.
[+] [-] ipsum2|1 year ago|reply
It used to be popular to post about rewriting angular to react. Now everyone just uses react (or they write posts about rewriting react to vue or whatever the flavor of the month)
[+] [-] burutthrow1234|1 year ago|reply
Change Data Capture (CDC) has also gotten really good and mainstream. It's relatively easy to write your data to a RDBMS and then capture the change data and propagate it to other systems. This pattern means people aren't writing about Kafka, for instance, because the message queue is just the backbone that the CDC system uses to relay messages.
These architectures definitely still exist and they mostly satisfy organizational constraints - if you have a write-once, read-many queue like Kafka you're exposing an API to other parts of the organization. A lot of companies use this pattern to shuffle data between different teams.
A small team owning a lot of microservices feels like resume-driven developnent. But in companies with 100+ engineers it makes sense.
[+] [-] morbicer|1 year ago|reply
[+] [-] busterarm|1 year ago|reply
I work at a company that only hires the best and brightest engineers from the top 3-4 schools in North America and for almost every engineer here this is their first job.
My engineers have done crazy things like:
- Try to queue up tens of thousands of 100mb messages in RabbitMQ instantaneously and wonder why it blows up.
- Send significantly oversized messages in RabbitMQ in general despite all of the warnings saying not to do this
- Start new projects in 2024 on the latest RabbitMQ version and try to use classic queues
- Creating quorum queues without replication policies or doing literally anything to make them HA.
- Expose clusters on the internet with the admin user being guest/guest.
- The most senior architect in the org declared a new architecture pattern, held an organization-wide meeting and demo to extol the new virtues/pattern of ... sticking messages into a queue and then creating a backchannel so that a second consumer could process those queued messages on demand, out of order (and making it no longer a queue). And nobody except me said "why are you putting messages that you need to process out of order into a queue?"...and the 'pattern' caught on!
- Use Kafka as a basic message queue
- Send data from a central datacenter to globally distributed datacenters with a global lock on the object and all operations on it until each target DC confirms it has received the updated object. Insist that this process is asynchronous, because the data was sent with AJAX requests.
As it turns out, people don't really need to do all that great of a job and we still get by. So tools get misused, overused and underused.
In the places where it's being used well, you probably just don't hear about it.
Edit: I forgot to list something significant. There's over 30 microservices in our org to every 1 engineer. Please kill me. I would literally rather Kurt Cobain myself than work at another organization that has thousands of microservices in a gigantic monorepo.
[+] [-] zug_zug|1 year ago|reply
What were doing that required queueing? Not much, we showed people's 401ks on a website, let them adjust their asset mix, and sent out hundreds of emails per day. As you would expect, people almost never log into their 401k website.
A year or so after working there I realized our servers had been misconfigured all along and basically had 0 concurrency for web-requests (and we hadn't noticed because 2 production servers had always served all the traffic we needed). Eventually we just ripped out the Akka because it was unnecessary and added unnecessary complexity.
In the last month this company raised another funding round with a cash-out option, apparently their value has gone up and they are still doing well!
[+] [-] roncesvalles|1 year ago|reply
1. There doesn't seem to be a design review process before people start implementing these things. Devs should make a design document, host a meeting where everyone reads it, and have a healthy debate before implementing stuff. If you have bright people but not-so-bright outcomes, it's because there is no avenue for those who know their shit to speak up and influence things.
2. I will always rather hire a 2-5 YOE dev from a no-name school over a new grad from a top 5 school. The amount that software engineers learn and grow in the first 5 years of their career is immense and possibly more than the rest of their career combined.
[+] [-] scary-size|1 year ago|reply
[+] [-] SwissCoreWizard|1 year ago|reply
Are you making this up to make your claim sound more extravagant? Even Citadel is not that picky so unless you work at OpenAI/Anthropic I'm calling nonsense.
[+] [-] janstice|1 year ago|reply
[+] [-] EVa5I7bHFq9mnYK|1 year ago|reply
[+] [-] spacebanana7|1 year ago|reply
Relatively few graduates know their way around the Snowflake API, or the art of making an electron app not perform terribly. Even sending an email on the modern internet can require a lot of intuition and hidden knowledge.
> There's over 30 microservices in our org to every 1 engineer
I wonder if this a factor in making onboarding of new hires difficult?
[+] [-] nailer|1 year ago|reply
I am out of the loop here. Did Rabbit break classic queues?
[+] [-] bsaul|1 year ago|reply
[+] [-] angarg12|1 year ago|reply
If your perception is indeed correct it'd attribute it to your 3rd point. People usually write blogposts about new shiny stuff.
I personally use queues in my design all the time, particularly to transfer data between different systems with higher decoupling. The only pain I have ever experienced was when an upstream system backfilled 7 days of data, which clogged our queues with old requests. Running normally it would have taken over 100 hours to process all the data, while massively increasing the latency of fresh data. The solution was to manually purge the queue, and manually backfill the most recent missing data.
Even if you need to be careful around unbound queue sizes I still believe they are a great tool.
[+] [-] rossdavidh|1 year ago|reply
https://en.wikipedia.org/wiki/Gartner_hype_cycle
[+] [-] wildzzz|1 year ago|reply
[+] [-] pm90|1 year ago|reply
Thats good. The documentation for eg RabbitMQ is much better and very helpful. People use it as a workhorse just like they use Postgres/MySQL. There’s not much surprising behavior needed to architect around etc.
I love boring software.
[+] [-] okokwhatever|1 year ago|reply
[+] [-] robertclaus|1 year ago|reply
[+] [-] therealdrag0|1 year ago|reply
[+] [-] vishnugupta|1 year ago|reply
Or take AWS SNS which IMO is one level of abstraction higher than SQS. It became so feature rich that it can practically replace SQS.
What might have disappeared is those use cases which used Queues to handle short bursts of peak traffic?
Also streaming has become very reliable tech so a class of usecases that used Queues as streaming pipe have migrated to the streaming proper.
[+] [-] akira2501|1 year ago|reply
It's still pretty exposed. You can set redelivery timeouts and connect a dead letter queue to lambda functions. Even just the lambda invoke API is obviously just a funny looking endpoint for adding messages to the queue.
> as much as have been abstracted away
In AWS in particular into EventBridge which further extends them with state machines. They've become the very mature corner stone of many technologies.
[+] [-] 1oooqooq|1 year ago|reply
[+] [-] ilaksh|1 year ago|reply
There are places where you need a queue just for basic synchronization, but you can use modules that are more convenient than external queues. And you can start testing your program without even doing that.
Actually async is being used a lot with Rust also, which can stretch that out to scale even farther with an individual server.
Without an async runtime or similar, you have to invent an internal async runtime, or use something like queues, because otherwise you are blocked waiting for IO.
You may still eventually end up with queues down the line if you have some large number of users, but that complexity is completely unnecessary for getting a system deployed towards the beginning.
[+] [-] leftbrainstrain|1 year ago|reply
Internally, applications often used proprietary communication protocols, especially when interacting with internal queueing systems. For internal systems, businesses prefer data be retained and intact. At the time, clients still sometimes preferred systems be able to participate in distributed two-phase commit (XA), but I think that preference has faded a bit. When writing a program that services queues, you didn't need to worry about having a large number of threads or TCP connections -- you just pulled a request message from the request queue, processed the message, pushed a response onto the response queue, and moved on to the next request message. I'd argue that easing the strong preference for transactional integrity, the removal of the need for internal services to care about the C10k problem (async), and the need to retain developers that want to work with recent "cool" technologies reduced the driver for internal messaging solutions that guarantee durability and integrity of messages.
Also, AWS's certifications try to reflect how their services are used. The AWS Developer - Associate still covers SQS, so people are still using it, even if it isn't cool. At my last job I saw applications using RabbitMQ, too.
[+] [-] memset|1 year ago|reply
When you enqueue something, you eventually need to dequeue and process it. A lambda just does that in a single call. It also removes the need to run or scale a worker.
I think Kafka continues to be popular because it is used as a temporary data store, and there is a large ecosystem around ingesting from streams.
I personally use queues a lot and am building an open source SQS alternative. I wonder if an open source lambda replacement would be useful too. https://github.com/poundifdef/SmoothMQ
[+] [-] weitendorf|1 year ago|reply
I think this also speaks to a related phenomenon where there are simply more tools and technologies you can buy or run “off the shelf” now. Back in the 2010s everybody was trying to roll their own super complex distributed systems. Nowadays you have a ton of options to pay for more or less polished products to handle that mess for you. No need for engineering meetups and technical blogs about tools that kinda-sorta work if you really know what you’re doing - just pay snowflake or confluent and work on other problems.
[+] [-] jackbauer24|1 year ago|reply
[+] [-] mrj|1 year ago|reply
I just added a RabbitMQ-based worker to replace some jobs that Temporal.io was bad at (previous devs threw everything at it, but it's not really suited to high throughput things like email). I'd bet that Temporal took a chunk of the new greenfield apps mindshare though.
[+] [-] liampulles|1 year ago|reply
My money is on this. I think the simple usecase of async communication, with simple pub/sub messaging, is hugely useful and not too hard to use.
We (as a Dev community) have just gotten over event sourcing, complex networks and building for unnecessary scale. I.e. we're past the hype cycle.
My team uses NATS for Async pub/sub and synchronous request/response. It's a command driven model and we have a huge log table with all the messages we have sent. Schemas and usage of these messages are internal to our team, and are discarded from NATS after consumption. We do at-least-once delivery and message handlers are expected to be idempotent.
We have had one or two issues with misconfiguration in NATS resulting in message replay or missed messages, but largely it has been very successful. And we were a 3 person dev team.
It's the same thing as Kubernetes in my mind - it works well if you keep to the bare essentials and don't try to be clever.
[+] [-] m1keil|1 year ago|reply
In large enterprises, there is usually some sort of global message bus on top of Kafka, AWS Kinesis or similar.
In smaller shops, the need for dedicated message bus is over engineering and can be avoided by using the db or something like redis. It is still a message queue, just without a dedicated platform.
[+] [-] ryapric|1 year ago|reply
[+] [-] ehnto|1 year ago|reply
What I would need to see required before bothering with a message queue architecture:
* High concurrency, atomic transactions
* Multiple stages of processing of a message required
* Traceability of process actions required
* Event triggers that will actually be used required
* Horizontal scaling actually the right choice
* Message queues can be the core architecture and not an add on to a Frankenstein API
Probably others, and yes you can achieve all of the above without message queues as the core architecture but the above is when I would think "I wonder if this system should be based on async message queues".
[+] [-] grenbys|1 year ago|reply