Go to content
Web development

When to Split a Monolith Into Services

You run an application that started as one code base and one deployment unit, what developers call a monolith. The code compiles, the tests pass, and customers use it. As the application grows, a feature in one area slows the release of everything else, a traffic spike in one function forces you to scale the whole system, and two groups of developers keep editing the same files. At that point someone proposes splitting the monolith into services, independently deployable pieces of software that communicate over a network.

The decision is not about which architecture is better. A monolith is the right shape for many products, and a service-based architecture is a heavy tool that pays off only under specific conditions. If you split early, you trade a simple deployment model for distributed-system complexity before you have the traffic, team, or operational tooling to benefit from it. To make the call, you need to look at scaling, deployment, team ownership, data boundaries, and operational complexity, plus the warning signs that a split is premature.

Here is the short answer: split when a specific pain has a specific payoff you can name, and when your team and tooling can absorb the operational cost. Use the decision checklist at the end to run these questions against your own product.

What a monolith costs you as it grows

A monolith is a single code base that performs many business functions, with components that depend on one another through the data exchange mechanisms inside the system. A small change can touch many parts of the code. Two costs push teams toward splitting: scaling and release risk.

Scaling. When traffic surges in one functional area, say the notification code during a marketing campaign, you scale the whole monolith because you cannot scale just the notification code. You waste resources because the rest of the application is not at peak capacity. An e-commerce flash sale drives traffic to checkout and inventory, but the monolith also runs the admin panel, reporting, and the CMS, so you provision servers for all of them to serve one hot path.

Release risk. A minor error anywhere in the code base can fail the entire application and take every active user down with it. Deployment itself is simple: you install the whole code base and its dependencies into one environment, and that simplicity is the asset you give up when you split.

The monolith’s costs are concrete and visible: you wait longer for each release, you scale the whole app, and an outage can take everything down. The service-based alternative’s costs are mostly invisible until you operate it, so the split needs a named purpose.

The four reasons a split pays for itself

Red Hat’s guidance for breaking down monoliths is direct: you must do the transformation for a purpose, and the result will probably be more complex to administer, so the benefits have to show up at the end (Red Hat). They propose four triggers for a split (Red Hat).

Scalability. Split when two parts have a reason to scale independently. If the search function needs far more capacity than the rest of the app, you have to scale the whole monolith to serve it, and you end up wasting money on everything else, the search component is a candidate.

Release speed. Split when one piece is updated more often than the rest, creating friction, or when a business function needs faster time-to-market. If a pricing service changes daily while the rest of the app changes monthly, you can deploy pricing on its own and ship a price change without running the full regression suite.

Failure isolation. Split when one component is more subject to errors than the rest. But isolation does not come from the split alone. You have to add circuit breakers (a mechanism that stops calls to a failing service and returns a fallback), alternative flows, asynchronous callbacks, and fail-fast behavior, where a service rejects a request immediately when its dependency is down instead of waiting for a timeout. Without those mechanisms, five tightly coupled services will still fail altogether as one piece.

Component specialization. Split so a specific function can use a more appropriate programming language or technology stack. Image processing in a compiled language, or a recommendation engine built on a specialized library, can justify a service boundary when the rest of the app gains nothing from that stack.

The test for every trigger: name the measurable outcome. The split should let one part scale without the other, ship faster, fail without taking everything down, or use a better tool. If you cannot name which of those you are buying, you are just adding network calls.

Team ownership and Conway’s Law

Conway’s Law, formulated by Melvin Conway in 1968 and popularized by Fred Brooks in The Mythical Man-Month, says that any organization that designs a system will produce a design whose structure copies the organization’s communication structure (Conway’s Law). In plain terms, the boundaries in your code tend to match the boundaries between the people who write it.

For a small group, that tendency favors the monolith. A dozen or two people can have deep and informal communication, so they naturally produce a monolith, and that is fine at that size. Conway’s Law matters when you need to organize the people. If two teams both need to change the checkout flow to ship their features, they either coordinate constantly or step on each other, and the code will show that friction.

