Q2 · How do you decide between a monolith, modular monolith, and microservices for a new system?
Back to 24 Architecture Questions.
The question is not “pick a shape from a menu”. The axis it turns on: what a moved boundary costs later, not what the topology looks like on day one. All three options hold the same business capabilities; what differs is what enforces the boundary between them, and what it costs to redraw it once it exists.
What the answer should contain
Boundaries are drawn before topology is picked. Identify the business capabilities first: orders, billing, search. They exist in all three options. Topology only decides what enforces the seams between them.
Know the three enforcement levels.
- Monolith: the boundary is convention. Free to draw, free to cross, and every crossing adds coupling that no diagram shows.
- Modular monolith: the boundary is enforced code. Modules expose internal APIs and import rules are checked in CI. One deployable, real seams.
- Microservices: the boundary is a network call plus separate data ownership. The strongest enforcement, at the highest standing price: latency on every hop, partial failure to handle, consistency to reconcile, contracts to version, tracing to read.
Default for a new system: modular monolith. One deploy pipeline, and boundaries that are actually enforced. Every system that later needs microservices first needs exactly these module seams; extraction happens along them.
Extract on evidence, not anticipation. Each trigger names one module, not the whole system: an independent scaling profile, a team ownership boundary, a deploy-cadence conflict, a fault-isolation need. “We will be big someday” is not a trigger.
Extraction is one module at a time. Strangler pattern: move one capability behind an interface, then behind a process. Small moves stay reversible.
Name the cost of a moved boundary. In a modular monolith, moving a boundary is refactoring plus tests in one repo: days. In microservices, it is splitting data, rewriting contracts, coordinating deploys: weeks to months. The choice decides which bill you pay later, and you pay it while knowing the least about the domain.
Ideas worth mentioning out loud
- “A boundary nobody enforces is not a boundary; a boundary you cannot afford to move is a trap. The modular monolith gives you enforced seams that stay movable.”
- Conway’s law runs this decision more than latency does. Split when the organization splits.
- Scale pressure usually applies to one or two modules, not the system. Extract those; the rest does not need the distributed tax.
Follow-ups to expect
- Won’t the monolith rot into spaghetti? Only if boundaries stay conventional. The modular answer is CI-enforced imports and internal APIs.
- What about independent scaling? Measure the profile first, then extract the one module with its own profile.
- When is a plain monolith enough? Small team, unclear domain, product still finding its shape: do not spend on seams you are about to redraw.
Red flags in an answer
- Microservices by imitation (“Netflix does it”) with no named trigger.
- “We are small, so monolith” with zero internal boundaries.
- Treating the choice as one-time and irreversible.
- Splitting by technical layers (“a web service”, “a database service”) instead of business capabilities.
Sources
- MonolithFirst, Martin Fowler: the original argument that almost every successful microservice system started with a monolith, extracted along seams once they were known.
- Don’t start with a monolith, Sam Newman, published on martinfowler.com: the strongest published counterargument, and the reason this answer is a trade-off and not a default. Newman argues a well-designed modular system from day one avoids a costly extraction later. Read both, and decide with your team size and domain stability in hand.
- Modular Monolith: A Primer, Kamil Grzybek: what enforced in-process boundaries actually look like in code, not in diagrams.