A modular monolith is a single deployable application organized around domain subdomains rather than technical layers. Its domain modules have explicit boundaries and limited coupling, while sharing one codebase and deployment pipeline. section 1.2.2 section 6.2.2
A technology-oriented structure can scatter subdomain logic across layers, increasing coupling as the application grows. Organizing around subdomains makes ownership clearer and can improve modifiability, testability, deployability, and team autonomy. Build-project design can further reduce build-time coupling and accelerate many changes. section 6.2 section 6.1.4 section 6.5
Food-ordering application
A food-ordering application can have consumers, orders, and deliveries modules. Each contains its subdomain’s web, domain, and persistence logic. A main module provides the entry point and depends on the domain modules. Teams can own the code corresponding to their subdomains. section 6.2.2
Figure 6.8 A modular monolith consists of domain modules corresponding to the application’s subdomains. Consequently, it’s aligned to the organization’s structure.
The domain modules correspond to subdomains and align with the organization’s structure. section 6.2.2
Modularity has limits:
- A single technology stack constrains evolvability, and observability remains coarse-grained. section 6.4.1
- Changes to widely used APIs, dependencies, or the runtime can require coordination across teams. Modularity can reduce average build time, but not the worst case for widespread changes. section 1.2.2 section 6.4.1
- As the application and organization grow, the single deployment pipeline can become a bottleneck even when modules are loosely coupled. section 1.2.2
Choose a monolith when its simplicity suits the application and team size; use domain modules to manage complexity as it grows. Do not assume that each module can later become a service. In-process calls may perform poorly or become unreliable when replaced by network calls, and a single transaction spanning modules may need to become multiple coordinated transactions. If the application and organization outgrow a monolith, microservices may be needed to restore fast flow. section 6.5 section 6.4.2 section 6.4.1


