Engineering notes
Monolith vs Microservices: An Engineering Perspective
Choose architecture by transaction boundaries, team ownership and operating cost. Learn when a modular monolith fits and what must be true before extracting a service.
A monolith packages major application capabilities into one deployment unit. Microservices divide capabilities into independently deployable services with explicit contracts. Neither definition tells you whether the code is well structured or the product can scale. The engineering question is which boundaries reduce the dominant constraints without creating coordination and operational costs the team cannot support.
Separate modularity from deployment topology
A monolith can have clear modules, dependency rules and private interfaces. A service-based system can still be tightly coupled if every change requires coordinated releases or all services write the same tables. Splitting repositories does not create autonomy. Start by identifying domain ownership and the changes that actually need to move independently.
For a hypothetical commerce product, ordering and inventory may initially benefit from one transaction and one release process. Document generation may have a different resource profile and release cadence. These are candidates to investigate, not automatic service boundaries. Avoid dividing the system into technical layers that force every user request through a long chain of synchronous calls.
Conceptual illustration of the topic; not an implementation diagram.
Compare the costs that matter to your team
A modular monolith offers simpler local development, transaction handling and end-to-end debugging. Its shared deployment can limit release independence, and poorly controlled background work can affect interactive requests. These are real constraints, but process separation, modularity and resource limits may address some of them without introducing a network boundary.
Microservices can support independent ownership, resource allocation and deployments. They add contract evolution, network failure, service identity, distributed tracing, multiple pipelines and cross-service data consistency. Budget for on-call ownership and operational tooling. A service that nobody can diagnose or deploy safely is not meaningfully independent.
Treat data boundaries as the difficult part
If two services both mutate the same database tables, their release and correctness assumptions remain coupled. Establish one owner for each business invariant and expose an interface for changes. A shared physical database may be a migration step, but unrestricted shared writes undermine the intended boundary.
Moving an operation across databases removes the convenience of a local transaction. Decide whether a workflow tolerates eventual consistency, how pending state appears to users and how compensation or reconciliation works. A saga is not a general rollback mechanism: sending a refund is a new business action and may fail or have costs of its own.
Extract one capability through a compatibility path
First isolate the capability behind an internal interface and remove direct table access from callers. Define the external contract, data owner and failure behavior. Introduce routing that lets the old implementation remain available while the new service is validated. Backfill and reconcile data with a deliberate cutover plan.
Avoid uncontrolled dual writes to the old and new stores. An outbox or another explicitly designed replication mechanism can support migration, but requires duplicate handling and lag monitoring. Compare results where safe, shift traffic gradually and specify rollback conditions before release. Once the new service owns writes, rollback is a data-ownership decision as well as a routing change.
Use a decision record with an explicit counterargument
Record the current constraint, expected benefit, added dependencies, owner and acceptance criteria. If the reason is faster releases, measure release coordination and cycle time rather than assuming the split will help. If it is scaling, identify the resource requiring independent capacity and test whether a separate process or worker fleet would suffice.
A strong counterargument is valuable: “We could keep this module in-process and cap its concurrency.” Compare that option fairly. Fowler’s monolith-first argument is an influential engineering perspective, not proof that every product must follow one sequence. A team with established service operations and well-understood domain boundaries may reasonably choose differently.
Recognize the failure modes of both choices
A monolith often deteriorates through uncontrolled dependencies, implicit ownership and a growing shared release bottleneck. Microservices often deteriorate into a distributed monolith: synchronous call chains, shared writes and coordinated deployments, with network failures added. Enforce boundaries whichever topology you use.
There is no universal user count or code size at which a monolith becomes invalid. Choose the smallest operating model that satisfies the product’s requirements and the team’s ownership needs. Revisit the decision when a concrete constraint changes, and preserve a migration path instead of treating the initial architecture as permanent.
References and further reading
Related content
Backend Development, APIs and System Design
Backend systems, databases and APIs that connect your interfaces, apply business rules and keep information moving between the tools your team uses.
Software Modernisation and Performance Optimisation
Architecture review, database tuning and focused software improvements for applications that have become slow, fragile or difficult to change.
How to Design Scalable Software Architecture
A practical architecture guide to workload models, data ownership, capacity limits and incremental growth—without introducing distributed complexity before it solves a measured problem.
Apply these decisions to your product
Describe the workload, current constraint and product goal to define the scope of a technical discussion.
Discuss your project
