Stop thinking monoliths or microservices are "better". Here's what is actually important. Every software architecture has its benefits. What do you gain or lose with the chosen architecture? Choose microservices if you need: - Independent deployability - Different technology per service - Ability to scale more granularly Yes, there are other things I could highlight here. But these are the core benefits that microservices give you. All the other benefits you could have with a monolith. That's why I prefer the monolith first. But not any kind of monolith... A modular monolith. Here's what I mean: milanjovanovic.tech/modular-monoli… Have you implemented the modular monolith architecture? --- Sign up for the .NET Weekly with 72K+ other engineers, and get a free Clean Architecture template: milanjovanovic.tech/templates/clea…
One problem with modular monoliths is that it can be easy to break the module boundaries. I wrote a few tips on how to prevent this: milanjovanovic.tech/blog/how-to-ke…
@mjovanovictech Understanding the pros and cons of each architecture and technical decision is what separates the good from the best, imo. It's all about trade-offs.
@mjovanovictech It is easy: Are you building a social network? Are you building a stream plataform like Netflix? Yes: microservices No: monolith (your app just solves some part of a business problem, or just a specific problem, or for just limited clients under a contract, or just some users)
@mjovanovictech I've implemented both and IMO most teams don't need microservices. They mainly help big teams work independently. For smaller teams, a modular monolith is simpler and you can always split later if needed. 🤷
@mjovanovictech I do a version of this with MongoDB. Except my DB connections are stored in the main DB and encrypted.
Modular Monolith is so much easier to get started with. Start building your project faster. And it's much easier to refine the module boundaries than in the microservices. Though, there are cases when you need to start with microservices. Like for example, 5+ teams need to start working on the same big project. However, each time can make their set of services as Modular Monolith on the first phase, why not?
@mjovanovictech I dislike microservices. I believe their primary purpose is to facilitate management, not to serve a technical function. Microservices are extremely cumbersome, but their advantage is that if something goes wrong somewhere, you can pinpoint whose responsibility it is.