liveBook · Manning

Modular monolith

As explained in Grokking Software Architecture

A monolithic application organized into distinct modules with defined responsibilities and boundaries while remaining deployed as one unit.

A modular monolith is like a ship with watertight compartments: it deploys as one application, but its code is divided into isolated modules. Modules run in the same memory space and share a server, yet communicate through strict interfaces rather than accessing one another’s internal logic or database tables. section 12.2.5

Vertical Slice Architecture helps make those compartments practical. Instead of putting all controllers, business logic, and queries into separate technical folders, group code by business feature. Each slice contains the pieces needed for that feature. section 12.2.5

Checkout as a slice

A Checkout slice contains its own API endpoint, business logic, and database queries. Someone changing checkout can find those pieces together instead of hunting through separate UI, Services, and Data folders. section 12.2.5

A modular monolith keeps internal boundaries without paying the networking costs of separate services. Enforce those boundaries with automated CI/CD tools; otherwise, a single deployment can still become a tangled codebase. Microservices add operational overhead and are worth considering when business needs justify it, such as large teams or highly uneven scaling demands. section 12.11 section 12.2.5

Figure 12.1 The Architecture Spectrum. Moving to Microservices is a two-step evolution. You must first decouple your internal logic using strict interfaces (The Modular Monolith) before you safely decouple your infrastructure across a network.

The architecture spectrum shows the distinction between separating internal logic and separating infrastructure across a network. section 12.2

Plan an escape hatch rather than splitting everything at once. For example, if video transcoding needs independent scaling or faster deployments, extract that module and leave the rest as a modular monolith. The Strangler Fig pattern supports gradual migration by rerouting traffic incrementally. section 12.9.2 section 12.11

How Grokking Software Architecture covers it

How deep it goes
Defines module boundaries and feature slices, discusses automated enforcement and migration triggers, but does not provide a concrete enforcement implementation.
Examples
Uses a Checkout feature slice and an architecture decision exercise involving video transcoding extraction.
What you can do after
Practice/perform drafting an architecture decision with tradeoffs, migration triggers, and a strategy for extracting a module.
How it connects
Connects modular monoliths to Vertical Slice Architecture, microservices, CI/CD, and the Strangler Fig pattern.

Also explained in

Compare how 3 books explain modular monolith →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.