Modular Monolith

A modular monolith is a single-deployable application built with strict internal module boundaries: clear ownership per module, explicit interfaces between them, no shared mutable state across boundaries. The result combines monolithic operational simplicity with most of the structural benefits of microservices.

How it works

Each module owns its own data, its own domain logic, and exposes a typed interface (functions, ports, or in-process events) that other modules call. Module-private code cannot be reached from outside the module. The compiler or linter enforces the boundaries.

Many monoliths achieve the same packaging without the discipline; the difference is enforcement. A modular monolith that goes ungoverned drifts into a "big ball of mud".

When it fits

  • Small to medium teams where microservices overhead is not yet justified
  • Domains where transactional consistency across modules matters
  • Projects that want the option to extract modules into services later, without paying the network cost upfront
📖

Subscribe to Sahil's Playbook

Clear thinking on product, engineering, and building at scale. No noise. One email when there's something worth sharing.
[email protected]
Subscribe
Mastodon