Microservices vs Monolith: How to Choose Without the Hype

Few architecture questions come back as often as this one. A decade ago microservices were the default answer for anyone who wanted to look modern. Then the stories started to come in from the other direction: teams merging dozens of services back into one, and a widely shared Amazon Prime Video case study about cutting infrastructure cost by moving a system from distributed components into a single process.

Both camps are right about something. A monolith and a microservice architecture are not good or bad; they are two ways to pay for the same system, with different bills arriving at different times. This post compares them honestly: what each one gives you, what it costs, when to pick which, and the middle ground that most teams should probably start from.

The short version, if you only read one paragraph: choose the architecture that matches your team and your problem today, keep the internal boundaries clean, and split only when a specific pain tells you to.

Two shapes of the same system

Take an ordinary online shop with four business capabilities: catalogue, orders, payments and shipping.

In a monolith, all four live in one codebase, are built into one deployable unit and usually share one database. A call from orders to payments is a function call: fast, type-checked by the compiler, and part of the same transaction if you want it to be.

In a microservice architecture, each capability becomes its own service with its own codebase, its own deployment pipeline and, ideally, its own data store. Orders talks to payments over the network, through an API or a message broker. Each service can be released, scaled and even rewritten on its own.

The important difference is not the number of boxes. It is where the boundaries are enforced: by discipline inside one process, or by the network between processes. Almost every advantage and disadvantage below follows from that one fact.

An online shop as a monolith with four modules and one shared database, and as four microservices with their own data stores behind an API gateway
An online shop as a monolith and as microservices (simplified).

The monolith

“Monolith” became an insult somewhere along the way, which is unfair. Most successful products started as one, and many large ones still are.

Advantages

  • Simple to build, run and debug. One repository, one build, one deployment, one log stream. A stack trace shows the whole path of a request.
  • Fast and reliable internal calls. A function call does not time out, does not need retries and costs nanoseconds, not milliseconds.
  • Easy transactions and consistency. Placing an order and reserving stock can be one database transaction. No sagas, no compensating actions.
  • Easy refactoring. Moving a responsibility from one module to another is an IDE refactoring, checked by the compiler and the test suite in one go.
  • Low operational cost. A small team can run it without a platform team, a service mesh or distributed tracing.

Disadvantages

  • Boundaries erode. Nothing stops the shipping code from reaching into the orders tables. Over years, this turns into the infamous “big ball of mud”.
  • Everything is deployed together. A small change to the catalogue page means building, testing and releasing the whole application. As the codebase grows, builds and test suites get slow.
  • Scaling is all or nothing. If only the search feature is busy, you still scale the whole application.
  • One technology stack. The whole system shares a language, a framework and their versions. Upgrading a framework is a big-bang project.
  • Team friction at scale. Fifty developers in one codebase step on each other: merge conflicts, a shared release train, and long discussions about who owns what.

Microservices

Microservices are, first of all, an organisational tool. They let many teams work on one product without waiting for each other. The technical benefits are real, but they come second.

Advantages

  • Independent deployment. The payments team can release five times a day without coordinating with the catalogue team.
  • Team autonomy and clear ownership. One team owns one service, its code, its data and its on-call rota. This maps cleanly to Conway’s law: the architecture mirrors the organisation.
  • Independent scaling. Search can run on twenty instances while the admin back office runs on two.
  • Fault isolation, if you design for it. A crashed recommendation service should leave checkout working.
  • Technology freedom. Each service can pick the language, database or library that fits its job, and can be rewritten on its own.

Disadvantages

  • You now run a distributed system. Calls fail, time out and arrive twice. Every interaction needs timeouts, retries, idempotency and circuit breakers.
  • Consistency gets hard. A business operation that spans services cannot be one transaction. You need sagas, outbox patterns and the acceptance of eventual consistency.
  • Operational overhead. Each service needs a pipeline, monitoring, alerting, logging, secrets and versioned APIs. In practice you need a platform: containers, orchestration, service discovery and distributed tracing.
  • Debugging and testing across services. A bug may live in the interaction between three services owned by three teams. End-to-end tests become slow and flaky.
  • The distributed monolith trap. If services share a database or must be deployed together, you pay all the costs above and get none of the benefits.
Aisle between rows of server racks in a data centre
Every service needs somewhere to run, be watched and be patched. Photo: PiDatacenters, CC BY-SA 4.0, via Wikimedia Commons.

Side by side

DimensionMonolithMicroservices
Getting startedFast: one project, one deploymentSlow: platform, pipelines and contracts first
Internal callsIn-process, nanoseconds, no partial failureNetwork, milliseconds, can fail or time out
Data consistencyOne transaction across modulesEventual consistency, sagas, outbox
DeploymentEverything togetherEach service on its own schedule
ScalingWhole applicationPer service
Fault isolationOne bad module can bring the process downContained, if designed for it
Refactoring across boundariesEasy, compiler-checkedHard: versioned APIs, coordinated releases
DebuggingOne stack trace, one logDistributed tracing, correlation IDs
Team scalingGets painful beyond a few teamsScales to many autonomous teams
Operational costLowHigh; usually needs a platform team

Read the table column by column and a pattern appears. The monolith is cheaper on almost every technical row. Microservices win on the rows about independence: deploying, scaling and owning things separately. That is why the right answer depends so much on how many teams you have and how independent they need to be.

The microservice premium

In 2015 Martin Fowler gave this trade-off a name: the microservice premium. Microservices add a fixed cost before they deliver anything: automated deployment, monitoring, handling of partial failure, eventual consistency. His rule of thumb was blunt: do not even consider microservices unless the system is too complex to manage as a monolith.

