Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path →
Monolith vs microservices: where does the complexity live?
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."
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).
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.
Head to head
| Dimension | Monolith | Microservices |
|---|---|---|
| Deployment | One unit, one deploy | Independent deploys per service |
| Team scaling | Coordination overhead grows with team size | Teams own services, less deploy coordination |
| Where complexity lives | In the code | In the network — partial failure, latency, consistency |
| Debugging | A single stack trace | Distributed tracing needed across boundaries |
| Scaling | The whole app scales together | Scale only the hot service independently |
| Data | One shared DB, easy joins/transactions | DB-per-service, no cross-service joins, sagas |
| Latency | In-process calls, near-zero | Network calls between services, added failure modes |
| Operational overhead | Simple — one thing to run/monitor | High — service mesh, discovery, per-service alerting |
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
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.
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.
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.
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.
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.
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.
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: where the coupling lives
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
orderstable, 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
pendingorder 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.
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.
Service boundaries are expensive to move once they are network calls, and a boundary drawn before you understand the domain is almost always drawn wrong. A monolith keeps refactoring cheap while you are still learning. Splitting along a four-person team also bakes today's org chart into your architecture — the Conway trap, in advance.
One endpoint in your system needs 20× the compute of everything else and is spiking your whole cluster.
This is the case where a service earns its cost: an independently scalable workload with a clear boundary you did not have to guess at. Splitting everything else at the same time pays the full distributed-systems tax for components that never asked for it, and scaling the whole monolith means paying for 20× capacity on code that does not need it.
Your microservices are deployed together, share one database, and a release requires all of them to ship at once.
The point of separate services is independent deployment and independent failure. Sharing a database and a release train removes both while keeping the network hops, the partial failures and the operational overhead. Separate repositories are cosmetic here — the coupling is in the data and the release, not the folder layout.
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.
Monolith vs Microservices: one shared house, or a street of shops
Explore the topic
See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.
More Handbooks
- The System Design Fundamentals HandbookThe load-bearing ideas behind every distributed system — the CAP theorem and consistency models, concurrency and locking, partitioning and replication, and consensus and coordination — each tied to a real worked design you can study interactively.Read →
- CAP Theorem & Consistency ModelsWhat a distributed system can promise when the network splits — CP vs AP, why "CA" is a myth, PACELC, and the full spectrum from linearizable to eventual consistency. Part of System Design Fundamentals.Read →
- Partitioning, Sharding & ReplicationHow one dataset becomes many — range vs hash partitioning, consistent hashing and virtual nodes, hot partitions, replication topologies, replication lag, and quorums. Part of System Design Fundamentals.Read →
- Consensus, Transactions & CoordinationHow nodes that can crash still agree on one truth — majority quorums, Raft and Paxos, leader election, two-phase commit vs the saga pattern, and idempotency for exactly-once effects. Part of System Design Fundamentals.Read →
- The Kubernetes HandbookThe one idea under all the YAML — declare desired state, and a control loop makes reality match. Covers the orchestration problem, pods, deployments and replicasets, services and networking, the reconciliation loop and self-healing, the scheduler, config/secrets and health probes, autoscaling, and when you actually need Kubernetes.Read →
- The Observability HandbookSeeing inside production — monitoring vs observability, the three pillars (metrics, logs, traces) and what each answers, structured logging, metric types and the cardinality trap, distributed tracing, the golden signals and SLIs/SLOs/error budgets, alerting on symptoms not causes, and correlating all three during an incident.Read →