Catalog My learning Blog
System Design Roadmap: 100-Day Course for Engineers · Phase 6 · Lesson 51 · 4 min read

Monolith vs Microservices: When to Migrate

On this page
  1. Monolith vs microservices: is it time to split?
  2. Signs it's time to move to microservices
  3. Microservice prerequisites
  4. What microservices cost
  5. Conway's Law and the distributed monolith
  6. The middle path: a modular monolith
  7. Worked example: a retailer's migration plan
  8. Check yourself

Monolith vs microservices: is it time to split?

A retailer's single ASP.NET application holds catalog, cart, orders, payments and inventory. It works. Three teams now commit to it, releases are weekly and nervous, and a slow inventory query once took down checkout. Someone proposes microservices. Is that the fix, or a new set of problems?

Microservices split one deployable application into many small services, each owning a business capability and its own data, deployed independently and talking over the network. Day 9 compared the two shapes; this lesson is about when moving is worth it.

Signs it's time to move to microservices

The good reasons are mostly about people and change, not technology:

  • Teams block each other. Several teams in one codebase wait on shared releases, merge conflicts and each other's test failures.
  • Release cadence differs. Pricing changes daily; the ledger changes quarterly with heavy review. One deploy pipeline serves neither well.
  • Scaling needs differ sharply. Search needs 20 instances on Black Friday; account settings needs 2.
  • Failure isolation matters. A crash or memory leak in recommendations shouldn't take down checkout.

Weak reasons: "it's modern", "the code is messy" (a split spreads mess across a network), or "we might need to scale someday".

Microservice prerequisites

Martin Fowler listed the prerequisites in 2014, and they still hold: provision servers quickly, monitor services well enough to notice problems, deploy any service quickly through an automated pipeline, and have developers and operations working together on incidents (Fowler, 2014). Add distributed tracing (Day 88) to that list today.

If deploying the monolith takes a day of manual steps, ten services take ten days. Fix delivery first. It pays off whether you split or not.

What microservices cost

A single deployable monolith next to several independently deployable services, each with its own database.
A single deployable monolith next to several independently deployable services, each with its own database.
You gainYou pay
Independent deploys per teamA pipeline, monitoring and on-call per service
Independent scalingNetwork calls that can fail, time out and add latency
Fault isolationTimeouts, retries and circuit breakers everywhere (Days 56, 74)
Technology freedom per serviceDistributed tracing to debug anything (Day 88)
Smaller codebasesNo cross-service transactions; sagas instead (Day 49)

A function call becomes a network call. That's the whole trade in one sentence.

Conway's Law and the distributed monolith

Organizations build systems that mirror their communication structure, as Melvin Conway observed in 1968. One team building ten services usually ends up with a distributed monolith: services so entangled that they must be deployed together, with all the network costs and none of the independence. Microservices pay off when service boundaries match team boundaries, and each team owns its services end to end.

The middle path: a modular monolith

A modular monolith is one deployable application with strict internal module boundaries: each module owns its tables, exposes a clear interface, and doesn't reach into others' data. Shopify chose this for its core (Day 9). You get most of the code organization benefits now, and if a module later needs to become a service, its seams already exist.

Worked example: a retailer's migration plan

The retailer's actual problems: three teams colliding, and inventory slowness affecting checkout. A reasonable plan:

  1. Turn the monolith into a modular monolith with clear modules and owned tables.
  2. Extract inventory first: it has different scaling and failure characteristics and a clear owner team. Call it with timeouts and a fallback. Move its tables with it; a service that still reads the monolith's database hasn't really left (Day 58).
  3. Measure. Extract the next service only when a similar signal appears.

That's incremental, reversible and driven by evidence, the opposite of a big-bang rewrite (Day 59).

Check yourself

Build the platform first: automated deployments and basic monitoring, centralized logs and tracing. With half-day manual deploys, 12 services would mean 12 times the manual work, and without centralized logging every incident becomes a hunt across machines. Microservices amplify whatever delivery and operations maturity you already have.

Services so coupled they must change and deploy together, usually from splitting code without splitting ownership or data. It has network costs without independence.

It creates clear module boundaries and data ownership within one deployable, so you gain structure now and can extract services later along existing seams.

That systems mirror the communication structure of the organization that builds them. If team boundaries don't match service boundaries, teams will need to coordinate constantly and services will end up tightly coupled. Align teams with the services they own.

Teams regularly block each other's releases, one part needs to scale or deploy very differently from the rest, or build and test times hurt everyone. If none of these apply, a well-structured monolith is usually cheaper.