Monolith vs Microservices
One deployable application or many small services: what each buys and costs, the modular monolith in between, the distributed monolith to avoid, and how to split safely.
Overview
A monolith is one application built, tested and deployed as a single unit, usually with one database. Microservices split the application into small services, each running in its own process, owning its own data and deployed on its own. James Lewis and Martin Fowler's 2014 description adds that services are built around business capabilities and deployed by fully automated machinery.
The choice is less about technology than about people. A monolith keeps everything in one place: calls are function calls, a transaction covers everything, and there is one thing to deploy. Microservices let many teams work and release without waiting for each other, and let parts scale separately, but every call now crosses a network, data is split across databases, and there are many more things to run and watch.
Most strong answers land in between. Start with a well-structured, modular monolith, and split out a service when a clear need appears: a team that must release on its own schedule, or a part with very different scaling needs.
What you will be able to do
- Explain what microservices buy and what they cost, including the cost of splitting data.
- Describe a modular monolith and how teams keep its boundaries honest.
- Recognize a distributed monolith and say how to avoid building one.
- Plan an incremental migration with the strangler fig pattern.
- Decide, for a given team and product, whether and where to split.
Key concepts
- Monolith
- Modular monolith
- Microservices
- Independent deployment
- Database per service
- Conway's Law
- Distributed monolith
- Strangler fig migration
- Microservice premium
Interview questions
- How do you decide between a monolith and microservices?
- How does the strangler fig pattern work?
- What is a modular monolith, and when is it the right choice?
- What is a distributed monolith, and how do you avoid building one?
- What does Prime Video's move from distributed components to one process teach?
- How should microservices communicate?
- How does Conway's Law affect this decision?
Sign up free to read the full topic
More System Design topics
- Microservices
- ML Experiment Tracking System
- ML Feature Store
- ML Training Data Lake
- Model Registry and Artifact Store
- Monitoring and Observability
- Multi-Modal AI Search Engine
- Multi-Modal Data Store
- Multi-Region Active-Active Architecture
- Multi-Step Processes
- Multi-Tenancy Architecture
- Multi-Tenant SaaS Platform
Start free on Cariara · Coding problems · System design studio