LOAD-BEARINGfree
High-level designTier 5 · unit 5 of 5 · 13 min read

Monolith first, and the cost of splitting early

Four lessons of how to find a boundary. Now the harder question: when. And the honest answer is later than almost anyone wants to hear, for a reason that has nothing to do with taste and everything to do with the asymmetry of what it costs to be wrong.

The asymmetry

Get a boundary wrong inside one deployable, and fixing it is a refactor. Move the classes, update the callers, run the tests, ship. Your IDE does most of it. An afternoon, and nobody outside the team notices.

Get the same boundary wrong across services, and fixing it is: a schema migration in two databases, a backfill, a compatibility window where both shapes are live, coordinated deploys across two teams, a rollback plan for each, and a stretch of weeks where the system is in a state no one designed. A quarter, sometimes two.

So the question is not "which boundary is right?" It is "how confident am I, and what does being wrong cost?" Early on you are least confident about the domain and the split is most expensive to undo. That combination is the entire argument. It is not a claim that monoliths are better; it is a claim about the order in which to buy irreversibility.

The modular monolith gets you most of it

The false choice is "big ball of mud" versus "microservices". The thing that actually works while you are still learning the domain is one deployable with hard internal boundaries:

  • Modules that map to bounded contexts, not to layers.
  • No module reads another's tables. Enforced by schema-per-module and separate database users if your stack allows it, by a linter and a merciless reviewer if it does not. This is the rule that carries the weight — everything else is convention.
  • Communication through explicit published interfaces, with each module's internals genuinely private.
  • In-process events for the things that do not need an answer, so the boundary is already asynchronous where it should be.

You get boundary practice at refactor prices. And when a module has held its shape for a year and you have a real reason to extract it, extraction is nearly mechanical: the interface exists, the data is already separated, the calls are already at the seam. Most of the pain of "splitting the monolith" is the discovery of where the seams are. Do that discovery while it is cheap.

Reasons that justify a split

Each of these is a cost you are already paying, made visible. If you cannot name which one applies, the answer is not yet.

  1. Genuinely different scaling profiles. Not "this part gets more traffic" — that is what horizontal scaling is for. This is when the resource shape differs: the transcoder needs GPUs and runs forty minutes; the API needs 20 ms and 200 MB. One process cannot be sized for both.
  2. Team autonomy, at a size where contention is real. When merge queues, release trains and "who broke main" are consuming a measurable slice of the week, the deploy pipeline has become the bottleneck and a boundary buys it back. Below that size, you are solving a problem you do not have.
  3. Different blast radius. Payments must survive a bad recommendations deploy. When two parts have genuinely different consequences for failure, the process boundary is a containment boundary.
  4. A compliance boundary. Card data, health records, anything under an audit regime. Narrowing the set of systems in scope is a direct, quantifiable reduction in audit cost — one of the few splits with an invoice attached.
  5. Rate of change. Weekly-churn code and never-touched code want different release cadences and different risk appetites.

Reasons that do not

  • "It'll need to scale later." Later you will know the domain, and the split will be cheaper and better aimed. This reason inverts the asymmetry: it spends the expensive currency first.
  • "Microservices are best practice." They are a trade, and every published account of them comes from an organisation whose constraints you should check before adopting their conclusion.
  • "One endpoint is slow." That is an index, a cache or an N+1. Extracting it to a service adds a network hop to a slow thing.
  • "The codebase is messy." A network boundary does not clean up code; it distributes the mess and makes the stack trace stop at the edge.

The bill, itemised

What you take on the day a boundary becomes a network call. Every line is a lesson elsewhere in this course, which is the point — splitting is not one decision, it is a subscription to six of them:

  • Function calls become network calls: slow, failable, retryable, timeout-able (Tier 9).
  • Transactions stop working across the seam; you get sagas, compensations and outboxes (6.05).
  • Debugging requires distributed tracing, because no stack trace crosses a process (9.01).
  • Contracts must be versioned and compatible, forever (1.06).
  • Each service brings a pipeline, a dashboard, an alert set and an on-call surface (Tier 9).
  • Local development gets harder, permanently, for everyone.

None of these is a reason never to split. They are the price list, and the reason to have a specific benefit in mind before paying it.

If you are splitting: the order

Start with the boundary you are most confident about and whose data is most self-contained — which is almost never the core domain. Notifications, search indexing, media processing, PDF generation, reporting: things that consume events, own little, and can be down for ten minutes without stopping the business. You learn your deployment story, your tracing story and your on-call story on a component where being wrong is survivable.

Extract the core domain last, when you have done it four times and the mechanics are boring.

And one blunt sizing check, worth keeping: if you have more services than engineers, you have a staffing problem wearing an architecture diagram. Every service needs someone who knows it well enough to be woken up for it. That is the real capacity constraint on how many boundaries an organisation can afford, and it is measured in people, not in traffic.

The trap

Splitting early to "prepare for scale", and thereby making the one thing you will certainly need to do — move a boundary once you finally understand the domain — the most expensive operation in the system. Premature distribution does not just cost you the operational overhead. It spends your flexibility at the exact moment your information is worst, and then charges you a quarter every time you learn something. Delay the irreversible decision until the reversible experiments have told you the answer.

The nuance

“Do not split until teams are blocked on each other.”

The right test for splitting along *organisational* seams, which is most splits. A different case is legitimate and this rule would wrongly forbid it: extracting a component whose runtime needs are genuinely alien to the rest — a GPU inference service, something needing a different language runtime, something with a wildly different scaling curve or blast radius. One team can correctly own two services for technical reasons.

Going deeper

  • Domain-Driven Design Eric Evans, 2003
    Where bounded contexts and aggregates come from. Dense; the chapters on context mapping are the ones that pay.
  • Building Microservices Sam Newman, 2nd ed. 2021
    The pragmatic counterweight, including a great deal on when not to split.