System Atlas
the atlas

What are modular monoliths

The clean boundaries of microservices without the distributed-systems tax.

the gist

A modular monolith is a single deployable application whose code is split into strictly bounded, independent modules that talk through explicit interfaces. You get the enforced boundaries and clear ownership people chase with microservices, but keep the simple deployment, in-process calls and easy transactions of a monolith. It's the pragmatic middle ground most teams should start from.

ANALOGY // A microservice architecture is a street of separate houses connected by phone lines; a big-ball-of-mud monolith is a studio with no walls; a modular monolith is one house with solid interior walls and proper doors between rooms.
living diagram01 / 06
Monolithone unit, no walls
Microservicesmany services
Modular monolithone unit, clean walls
Deploy simplicity: monolith and modular monolith ship as one artifact; microservices juggle many pipelines.
01

Deploy simplicity

A modular monolith ships as a single artifact, so deployment, versioning and rollback are one operation — just like a classic monolith and unlike a fleet of independently-released services. There is no service mesh, no orchestration of dozens of pipelines, and no cross-version compatibility matrix to manage. For a small or mid-sized team this alone saves enormous operational effort.

02

Module boundaries

Here it matches microservices: the codebase is carved into modules with explicit public APIs, and one module may not reach into another's internals or database tables. Those boundaries are enforced by architecture (package rules, visibility, build checks), not just good intentions. This is exactly the discipline a big-ball-of-mud monolith lacks.

03

Independent scaling

This is where microservices genuinely win: because each service is its own process, you can give the checkout service more replicas than the search service and scale them independently. A monolith scales as one block — you replicate the whole app even if only one part is hot. If truly independent scaling per component is a hard requirement, that pressure favours splitting out a service.

04

Operational cost

Running one process is dramatically cheaper to operate than running many. There is one thing to monitor, log, secure and debug, and calls between modules are ordinary in-process function calls with no network to fail. Microservices multiply infrastructure, observability and on-call burden — a tax that only pays off at real scale.

05

Refactor and evolve

Boundaries in a single codebase are cheap to move: renaming an interface or shifting a responsibility between modules is a compile-checked refactor. Across services the same change means coordinated deploys and versioned contracts. Keeping everything in one repo means you can evolve the design continuously instead of freezing it behind network APIs too early.

06

The middle ground

Add it up and the modular monolith wins on most axes a normal team cares about: simple to deploy and operate, yet cleanly bounded and easy to reason about. You only sacrifice per-component scaling and independent releases — real benefits, but ones most systems don't need yet. Start here, keep the seams clean, and extract a service only when metrics demand it.

the full picture
01

The problem it responds to

For most of the 2010s the industry treated microservices as the obvious destination for any serious system. The pitch was compelling: split your application into small, independently deployable services, each owned by a team, each scalable on its own, each free to use its own language and database. Escape the dreaded "big ball of mud" — the monolith that has grown so tangled that every change risks breaking something unrelated.

The trouble is that microservices don't remove complexity, they *relocate* it. The moment a function call becomes a network call you inherit an entire class of distributed-systems problems: latency and partial failure, retries and timeouts, distributed transactions, eventual consistency, service discovery, versioned contracts, and an operational footprint of dozens of pipelines, dashboards and on-call rotations. Countless teams adopted microservices to escape a messy monolith and discovered they'd traded a tangled codebase for a tangled *network* — which is much harder to debug. The modular monolith is the reaction to that overcorrection: it asks whether you can get the clean boundaries you actually wanted without paying the distribution tax at all.

02

What a modular monolith actually is

A modular monolith is a single application, deployed as one unit, whose internal code is divided into strongly-bounded modules. The distinction from an ordinary monolith is not that it has modules — every codebase has folders — but that the boundaries between them are *real and enforced*.

