Monolith is the default choice. Microservices solve specific problems at the cost of complexity.
Monolith¶
- One codebase, one deployment
- Simple development and debugging
- Shared database — transactions straightforward
- Horizontal scaling of the entire application
- Ideal for up to 10-20 developers
Microservices¶
- Independent services, independent deployment
- Technology diversity (Python + Go + Node)
- Independent scaling
- Distributed transactions — difficult
- Operational complexity (networking, monitoring, debugging)
Trade-offs¶
- Complexity: mono ★☆☆, micro ★★★
- Deployment: micro faster per-service, but more pipelines
- Scaling: micro granular, mono entire app
- Debugging: mono simple, micro distributed tracing
- Team independence: micro better for large organizations
Rules¶
- Start with a monolith
- Microservices only when the monolith hurts (deployment, scaling, team conflicts)
- “Modular monolith” is a good compromise
Monolith First¶
Start with a monolith, extract services when it makes sense. Premature microservices = premature complexity.
monolithmicroservicesarchitektura