Browse patterns / System architecture / A002
modular monolith

Modular monolith

Architecture organized into functional modules with clear internal boundaries within a single deployment unit.

Recorded evidence 13/14Compare →Source
01 / UNDERSTAND

Structure and behavior

Follow the arrows step by step.

Module boundaries are logical. Manage internal APIs and data ownership within the single deployment unit.

Expected benefits

Keeps single-deployment operations simple while enforcing module boundaries and allowing independent module development, testing, and local transactions.

Trade-offs

By default the whole app deploys and scales together. A single release can constrain team autonomy.

It is not the opposite of microservices; it postpones distribution until benefits justify it. It may be unsuitable when independent deployment or scaling is already required.

02 / APPLY

Operations and adoption guide

Synthesis, distinct from items backed by source excerpts. Validate before applying in production.

When to use

Use when domain boundaries are emerging but one team and one release still need to deliver and operate quickly. Modularize the complex domain without taking on distributed complexity until independent deployment or scaling is needed.

Scenario

A midsize retail and e-commerce business has 30 developers running orders, payments, inventory, and shipping as one deployment. It starts with one database but each module owns its schema. The system must handle millions of orders per month and peak surges, but clear domain boundaries and production stability come first. Scale the app as a whole for order surges and preserve API contracts and internal events so inventory or payments can later be extracted.

Placement principles

  • Split modules by business capability, such as ordering, payments, inventory, or shipping, with each module owning its schema and data access
  • Use only public API contracts and internal events between modules and forbid circular dependencies
  • Deploy one artifact and process, separating module configuration and migrations
  • Put shared infrastructure, observability, and authentication in a platform layer without leaking them into domain modules
  • Keep package and data boundaries clear so necessary modules can be extracted behind a network boundary later.

On premises

Keep deployment and operations simple with one artifact and DB. Enforce boundaries in builds, tests, and code review. Use one process locally while managing ownership and migration order per module. Prioritize scale-up or whole-app scale-out under on-premises constraints, and extract a module gradually only after identifying a real bottleneck.

03 / VERIFY

Evidence by criterion (14 total)

Evidence availability at the time of research. Assess source accuracy and currency separately.

Definition and overviewEvidence available

Architecture organized into functional modules with clear internal boundaries within a single deployment unit.

A modular monolith is a single deployable system with clear internal boundaries between modules.

livebook.manning.com original ↗

Problem addressedEvidence available

Separates responsibilities without network distribution, deferring the coordination, deployment, integration, and operational overhead of distributed systems.

It separates responsibilities without immediately taking on network-level coordination, deployment, integration, and operational complexity.

livebook.manning.com original ↗

Key components and resourcesEvidence available

One deployment unit with modules that own data and expose narrow interfaces.

A modular monolith is one deployable unit composed of modules that own their data and expose narrow interfaces.

onse.dev original ↗

Data and asset placementEvidence available

Make module ownership explicit and keep the ownership boundaries even with a shared database.

Ownership by module, even in one database

codecones.com original ↗

Typical use casesEvidence available

A practical starting point when the domain is still being understood, one team handles most work, and distributed operations are not yet mature.

practical starting point when the domain is still being understood, one team owns most of the work

livebook.manning.com original ↗

Example scenarioUnverified

No primary-source evidence was recorded. This does not imply that the pattern is unsuitable.

When to avoid and caveatsEvidence available

It is not the opposite of microservices; it postpones distribution until benefits justify it. It may be unsuitable when independent deployment or scaling is already required.

The pattern is not an anti-microservices position. It is a choice to delay distribution until its benefits are real:

livebook.manning.com original ↗

On premises: development, deployment, and operationsEvidence available

One artifact, process, and DB simplify on-premises deployment and operations.

It is monolithic (one artefact, one process, usually one database server)

firstprinciplesapproach.dev original ↗

Cloud: development, deployment, and operationsEvidence available

In the cloud, it combines operational simplicity with modularity and maintainability.

combines operational simplicity with modularity and maintainability

www.mdpi.com original ↗

Kubernetes: development, deployment, and operationsEvidence available

In Kubernetes, deploy a single workload with health checks, autoscaling, and rolling updates, extracting only modules that need separation.

It manages deployments, scaling, networking and everything else that goes into running a distributed application.

www.cdw.com original ↗

Incident responseEvidence available

Failures can propagate between modules via shared processes and data, so detect, isolate, contain, and recover early.

A failure in one part of the system can cascade into failures in other parts of the system.

docs.cloud.google.com original ↗

BenefitsEvidence available

Keeps single-deployment operations simple while enforcing module boundaries and allowing independent module development, testing, and local transactions.

You keep operational simplicity of a monolith while enforcing the boundaries that microservices try

onse.dev original ↗

Drawbacks and trade-offsEvidence available

By default the whole app deploys and scales together. A single release can constrain team autonomy.

Scale the whole application by default

codecones.com original ↗

Representative tools and technologiesEvidence available

A representative technique is organizing domain modules around DDD subdomains and bounded contexts instead of technical tiers.

based on DDD subdomains/bounded context rather than technical layers

microservices.io original ↗

Additional references (23)