All academies
Roadmap
Level 02Foundations 25 min

Monolithic Architecture

How monoliths work, why they are the right starting point for most systems, and what a well-structured monolith looks like.

Anatomy of a monolith

A monolith is a single deployable unit: one codebase, one build artifact, one process (or several identical replicas), and typically one shared database. All features — users, orders, payments, notifications — live in the same deployment.

Client
Load Balancer
Monolith (all modules)
Single Database

Why monoliths are a great default

Monoliths get an unfair reputation. For most teams and most products, a monolith is the correct starting architecture.

  • Simple to develop — one repo, one IDE, one debugger, in-process function calls.
  • Simple to test — end-to-end tests run against a single process.
  • Simple to deploy — copy one artifact, run it.
  • ACID transactions — a single database gives strong consistency for free.
  • No network overhead — module calls are nanoseconds, not milliseconds.

The modular monolith

The key to a healthy monolith is internal modularity. Organize code around business capabilities (orders, billing, catalog) instead of technical layers, enforce boundaries between modules, and let each module own its tables.

A modular monolith is also the best launchpad for microservices: if boundaries are clean, extracting a module into a service later is a mechanical exercise rather than an archaeology project.

Modular monolith layout
src/
  modules/
    catalog/      # owns product tables
      api/
      domain/
      persistence/
    orders/       # owns order tables
      api/
      domain/
      persistence/
    billing/      # owns invoice tables
  shared/
    events/       # in-process event bus between modules

Key takeaways

  • A monolith is one deployable unit with (usually) one shared database.
  • Monoliths maximize development speed, testability, and consistency for small teams.
  • Structure monoliths around business capabilities, not technical layers.
  • A modular monolith is the ideal launchpad for future service extraction.

Knowledge check

Q1Multiple choice

What is the defining characteristic of a monolithic architecture?

Q2Multiple choice

Which is a genuine advantage of a monolith over microservices?

Q3Scenario

Your monolith's modules all reach directly into each other's database tables. What is the biggest long-term risk?

Answer all questions to submit