Concretely, that means:

  • Each module has an explicit public interface and hides its internals. Other modules call that interface and nothing else.
  • No module reaches into another's classes, and crucially no module reads or writes another's database tables directly. Data is owned by exactly one module.
  • The boundaries are enforced mechanically — through package visibility, module systems, architecture-test tools like ArchUnit, or build-time dependency rules — so a developer physically cannot create a sneaky shortcut across a boundary.

Those modules are usually drawn around bounded contexts from domain-driven design: orders, payments, inventory, notifications. The result is a codebase that is internally organised exactly like a microservice system — clear ownership, one-way dependencies, isolated domains — but that happens to run in a single process.

03

Keeping the monolith's advantages

Because it's still one process, a modular monolith keeps every operational advantage that makes monoliths pleasant to work with:

  • One deployment. You build and ship a single artifact. Rollback is trivial, and there is no matrix of service versions that must stay mutually compatible.
  • In-process calls. A call from the orders module to the inventory module is an ordinary function call — nanoseconds, type-checked, and it either succeeds or throws. There is no network to be slow, drop packets, or partition.
  • Simple transactions. Because everything shares one database connection, you can wrap a multi-module operation in a single ACID transaction. In microservices the same guarantee requires sagas or two-phase commits, which are notoriously hard to get right.
  • Easy refactoring. Moving a responsibility from one module to another is a compile-checked change in a single repository. Across services it's a coordinated, versioned, multi-deploy migration.

In short, everything the modular monolith avoids — network latency, distributed transactions, deployment orchestration, observability sprawl — is a cost microservices force you to pay whether or not your scale justifies it.

04

What you give up

The middle ground is a genuine trade, not a free lunch, and honesty about the losses is what makes the choice credible.

The biggest sacrifice is independent scaling and deployment. Because there's one process, you can't give the search module ten replicas and the checkout module two — the whole app scales as a block, so a single hot component forces you to replicate everything. Nor can one team ship its module without redeploying the entire application, which at very large organisations becomes a real coordination cost. You also can't mix technology stacks per module: it's one runtime, one language, one database engine.

For the vast majority of systems, none of these losses actually bite. Most applications never reach a scale where per-component scaling matters, and most teams are small enough that a shared deploy is a feature, not a bottleneck. The losses only become decisive at genuine scale — Netflix-sized traffic, hundreds of engineers, components with wildly different resource profiles — which is precisely the situation microservices were invented for and precisely where most teams are *not*.

05

The pragmatic verdict

The strongest argument for the modular monolith is evolutionary. If you start with well-drawn module boundaries in a single deployable, you get clean architecture *today* with almost no operational overhead — and you preserve the option to extract any module into a standalone service *later*, once real metrics prove that a specific component needs independent scaling or ownership. A well-bounded module, with its own interface and its own data, is already shaped exactly like a service; promoting it is a comparatively small step. The reverse journey — untangling a premature microservice mess back into something coherent — is brutal.

This is why influential voices now recommend the modular monolith as the *default starting point*: build the monolith with disciplined internal boundaries, resist the network until you have evidence you need it, and let the system tell you where the real seams are before you pay to distribute them. The failure mode to guard against is letting "monolith" become an excuse for no boundaries at all — the enforcement is the whole point. Get that right and you keep the best of both worlds: the clarity of microservices and the simplicity of a monolith, deferring the hardest problems in software until you're actually big enough to need them.

what to remember
01

A modular monolith is one deployable unit internally divided into strongly-bounded modules.

02

Modules communicate through explicit public interfaces, not by reaching into each other's internals or tables.

03

You keep the monolith's wins: one deploy, in-process calls (no network), and simple ACID transactions.

04

You gain the microservice's wins: enforced boundaries, clear ownership, and independent reasoning.

05

You avoid the microservice tax: no network latency, distributed transactions, or per-service ops sprawl.

06

It's an ideal starting point — well-drawn modules can be extracted into services later if scale demands.

check yourself

Quick quiz

Q1

What is the core promise of a modular monolith?

Q2

Which advantage genuinely belongs to microservices, not the modular monolith?

follow the thread