Monolith

The entire application in a single deployable process.

Context

A single deployment unit, a single codebase, a single DB. It is the correct choice for almost all new projects.

#Advantages

  • Simple: single deploy, local debugging, atomic refactors.
  • Real transactions between modules.
  • Internal latency = method call.

#When it starts to hurt

  • The team grows (>15-20 engineers touching the same thing).
  • Some parts need to scale differently than the rest.
  • Releases blocked by unrelated features.
When NOT to use it
  • When the domain requires total autonomy between teams.
  • When there are radically different load profiles (one module needs 100 replicas, another needs 1).
Tradeoffs
Pro Con
Maximum operational simplicity Coupling if there is no discipline
Atomic refactors Single deploy = high blast radius
Free ACID transactions All-or-nothing scaling

#architecture #monolith