Monolith vs Microservices
A monolith is one deployable unit that is simple to build and operate; microservices split it into independently deployable services that scale teams at a cost of distributed complexity.
By Ratish Jain · Updated
The Decision
A monolith packages all functionality into a single deployable application, typically sharing one database. It is simple to develop, test, deploy, and debug: one codebase, in-process calls, easy transactions. The downsides appear at scale — the codebase grows tangled, every change redeploys the whole app, and one team's mistake can crash everything.
Microservices decompose the system into small, independently deployable services, each owning its data and communicating over the network. This lets many teams ship autonomously and scale hot paths independently, but you inherit the full weight of distributed systems: network failures, eventual consistency, and operational overhead.
So it depends on organizational scale and complexity: start with a monolith, and adopt microservices when team and domain boundaries demand it.
Side by Side
| Monolith | Microservices | |
|---|---|---|
| Deployment | One unit | Many independent units |
| Data | Usually one shared DB | Database per service |
| Communication | In-process calls | Network (HTTP/gRPC/events) |
| Team scaling | Contention on one codebase | Autonomous per-service teams |
| Scaling | Whole app together | Per-service, targeted |
| Transactions | Simple ACID | Sagas, eventual consistency |
| Failure blast radius | One fault can down all | Isolated, needs resilience patterns |
| Ops overhead | Low | High (infra, observability) |
Microservices Strengths & Weaknesses
- Independent deployment lets teams ship without coordinating releases
- Scale and optimize only the hot services, in the right language
- Fault isolation with patterns like circuit breakers and bulkheads
- Distributed-systems complexity: network faults, retries, tracing
- Cross-service transactions need sagas and eventual consistency
- Heavy operational cost — CI/CD, service mesh, observability per service
Decision Guide
Choose a monolith for new products, small teams, and unclear domain boundaries — it is faster to build and easier to change while you learn. Move toward microservices when the team grows past what one codebase can coordinate, when parts of the system need independent scaling or release cadence, and when domain boundaries are well understood. A well-modularized monolith is a strong middle ground and a clean starting point for later extraction.
Real-World Examples
- Amazon
- Broke a monolith into thousands of services as it scaled
- Netflix
- Migrated to microservices on AWS for resilience and scale
- Shopify
- Runs a large, deliberately modular ('majestic') monolith
- Segment
- Famously moved from microservices back to a monolith
Interview Questions
Early on, domain boundaries are unclear and changes cut across services; premature splitting locks in wrong boundaries and adds distributed-systems overhead before you have the scale or team size to benefit. A modular monolith lets boundaries emerge, then be extracted.
You cannot use a single ACID transaction across separate databases, so you use the saga pattern: a sequence of local transactions with compensating actions to undo prior steps on failure, accepting eventual consistency and often coordinating via events.
- →Monolith = one deployable, shared DB, simple and fast to start.
- →Microservices = independent services with their own data over the network.
- →Microservices scale teams and hot paths but add distributed complexity.
- →Cross-service transactions need sagas and eventual consistency.
- →Start monolith (ideally modular); extract services as scale demands.
Related
Everything on Archprimer is connected — follow the graph.