Modular monolith
Architecture organized into functional modules with clear internal boundaries within a single deployment unit.
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.
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.
Cloud
Deploy one container image to a managed runtime, Kubernetes, or a serverless container service. Use managed DB, messaging and observability. Autoscale the whole app by default and prepare to separate a high-traffic module if needed. Use blue-green or canary releases with backward-compatible database migrations and collect module metrics for cost and isolation.
Kubernetes
Use one Deployment with readiness and liveness probes, resource requests/limits, and HPA. Keep boundaries in packages and API contracts, promoting a module to a separate Deployment and Service only when extracted. Use ConfigMaps, Secrets, network policies, rolling updates, and a PodDisruptionBudget. Control DB migrations with an init container or Job.
Incident response
Representative failures are shared DB or pool exhaustion, a slow query or memory leak slowing the whole process, incompatible schemas during deployment, and cascade through circular dependencies. Use alerts, tracing and module metrics to identify impact early. Stop propagation with traffic blocking, feature flags, rollback, pool isolation, or terminating offending queries, then isolate the module or hotfix it. Strengthen boundaries, timeouts, breakers, and load tests.
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.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.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.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 databaseTypical 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 workExample 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: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)Cloud: development, deployment, and operationsEvidence available
In the cloud, it combines operational simplicity with modularity and maintainability.
combines operational simplicity with modularity and maintainabilityKubernetes: 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.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.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 tryDrawbacks 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 defaultRepresentative 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 layersAdditional references (23)
- When (modular) monolith is the better way to build software ↗
- Modular monolith in Software Architecture Decision-Making · liveBook ↗
- Understanding the modular monolith and its ideal use cases | TechTarget ↗
- Modular Monolith (/docs/architecture-patterns/modular-monoliths) ↗
- Architectural patterns for modular monoliths that enable fast flow ↗
- Lesson 20.3 — Modular monolith | System Design From First Principles ↗
- Modular Monolith Architecture ↗
- The Right Number of Services Is Often One. | Microservices Recipes: The Architect’s Field Guide ↗
- Reference Architecture: GKE Enterprise hybrid environment - part 2 - Dec '24 - Google Docs ↗
- From Monoliths to Microservices: Application Modernization With Kubernetes ↗
- Modular Monolith Architecture in Cloud Environments: A Systematic Literature Review ↗
- Engineering Principles for Building a Successful Cloud-Prem Solution - InfoQ ↗
- How to Run Kubernetes Across On-Premises and Public Cloud: Four Hybrid Architecture Models and the Seven Layers to Standardize ↗
- Learning Path: Transform a monolith into a GKE app - Modularize the monolith ↗
- Devnexus 2027 - Migrating a Mission Critical Monolith to a Cloud Native Architecture with Julian Ortiz ↗
- A Private Cloud "Kubernetes Service" deployable anywhere. | CNCF End User Community ↗
- REL03-BP01 Choose how to segment your workload - Reliability Pillar ↗
- Monoliths, services and the cost of a network boundary · Cloud Sandbox ↗
- Tutorial on systems with antifragility to downtime | Computing | Springer Nature Link ↗
- Inside Shopify’s Modular Monolith - by Dr Milan Milanović ↗
- Google SRE - Cascading Failures: Reducing System Outage ↗
- Resilient Microservices: A Systematic Review of Recovery Patterns, Strategies, and Evaluation Frameworks ↗
- Modular Monolith Explained: Boundaries and Trade-offs ↗