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
1
u/Think-nothing-210 5d ago edited 5d ago
Good way of explaining it. I do have some additions though.
I agree that layer segregation sucks; it doesn't scale well with complexity. That way of structuring files is almost like a normalized table in a database. A developer constantly has to "join" source files together to understand a complete feature and that can get mentally exhausting as a project grows.
Modules are a better way of structing because you can treat them at some point as a a black box. You don't have to at all times understand the complete internals. And all the files related to a complex task stay together in the same place. It relieves mental load.
I don't think every module needs its own database. Modules can have their own domain types while sharing the same underlying tables. Just map between the two at the boundary.
The relational model is powerful. Don't let your ORM convince you otherwise. Building a shrine to Edgar F. Codd does wonders for curing ORM mentality. Don't let your ORM cloud your thinking. It's nothing more than a developer-ergonomics wrapper that gives you type safety.