Choosing between a monolith and microservices is one of the decisions that can shape a software product for years.
The discussion often begins with a familiar assumption: a monolith is fine for a small application, but microservices are necessary once it grows.
That sounds reasonable. It is also incomplete.
A well-structured monolith can support complex business requirements. Microservices offer independent deployment and scaling, but bring network failures, distributed data, and operational responsibilities that a single application might not need.
The better question is: what is the simplest architecture that meets our requirements while leaving room to evolve?
Let’s work through that question using a fictional e-commerce application. This is an illustrative example, not a production case study.
What are we actually comparing?
Monolithic architecture
A monolith combines several business capabilities into one deployable application. An e-commerce application might contain customer management, catalog, orders, payments, and inventory in one deployment.
Web / Mobile Client
|
E-commerce App
+-------------+-------------+
| Catalog | Orders |
| Customers | Inventory |
| Payments | |
+-------------+-------------+
|
Application DB
These modules can usually communicate through in-process calls, and a new version is deployed as a unit. But a single deployment does not mean the code must be tangled or poorly designed.
Microservices architecture
Microservices organize business capabilities into independently deployable services with explicit contracts.
Web / Mobile Client
|
API Layer
|
+------------------+------------------+
| | |
Catalog Service Order Service Customer Service
Catalog Data Order Data Customer Data
|
+-------+-------+
| |
Inventory Service Payment Service
Inventory Data Payment Records
Services may communicate through APIs, messages, or events. They can be deployed and scaled separately, but now have network boundaries and partial failures to manage. The diagram is conceptual; it is not a recommended production network topology.
Modular monolith: the practical middle ground
A modular monolith is a single deployable application with intentionally enforced internal boundaries.
Orders, Inventory, Catalog, and Payments are separate modules with clear responsibilities and interfaces. One module should not casually manipulate another module’s internal state.
This approach preserves a simple deployment model while improving code organization and making future change easier. It does not provide independently deployable modules—and that may be an acceptable trade-off.
Where the trade-offs become real: placing an order
Suppose a customer orders two items. The system needs to create an order, reserve stock, request payment, and confirm or reject the purchase.
In a monolith, creating a pending order and reserving inventory might share a database transaction:
BEGIN TRANSACTION
Create pending order
Reserve available stock
COMMIT
If reservation fails, the database can roll back both changes—assuming they are in the same transactional system.
However, the external payment provider still sits outside that database transaction. A rollback cannot automatically reverse a completed payment. Even a monolith must handle timeouts, duplicate requests, uncertain outcomes, and reconciliation.
In microservices, Orders, Inventory, and Payments may each own their data. An order can be saved successfully while inventory reservation fails. A payment may succeed even if its response never reaches the Order Service.
There is no automatic transaction across those services. Depending on the workflow, the architecture may need:
- Idempotency to avoid duplicate business operations during retries.
- Timeouts and bounded retries for unreliable network communication.
- Durable messaging and outbox patterns to coordinate state changes and events.
- Saga-style coordination or compensating actions for cross-service workflows.
- Reconciliation and observability to investigate uncertain outcomes.
These are valuable techniques, but they introduce additional implementation, testing, and operational costs.
Microservices do not remove complexity. They relocate it across service boundaries.
Comparing the options
| Consideration | Monolith | Modular monolith | Microservices |
|---|---|---|---|
| Deployment | One unit | One unit | Independent services |
| Internal boundaries | Vary by code quality | Explicit modules | Service contracts |
| Communication | Mostly in-process | Mostly in-process | Network and/or messaging |
| Data consistency | Often simpler within a database | Often simpler within a database | Cross-service coordination required |
| Scaling | Typically whole application | Typically whole application | Service-specific scaling possible |
| Operations | Usually simpler initially | Usually simpler initially | More operational overhead |
| Team autonomy | Shared release lifecycle | Better module ownership | Potential independent delivery |
These are general tendencies, not guarantees.
When is a monolith the better choice?
A monolith—often a modular one—is a sensible starting point when:
- Requirements are evolving. Business boundaries may change as the team learns.
- The team is small. Independent service operations could cost more than they save.
- Release coordination is manageable. One pipeline meets the current delivery needs.
- Business workflows are closely connected. Shared transactions and in-process calls are useful.
- Scaling is not a demonstrated constraint. Database improvements, caching, or scaling the application may be sufficient.
A modular monolith is not a failure to plan for growth. It can be a deliberate architectural decision.
When do microservices justify their cost?
Microservices become more compelling when there is evidence of a genuine need:
Different scaling requirements. A heavily used Catalog capability may need significantly different resources from Order Processing.
Independent team ownership. Several teams own stable business domains and need to release independently.
Different release cadences. Coordinated releases of one application have become a measurable bottleneck.
Clear domain boundaries. Service responsibilities and data ownership are understood well enough to avoid chatty dependencies.
Operational readiness. The organization can support CI/CD, service identity, observability, incident response, recovery, and compatibility management across services.
These benefits are real only when the organization can actually realize them.
Five mistakes worth avoiding
1. Splitting services by database table
A business capability is more than a table. Splitting Orders and OrderItems into separate services may create unnecessary network traffic and tight coupling.
2. Sharing tables without ownership
Separate deployments are not independent if every service reads and writes another service’s data. Data ownership matters more than the number of physical database servers.
3. Making every interaction synchronous
Long chains of blocking calls spread latency and failure. Use immediate requests when necessary and asynchronous workflows where the business can tolerate delayed completion.
4. Assuming microservices automatically improve reliability
A separately deployed service can still bring down an entire user journey if every request depends on it. Reliability requires careful dependency design, testing, and operational practices.
5. Choosing an architecture because it is popular
Technology trends are not business requirements. A migration should address a documented problem rather than produce a more fashionable diagram.
A practical decision framework
Before choosing an architecture, ask:
| Question | Evidence to examine |
|---|---|
| What problem are we solving? | Deployment delays, scaling, maintainability, ownership |
| How stable is the business domain? | Module boundaries and cross-domain changes |
| How is the team structured? | One team or multiple autonomous teams |
| What does the workload demand? | Observed traffic and resource differences |
| What can we operate safely? | CI/CD, monitoring, security, recovery |
| Would a simpler improvement work? | Modularization, query optimization, caching |
Consider a small team developing a new e-commerce platform. Requirements are changing, one team owns most features, and a shared deployment is acceptable. No measurable capability needs independent scaling.
Under those conditions, a modular monolith may be a better fit than microservices. That conclusion should change if the evidence changes.
Evolving incrementally
Architecture is a decision that can be revisited.
A useful migration path is:
- Establish clean module boundaries within the existing application.
- Identify a measured deployment, scaling, or ownership constraint.
- Select a reasonably independent business capability.
- Define its contract, failure behavior, and data ownership.
- Extract it incrementally while verifying correctness.
- Measure whether the change actually improved the original problem.
The Strangler Fig pattern is one approach to moving functionality gradually rather than committing to an all-at-once rewrite.
There is no requirement to extract every module. A modular application with a few independent services can be a perfectly reasonable long-term architecture.
Record the decision, not just the technology
A short Architecture Decision Record (ADR) makes the reasoning explicit.
For our fictional e-commerce product, it might say:
Decision: Begin with a modular monolith.
Context: One small team, evolving requirements, shared releases, and no proven need for independent service scaling.
Consequences: Simpler deployment and transactions, but no independent module deployment.
Revisit when: Release coordination, workload isolation, or team ownership becomes a measurable constraint.
This is valuable because a good architecture decision explains why it was made and what would justify changing it.
Final thoughts
A monolith is not inherently outdated. Microservices are not automatically more scalable, reliable, or maintainable. And a modular monolith is not necessarily a temporary architecture waiting to be replaced.
The right choice depends on requirements, boundaries, team structure, data consistency, and operational capability.
Good architecture is not about maximizing the number of services. It is about creating the boundaries the business actually needs—and understanding the costs those boundaries introduce.
Start with requirements, make the trade-offs explicit, and evolve when evidence justifies the complexity.