Monolith vs. Microservices

Difficulty
Importance

The problem

A system can be built and deployed as one unified codebase, or split into many independently deployable services — each choice trades away real advantages of the other, and picking one without understanding the tradeoff leads to either a monolith that's outgrown its structure or a microservices system paying distributed-systems costs it didn't need yet.

Why now

Coupling and cohesion already gave the vocabulary for judging internal structure; this topic is where that same question gets asked at the deployment boundary, not just the code boundary — and distributed system basics already established that splitting a system across machines introduces real, unavoidable partial-failure costs a single-process monolith never has to pay.

Mental model

A monolith is one deployable unit with strong internal coupling options (a direct function call) and a single failure domain (if it's up, it's all up). Microservices trade that away for independent deployability and scaling — but every function call across a service boundary becomes a network call, inheriting every cost distributed-system-basics already warned about (latency, partial failure) that a monolith's in-process calls never had to consider.

Requires

Unlocks

Used in

Projects

  • Take a hypothetical monolithic e-commerce system and propose a microservices decomposition, explicitly justifying each service boundary in terms of cohesion
  • List three real costs a team would take on by splitting a working monolith into microservices, and three real benefits, for a specific hypothetical team size and scale

Examples

  • A small team maintaining a monolith can deploy the entire application with one command; the same team running 15 microservices needs orchestration, service discovery, and distributed tracing just to operate at the same level of confidence
  • A poorly decomposed 'microservice' that still requires two other services to be online for basic functionality has recreated tight coupling, just across a slower, less reliable network boundary

Resources

Mastery checklist