The Inverse Conway Maneuver turns this around: you deliberately change the development organization to encourage the desired software architecture. In practice this means forming teams around business capabilities, each able to own a service end to end, rather than teams split by technical layer, one team for all UI and another for all APIs. Microservices are an organizational tool as much as a technical one: if you split the code but keep the layers of teams, every service still needs coordination across several groups, and you get distributed development overhead without ownership benefits.

One caution: for an existing system with a rigid architecture, you cannot fix the architecture by reorganizing people overnight; you are more likely to create a mismatch between developers and code that adds friction (Conway’s Law). The way you divide the code into modules and the way you divide the team must happen together, and both need to keep evolving.

Team size gives a rough sense of when this matters. Better Engineers finds a monolith efficient with 5-7 developers, and microservices start paying when multiple independent teams of 10+ developers need to work on different parts of the system simultaneously. Treat the numbers as approximations: they mark where informal communication breaks down and ownership boundaries start to matter.

Data boundaries decide whether the split is real

The most common way to build a fake service architecture is to split the code but keep one shared database. When services share a database, they couple hard: a change to a table field can break everything, because the other services are not equipped to handle the change and nobody knows the links exist. This is the distributed monolith, which brings the complexity of microservices together with the fragility of a monolith. You get network calls, separate deployments, and distributed debugging, while the data layer still couples every change to every service.

The pragmatic starting point for most teams is a monolithic database with a logical partition: one database, but each service owns its own schema or tables, and other services reach that data only through the owning service’s API. Clear boundaries around which services can access which tables are the key.

Transactional integrity governs the decision to move to separate databases per service, possibly with different database technologies (polyglot persistence). If most of your transactions need strict ACID guarantees (atomicity, consistency, isolation, durability, the properties that make a database transaction safe), a shared relational database is usually the right call, because distributed transactions across services are slow, brittle, and prone to deadlock. If eventual consistency, where a write becomes visible to other services after a delay rather than immediately, is acceptable, you can manage it with the Saga pattern, a sequence of local transactions across services with compensating actions on failure, plus an event-driven architecture.

Location of the bottleneck matters too. If the database is doing the heavy lifting, with database I/O or query complexity as the constraint, separate databases can help. If the bottleneck is CPU or memory in the application layer, separate databases add cost without addressing the problem. Developers.dev’s internal review of 100+ microservices projects puts the crossover where polyglot persistence becomes cost-effective at roughly 50,000 concurrent users or 10 distinct service domains; below that, the monolithic approach wins on simplicity. Treat that as one firm’s data, not a universal rule.

Developers.dev’s data persistence checklist scores five criteria: data consistency requirements, service count, performance bottleneck location, team expertise, and future-proofing. A score of 4 or more points in the polyglot column strongly indicates that the operational complexity is a necessary trade-off. Team expertise is often the deciding factor: polyglot persistence means running several database technologies, each with its own backup, security, and operational tooling. Without governance, you get an accidental polyglot, no standardized operational tooling and inconsistent security and backup policies, which is a governance failure, not a technology failure.

Operational complexity is the price you pay

Before you have multiple services, you need the plumbing that makes them manageable: CI/CD pipelines (automated build, test, and deploy), containerization (packaging each service with its dependencies), orchestration such as Kubernetes (running and restarting those containers), service discovery (so services can find each other’s network addresses), and an API gateway (a single entry point that routes requests to the right service). You also need monitoring, logging, and observability, the ability to understand a distributed system’s behavior from its outputs. CircleCI’s migration guidance is blunt: these components should be in place before you have multiple services to manage. If they are not, the first service you extract will consume your time on infrastructure instead of features.

Microservices do not save resources. Five services each run their own server and operating system, and the duplicated stack can consume more total memory and CPU than the single monolith did. The resource-savings claim usually ignores this duplication.

A split isolates failures only if you build isolation with circuit breakers, alternative flows, asynchrony, and loose coupling. Faults in distributed applications are more difficult to solve because you have to look across multiple loosely coupled services, and you need coordinated tests, discussions, and feedback among the people involved (Octopus). A monolith’s bug lives in one process; a service’s bug may live in any of a dozen processes, plus the network between them.

