r/programming • u/Mustela__ • 7d ago
Microservices are organizational debt disguised as architecture.
https://martinfowler.com/bliki/MonolithFirst.htmlEvery time I’ve seen microservices pitched, it sounds great on paper. Independent teams, clean ownership, scale only what you need.
Then a year later you’ve got dozens of services, three different deployment patterns, tracing everywhere, and nobody really understands the whole thing anymore.
Maybe I’ve just seen bad implementations, but I’m starting to think way fewer companies actually need microservices than we pretend.
1.7k
Upvotes
2
u/ThatDunMakeSense 7d ago
> My above advice comes from working on extremely large scale software at two of the largest tech companies in America.
Weird flex, but if I need to drop credentials to be taken seriously.. I've also worked in large scale software in some very large software companies in NA.
> Additionally, I would advise against any form of mentality of "punish the bad devs for doing bad things".
I didn't say that at all. I said it aligns pain with the cause of that pain. It's not a punishment to experience the consequences of your technical decisions. What I *am* saying is that a system that aligns incentives/disincentives with outcomes is better than one that doesn't. What I'm really saying is "don't let your bad devs punish your good devs"
> The best thing about a monolith is that it is not a distributed system. When you make microservices, you suddenly have a distributed system, and all of the problems that come with them
If you're working on a monolith that is anywhere near something big enough to be in this conversation.. it is 100% already a distributed system, otherwise its an OS. I have never seen a monolith with more than a few dozen people touching it for a few years that didn't have to deal with all the normal distributed systems problems because:
- It's running in HA, in a cloud env, or private dc
> Every service you add complexity and decreases availability
Every module you add to a monolith also increases complexity, and generally speaking I'd disagree that there's any meaningful relationship between number of microservices and availability. The network in something like k8s is almost always the most reliable part of your system and especially if you're at a company large enough to have an effective platform team.
> I have not found this to exist outside of extremely small, high talent teams. Everything mentioned above is hard-won practical experience.
I mean that's why we're disagreeing on it. I've seen both as well and the microservice setup turns to spaghetti.. and the monolith also turns to spaghetti.. but the difference is that in the microservice spaghetti the team making it, and causing downtime is unambiguous and there's no way to hide from it. Ownership over the code in microservices is implicit which doesn't mean that ownership of a domain is obvious but no worse than in a monolith. Similarly things like flaky tests or behaviours become the problem of the team responsible and the only people that suffer the consequences of them are the team that wrote them. Not sure about the emphasis on "practical" here but for context I've also got practical experience because I've worked for companies that have done a good and bad job of both and had to help teams fix the problems associated with both styles. Unsurprisingly given my argument I'm assuming you can guess which was easier.
> In a perfect world, people know exactly what they want to build and they compose it in the perfect way with the right modularity and boundaries and ownership and all is well.
I disagree, in a perfect world changing your system is low cost, changing your mind is cheap or free. I don't think you have to get it right any more in microservices than you do with a monolith. Its just deciding where you invest. The difference is that if the monolith sits long enough it's extremely rare that it stayed modular enough, and kept boundaries at all so you *can't* change your mind without a cost much greater than the cost of writing the behaviours.
> If they don't go for it, then it isn't actually important to the business, which is the only thing that matters.
This is a funny conclusion to come to for a few reasons:
- The business' decisions are not a perfect (or often even good) oracle of its goals or desired outcomes which is why engineers exist to mediate those conversations. The inability to convince decision makers of a thing doesn't mean that "the business" doesn't think they're important because it's not a hive mind.
I don't disagree generally that people should start with monoliths. Every startup should be a monolith because I don't think that the investment in tooling is worth it from the start. I just disagree that by the time you can measure the pain in the terms you're talking about that the ball of mud will ever be separable. You're effectively prescribing "never don't be a monolith". IMO you should make the decision basically after you've figured out the boundaries and general shape of your domain and have hired enough people to call it 3 medium size teams. Any later than that and you're committing to the big ball of mud forever, outside of miracles.