Vibe Engines
YouTube

Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path

Handbooks  /  Monolith vs Microservices
Engineering~9 min readComparison
Head to Head

Monolith vs microservices: where does the complexity live?

MonolithvsMicroservices

Microservices don't remove complexity — they relocate it, from your codebase into your network. That trade is worth making for exactly one reason, and it isn't "clean architecture."

01

The one distinction that decides everything

A monolith is a single deployable codebase and process for the whole application. Microservices split that application into independently deployable services that talk over the network. The code inside a monolith still has module boundaries — the difference is whether those boundaries are enforced by a network call (microservices) or by convention within one process (monolith).

→ The rule

Small team, unclear domain boundaries, want to move fast? Monolith. Large org where independent teams are blocked on each other's deploys, with boundaries you've already proven out? Microservices.

02

Head to head

DimensionMonolithMicroservices
DeploymentOne unit, one deployIndependent deploys per service
Team scalingCoordination overhead grows with team sizeTeams own services, less deploy coordination
Where complexity livesIn the codeIn the network — partial failure, latency, consistency
DebuggingA single stack traceDistributed tracing needed across boundaries
ScalingThe whole app scales togetherScale only the hot service independently
DataOne shared DB, easy joins/transactionsDB-per-service, no cross-service joins, sagas
LatencyIn-process calls, near-zeroNetwork calls between services, added failure modes
Operational overheadSimple — one thing to run/monitorHigh — service mesh, discovery, per-service alerting
03

When to use each

Reach for a monolith

  • Small team, early-stage product
  • Domain boundaries are still unclear
  • Want to move fast without the distributed-systems tax
  • No real organizational coordination pain yet

Reach for microservices

  • Large org, teams genuinely blocked on each other’s deploys
  • Different components have genuinely different scaling needs
  • Domain boundaries are proven and stable, not guessed
  • You have the ops maturity to run a distributed system
04

Monolith first

Most successful microservice architectures started as a monolith and split along real, observed seams once team size or scaling pressure demanded it. Splitting along GUESSED boundaries before you understand the domain tends to produce a "distributed monolith" — every service still tightly coupled and chatty, so you pay the full network/ops overhead of microservices while getting none of the independent-deployability benefit that was the entire point.

→ The decision rule

Don't split until you can point to the actual pain — a specific team blocked, a specific component that needs to scale differently — not a general sense that microservices are the more "proper" architecture.

05

The real trigger is organizational, not technical

It's tempting to think the decision to split is about codebase SIZE — once it gets big enough, split it. But Conway's Law (system architecture tends to mirror the communication structure of the organization that builds it) points at the actual mechanism: a monolith maintained by 3 engineers rarely needs splitting no matter how much code it has, because there's no coordination bottleneck between people to route around. A monolith blocking 15 independent teams from deploying without stepping on each other's changes has a real problem — but it's an ORGANIZATIONAL one (too many people needing to move independently through one release process), and microservices solve it by giving each team its own deployable unit, not by making the code itself better.

This is why splitting "for clean architecture" without that organizational pressure usually backfires: you've paid for network calls, service discovery, distributed tracing, and eventual consistency — real, ongoing costs — to solve a coordination problem that didn't actually exist yet. The split becomes worth its cost exactly when the number of people who need to deploy independently, without waiting on each other, exceeds what one release process can comfortably serialize.

→ The trade you’re actually making

Microservices trade a monolith's simple, in-process complexity for network-level complexity (partial failure, distributed consistency) — a trade that only pays off when the thing actually blocking you is people waiting on people, not code being hard to read.

06

A worked scenario: an e-commerce startup at two team sizes

At 5 engineers, the startup ships a single Rails or Django monolith, one deploy for everything — the right call, because there's no team-coordination pain to solve yet, and splitting now would add distributed-systems overhead for zero organizational benefit. Every engineer can still hold the whole system in their head, and one deploy pipeline serves everyone fine.

Three years later, at 80 engineers, deploys start queuing behind each other because every team shares the same release train — and worse, the checkout team's flaky test occasionally blocks the catalog team's unrelated deploy from going out. THAT specific, observed pain — teams genuinely blocked on each other, not a code-quality complaint — is the real signal to split checkout, catalog, and search into independently deployable services. Notice the trigger wasn't a predetermined size or a calendar date; it was the organizational bottleneck actually showing up.

→ The pattern generalizes

Watch for teams blocked on teams, not lines of code. That's the signal a monolith is done buying you speed — everything before that point, splitting mostly just adds cost.

★

The flip point: roughly a dozen teams

The split is organizational, not technical, and you can reason about where it flips. N teams sharing one deploy pipeline have on the order of N(N−1)/2 pairwise ways to conflict, block, or coordinate; splitting into services removes that cross-team coupling but adds a per-service operational tax (its own pipeline, monitoring, on-call, network calls). If avoiding one cross-team conflict is worth c and each service’s ops tax is t, the split pays off when N(N−1)/2 · c > N · t, i.e. N − 1 > 2t/c.

→ The number

If a service’s ops overhead is about 5× a single coordination cost (t ≈ 5c), the crossover is near N − 1 > 10, so ~11–12 teams. Below roughly a dozen teams, a monolith’s coordination overhead is cheaper than the microservices tax; well above it, independent deploys and fault isolation win. Treat the number as a heuristic — the constants are judgment, not physics — but the shape is real: microservices are a scaling tool, and adopting them below the crossover buys distributed-systems pain for benefits your org is not yet big enough to use.

The picture

The picture: where the coupling lives

