Software Architecture
Microservices vs Monolith: The Architectural Decision Framework for Engineering Leaders
technology.efektifpro.com – The microservices vs monolith debate is one of the most contentious in software architecture. Both patterns have legitimate production deployments at massive scale: Amazon runs thousands of microservices; Stack Overflow serves millions of users from a single C# monolith. The correct architecture depends on organizational maturity, team size, domain complexity, and operational capability — not industry trends.
The Decision Framework: Four Key Dimensions
| Dimension | Favor Monolith | Favor Microservices |
|---|---|---|
| Team Size | < 20 engineers | > 50 engineers in multiple teams |
| Domain Complexity | Single bounded context | Multiple distinct bounded contexts |
| Deployment Frequency | Weekly or less | Multiple daily deploys |
| Operational Maturity | Limited DevOps capability | Platform team managing service mesh |
The Modular Monolith: The Best of Both Worlds
# Modular monolith structure — strict package boundaries
src/
- payments/
- __init__.py # Public API
- domain/ # Domain models, business logic
- application/ # Use cases, command/query handlers
- infrastructure/ # Database, external APIs
- inventory/
- __init__.py # Public API
- orders/
- __init__.py # Public API
- shared/
- domain_events.py # Cross-module event bus (async, in-process)
When Microservices Go Wrong: Signs of a Distributed Monolith
- Services share the same PostgreSQL database schema or tables
- Deployment requires coordinating across 10+ services simultaneously
- A single user request makes synchronous calls across 8+ services
- One team owns half the services and must approve all changes
- Integration test environment requires all services running together
Microservices Prerequisites: Invest in Platform Engineering First
- ✅ Service Mesh: Istio or Linkerd for mTLS, observability, and traffic management
- ✅ Distributed Tracing: OpenTelemetry + Jaeger/Tempo to trace requests across services
- ✅ Centralized Logging: Structured logs from all services to OpenSearch/Loki
- ✅ Secrets Management: Vault or AWS Secrets Manager
- ✅ Golden Path CI/CD: Service template with testing, deployment, rollback automated