Technology freedom cuts both ways. Microservices let each service use the stack that fits it, but every stack behaves differently in production, and your monitoring and alerting have to cope with each one, which raises the chance of failure (Devonblog). The team also has to stay proficient in multiple languages, frameworks, and databases. If your team is strong in one stack, a uniform monolith uses their strengths, while a multi-stack architecture demands cloud architecture, API design, containerization, and other skills the team may not have.

Signs that splitting too early will hurt more than help

A premature split costs more than extra work. If you split the code while keeping the shared data layer and synchronous dependencies, you get the distributed monolith described above: you pay for network calls, service discovery, and distributed debugging, while the system stays just as fragile as before. If your split would produce that outcome, hold off.

The project is small. For a prototype or a product with limited functionality and a single development team, a monolith lets you build faster at the start and keeps the parts tightly integrated (Octopus). At that size, you will not get back the design effort and infrastructure cost that multiple services require.

The pain is code organization; deployment and scale are not the source. If the problem is tangled, hard-to-navigate code, services will not fix it; you will just have several tangled code bases connected by network calls. A modular monolith, one code base with strict internal module boundaries, fixes organization problems without the costs of a distributed system. Many successful companies start with a monolith and gradually break it down as specific needs arise, often through the modular monolith or strangler fig path. In the strangler fig pattern, an interception layer such as an API gateway routes each request to the monolith or to a new service based on configurable rules, so you migrate one route at a time (CircleCI).

You do not have the operational foundations. Without CI/CD, monitoring, and containerization in place, every service you add increases the chance of an outage you cannot diagnose.

The team cannot own the services. If you split the code but the organization still communicates as one big group, or if teams stay organized by technical layer, Conway’s Law predicts the services will develop tangled dependencies. You have to change the organization and the code together.

You have not named the outcome. Microservices are not an end goal. They are a means to specific business objectives like improved delivery speed, better scalability, or enhanced resilience. If you cannot state which objective a split serves and how you will measure it, you are not ready.

Do not expect the split to reduce complexity. Microservices do not reduce the complexity of an application; they reveal underlying complexities and let you build, manage, and scale a large application more efficiently. The complexity you ignored inside one process reappears as network failures, retries, partial failures, and data consistency problems.

A decision checklist for founders and engineers

Work through these questions before you draw service boundaries. If you answer yes to most of them, you have a reason to split. If you answer yes to only one or none, keep the monolith and revisit after the next growth spurt.

Scaling

  • Does one functional area consume a disproportionate share of traffic or resources, forcing you to scale the whole monolith for it?
  • Could two parts of the system scale independently with different capacity plans?

Deployment

  • Does a small fix require a full regression test and a release so risky that you ship only weekly or bi-weekly?
  • Does one component change much more often than the rest, and does that frequency slow everyone down?
  • Could the extracted service deploy independently several times a day?

Failure

  • Does one error-prone component take down the whole application for all users?
  • Are you prepared to build circuit breakers, alternative flows, asynchronous callbacks, and fail-fast behavior? Those are what make the isolation real.

Team

  • Do multiple teams of roughly 10+ developers collide on the same code while working on different features?
  • Can each team own a service end to end, including its data, API, and deployment, without coordinating through a central group?

Data

  • Can you give each service ownership of its own schema or tables, with other services reaching that data only through an API?
  • Do most transactions need strict ACID guarantees across the proposed service boundary? If yes, you need a shared database or a different boundary.

Operations

  • Are CI/CD, containerization, orchestration, service discovery, an API gateway, monitoring, logging, and observability already in place?
  • Does at least one person on the team know how to debug a failure that spans multiple services and a network?

After you split, measure progress against the objectives you named, not against the number of services extracted. If delivery speed, scalability, or resilience has not improved, the split is not working, no matter how clean the architecture diagram looks.

More in Web development Back to top ↑