27. Monolith vs Microservices
1
The picture to keep in your head2
27.1 What is a monolith?3
27.2 What are a monolith's strengths?4
27.3 What is a modular monolith?5
27.4 What are microservices?6
27.5 What is the real cost of microservices?7
27.6 How do you draw service boundaries?8
27.7 How does service discovery work?9
27.8 Sync vs async calls between services: when to use which?10
27.9 What does "database per service" mean?11
27.10 When should you split?12
Memory card and where the analogy breaks13
Practice: five levels14
Interview questions15
Solutions16
Sources17
Code lab27. Monolith vs Microservices
Sources
3 min read+10 XP
Source notes
- Prime Video: "Scaling up the Prime Video audio/video monitoring service and reducing costs by 90%", Prime Video Tech blog, 2023 (initial design on Step Functions and Lambda hit a scaling limit at about 5% of expected load; moving to a single process on ECS/EC2 cut infrastructure cost by 90%). Checked 2026-10-08.
- Shopify's modular monolith: Kirsten Westeinde, "Deconstructing the Monolith: Designing Software that Maximizes Developer Productivity", Shopify Engineering, 2019. Checked 2026-10-08.
- Martin Fowler, "MonolithFirst" (2015) and "StranglerFigApplication" (2004); Martin Fowler and James Lewis, "Microservices" (2014).
- Conway's law: Melvin E. Conway, "How Do Committees Invent?", Datamation, 1968.
- Bounded contexts: Eric Evans, Domain-Driven Design (2003).
- "The Tail at Scale": Jeffrey Dean and Luiz André Barroso, Communications of the ACM, 2013.
- Team sizes, availabilities, latencies and call counts are illustrative assumptions; arithmetic computed 2026-10-08.
- Level 3 and Level 4 code: tested 2026-10-08 (
code/ch27_services.py, all checks pass).