The idea is easiest to see as two curves. For a simple system, the monolith is more productive, because you skip the premium. As the system and the organisation grow, the monolith’s productivity falls faster, because every change touches more code and more people. At some point the curves cross. Nobody can tell you exactly where that point is for your system, and the chart below is a sketch of the idea, not a measurement.

Conceptual chart: the monolith is more productive at low complexity, microservices become more productive after a crossover point
The microservice premium: conceptual, after Martin Fowler (2015).

Two practical consequences:

  • Starting with microservices is a bet that you will need them, paid in advance. Most new products never reach the crossover, or change direction so much that the original service boundaries turn out to be wrong.
  • Monolith problems are often not monolith problems. Slow builds, tangled code and painful releases are frequently fixed by better modularity and better CI, without splitting the process.

When to choose which

The decision is rarely about technology. It is about people, the maturity of your domain knowledge and your operational capabilities. Four questions settle most cases, and the flow below puts them in order.

Decision flow with four questions; most answers lead to a modular monolith, the last leads to extracting services one at a time
A decision flow for monolith or microservices: the author’s simplification.

Choose a monolith (ideally a modular one) when:

  • the product is new and the domain is still being discovered, so boundaries will move;
  • one or two teams work on it;
  • you do not have, and do not want to build, a platform for running many services;
  • strong consistency across business operations matters more than independent scaling.

Choose microservices, or extract a few services, when:

  • several teams are blocked by each other’s releases, and the coordination cost is measurable;
  • parts of the system have genuinely different needs: one part must scale to 100 times the load, or needs a different runtime, or a different release cadence;
  • the domain is well understood, so you can draw boundaries that will not move every quarter;
  • you already have, or can afford, mature CI/CD, monitoring, tracing and on-call practices.

If you answer “no” to the last point, microservices are likely to hurt, however good the other reasons are.

The middle ground: modular monolith and strangler fig

The choice is not binary. Two ideas make the middle ground practical.

The modular monolith keeps one deployable unit but organises the code by business domain, not by technical layer. Each module has a public API, owns its data (its own tables or schema) and may only call other modules through their APIs. The rules are enforced by tooling, for example dependency checks in CI, rather than by good intentions. You keep the cheap function calls and single deployment, and you get most of the clarity that microservices promise.

A modular monolith is also the best preparation for microservices. If a module already has a clean API and its own data, extracting it into a service is mostly an infrastructure task. If it does not, splitting it into a service only moves the mess onto the network.

The strangler fig pattern is how you migrate when you do need to split. Instead of a big-bang rewrite, you put a routing layer in front of the monolith and move one capability at a time into a new service. Traffic for that capability is routed to the new service; everything else still goes to the monolith. Over time the monolith shrinks until it disappears or stays as a small core. The name comes from a fig that grows around a host tree and eventually replaces it.

Black and white photo of a large strangler fig tree with roots wrapped around a host trunk, Bunya Mountains, 1913
A strangler fig in the Bunya Mountains, Queensland, 1913: the tree that gave the pattern its name. Photo: State Library of Queensland, public domain, via Wikimedia Commons.
Strangler fig pattern in three steps: all traffic to the monolith, then payments extracted as a service, then most capabilities extracted around a small core
The strangler fig pattern in three steps (simplified).

The order matters: modularise first, then extract the module that hurts most, then learn from it before extracting the next.

What real companies learned

Public case studies are useful precisely because they point in both directions.

CompanyDirectionWhat happenedLesson
NetflixMonolith to microservicesAfter a database corruption in August 2008 stopped DVD shipping for three days, Netflix spent seven years moving from one monolithic application in its own data centres to hundreds of microservices on AWS, finishing in January 2016.Microservices pay off at very large scale with a strong platform, and the migration takes years, not sprints.
SegmentMicroservices to monolithIn 2018 Segment merged more than 140 per-destination services into one service. Shared libraries had drifted apart across repositories and operational load grew with every new destination. After the merge one engineer could deploy in minutes.Many tiny services doing similar work can cost more than they isolate. Fault isolation got harder; they accepted that.
ShopifyMonolith to modular monolithInstead of splitting one of the largest Ruby on Rails codebases into services, Shopify reorganised it by business domain from 2017, with public APIs per component and tooling that measures boundary violations.You can get most of the clarity of services without the network, if the boundaries are enforced.
Prime VideoDistributed to single processIn 2023 a Prime Video team described moving its video quality monitoring from serverless components orchestrated by Step Functions into a single process on ECS, reducing infrastructure cost by 90 %.This was one workload, not all of Prime Video. Workloads that move a lot of data between steps can be much cheaper in one process.

Note what none of these teams did: none of them chose an architecture because it was fashionable. Each one moved in response to a specific, measured pain.

What I take away

  • Start with a modular monolith. It is the cheapest architecture that keeps your options open. Enforce module boundaries with tooling from day one.
  • Split for a reason you can name. “Team A is blocked by team B’s releases every week” is a reason. “Microservices are best practice” is not.
  • Microservices are an organisational decision first. If you have one team, you probably do not need them; if you have twenty, you probably do.
  • Never share a database between services. That is the shortest road to a distributed monolith.
  • Budget for the platform. CI/CD, observability, tracing and on-call are not extras; they are the entry ticket.
  • Architecture can move in both directions. Merging services back is not a failure. It is the same engineering judgement applied to new evidence.

Sources

Cover photo by CHUTTERSNAP on Unsplash. Other photos from Wikimedia Commons under the licences named in their captions.