Monolith vs microservices: when to choose which?
Model answer
A monolith deploys the whole application as one unit. A microservices architecture splits it into small services that are deployed independently, each owning its data and communicating over the network.
Monolith strengths: simple to build, test, deploy and debug, no network calls between modules, easy transactions, and low operational overhead. It fits a small team, a new product with unclear boundaries, or a modest scale. A well-structured modular monolith keeps clear internal boundaries and can be split later.
Microservices strengths: independent deployment and scaling, team autonomy, fault isolation, and freedom to choose technology per service. The price is distributed-systems complexity: network failures, data consistency without simple transactions, service discovery, observability and a heavy operations burden.
I start with a monolith unless there is a real need, such as many teams blocking each other or very different scaling needs. Microservices solve organizational and scaling problems, not code-quality problems.
Key points
- Monolith: simple and cheap to operate; fits small teams and unclear boundaries
- Microservices: independent deployment and scaling at the cost of distributed complexity
- A modular monolith is a good starting point
Likely follow-ups
- How do you decide where to draw service boundaries?
- How would you migrate a monolith to services step by step?
Common mistakes
- Choosing microservices by default because they are fashionable
- Splitting services that still share one database, creating a distributed monolith