monolith one process, one deploy checkout module catalog module search module one database coupling in code microservices checkout catalog search DB DB DB calls cross the network coupling in contracts distributed monolith checkout catalog search sharedDB one release train both costs, no benefit
The same three parts of the page’s e-commerce example, wired three ways. In the monolith, checkout calls catalog as a function, and both write to one database, so a join or a transaction across them is free. In microservices, each service owns its data and the others can only reach it through its API. That is what makes independent deploys possible, and it is also why a cross-service query becomes a network call. The third panel is the trap from the page’s third quiz question: the services are split, but they still share tables and ship together, so the coupling never left. It just gained a network hop. Each arrow in the middle panel also has a price that a function call never had: a network round trip, around a millisecond inside one zone. An order page that asks catalog for 50 line items one at a time waits about 50 ms; a batch endpoint makes it one call. The question to ask about any architecture is which arrow a change has to cross.
Watch for

Common mistakes

  • Splitting the code but sharing the database

    This is the most common way to build the third panel. Two services read and write the same orders table, so a column rename now needs both teams to ship together, and a slow query from one locks rows the other needs. The services look independent in the repo but are coupled through the schema, which is the hardest contract to version. The tell is easy to spot in review: a service whose credentials can reach another team’s schema. The fix is ownership: one service owns each table, and the others ask it through an API or consume its events. If that feels too expensive, the boundary is probably in the wrong place, and the data is telling you the two parts belong in one service. The one common exception is reporting: analysts who need joins across every domain read a replica or a warehouse fed by change data capture, never the live tables another team owns.

  • Long chains of synchronous calls

    A request that passes through five services in a row is only up when all five are. At 99.9% each, the chain is up 0.999⁵ ≈ 99.5% of the time. Over a 30-day month that is about 216 minutes of failed requests instead of 43. Latency adds up the same way: five in-zone hops at roughly 1 ms each is 5 ms before any service does work, and every hop’s tail latency counts. Keep the request path short. Use timeouts and circuit breakers on every call, and move work that does not need an immediate answer, such as email or analytics, onto a queue so it is off the critical path. Retries need a budget too. If each of three layers retries a failed call 3 times, that is 4 attempts per layer, and a struggling service at the bottom receives 4 × 4 × 4 = 64 requests for every one the user made. Retry at one layer only, with backoff, so a slow service is not finished off by its own callers.

  • Splitting by technical layer

    A “frontend service”, a “business-logic service” and a “data service” look tidy on a slide. But almost every feature touches all three, so every feature needs three coordinated deploys, which is the release train you split to escape. Split by business capability instead, as the page’s example does with checkout, catalog and search: a team can then ship a checkout change end to end without asking anyone. Conway’s Law works both ways here. Layer-shaped services force a layer-shaped org, with a database team in every conversation. If you want the boundaries before the network, build a modular monolith: one deploy, but each module owns its tables and exposes a small interface, and a build check fails any import or query that reaches across. When a module later needs to leave, its seam is already proven, and the extraction is a mechanical move rather than a redesign.

  • Expecting transactions across services

    In the monolith, “charge the card and reserve the stock” is one database transaction. Across two services it is not, and writing to your database and then publishing an event is a dual write: crash between the two and the systems disagree for good. Two-phase commit across services is rarely worth its coupling. Use a saga instead: a sequence of local transactions, each with a compensating action (refund the card if the stock reservation fails). Publish events with the transactional outbox: write the event to an outbox table in the same local transaction, and have a relay publish it afterwards. The relay can publish the same event twice after a crash, so every consumer must be idempotent and drop event ids it has already applied. A saga is also not isolated: between its steps, other requests can see the half-done state, stock reserved but card not yet charged. Model that state explicitly, for example as a pending order status that the UI and reports understand.

  • Splitting before you can see across the split

    In a monolith a single stack trace tells you what happened. After the split, one failed checkout is a dozen log lines in six places unless every request carries a trace id that every service logs and forwards. Teams that split first and add distributed tracing later spend their first outages guessing. A related trap is changing an API without versioning it, which forces every caller to deploy in lockstep. Each new service also needs its own dashboards, alerts and on-call owner. Budget for that before the split: it is the t in the page’s flip-point formula. The sequence that works: tracing and contract tests first, then extract one service along a proven seam, then the next. The strangler fig pattern does that safely: put a router in front of the monolith, send one path (say /search) to the new service, and keep both running until the old code for that path has no traffic and can be deleted.

Your call

Which would you pick?

Three situations. Pick the side you'd actually build — the explanation follows.

A four-person team is building the first version of a product. Nobody yet knows which parts will need to scale.

One endpoint in your system needs 20× the compute of everything else and is spiking your whole cluster.

Your microservices are deployed together, share one database, and a release requires all of them to ship at once.

Frequently asked

Quick answers

Monolith or microservices — which should I use?

Start with a monolith unless you already have a large, multi-team organization with real deploy-coordination pain. Split along proven, observed domain boundaries once that organizational pressure actually shows up, not on a predetermined size or timeline.

Do microservices reduce complexity?

No — they relocate it, from the codebase into the network. You trade in-process function calls for network calls with partial failure, added latency, and distributed consistency problems (sagas, eventual consistency) that a monolith with one shared database doesn’t have.

What is a "distributed monolith"?

A microservices architecture split along guessed, rather than proven, boundaries — services end up tightly coupled and chatty over the network, paying the full operational cost of microservices (service discovery, distributed tracing, network failure modes) without the independent-deployability benefit that justified the split.

What actually triggers the decision to split into microservices?

Organizational scaling, not code size — specifically, independent teams becoming blocked on each other’s deploys through one shared release process. A monolith maintained by a small team rarely needs splitting regardless of how much code it contains.

▶  Watch it explained

Monolith vs Microservices: one shared house, or a street of shops

Monolith vs Microservices · Vibe Engines · 2026
Finished this one? 0 / 209 Handbooks done
NextThe System Design Fundamentals Handbook Closest handbook to this one

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Handbooks