Our monolith slows every release
At a glance
Section titled “At a glance”| Aspect | Aspect |
|---|---|
| Typical organization | A product company or internal IT team that has grown from a few developers to several teams on one codebase |
| Symptoms | Slow, risky releases; changes in one area break another; long onboarding |
| Root cause | No enforced boundaries inside the codebase, so everything depends on everything |
| Usual fix | Modularize first; extract services only where a module needs to scale or release independently |
| Patterns | Modular monolith, microservices, strangler fig |
Sound familiar?
Section titled “Sound familiar?”- Releases happen every few weeks, need a coordination meeting, and are often rolled back.
- A change to pricing breaks invoicing, and nobody saw it coming.
- The test suite takes an hour and fails at random.
- New developers take months before they can change anything safely.
- Teams queue behind each other to deploy.
Why it happens
Section titled “Why it happens”The application started small, when one team could hold it all in their heads. As teams were added, nothing stopped code in one area from calling into, or reading the data of, any other area. The problem is usually missing boundaries, not the fact that it’s one deployable. Splitting it into services without fixing the boundaries just gives you a distributed monolith: the same coupling, plus network calls.
Your options
Section titled “Your options”| Option | When it fits | Cost and risk |
|---|---|---|
| Fix the release process only (better tests, CI/CD, feature flags) | Boundaries are mostly fine; the pain is in the pipeline | Low. Often the quickest win, and needed anyway |
| Modular monolith: enforce boundaries inside one deployable | Most teams on one product; pain comes from coupling | Medium. Needs tooling to keep boundaries honest |
| Extract services for parts that must scale or release on their own | A few areas with very different load, release pace or ownership | Medium to high. Adds network, data and operational complexity |
| Full rewrite | Almost never | Very high. Years without new value, and the old system keeps changing |
A proven approach
Section titled “A proven approach”- Measure first. Track lead time from commit to production, deployment frequency, change failure rate and time to restore. They show whether each step helps.
- Map the domains. Group the code by business capability, such as orders, billing and catalog, not by technical layer.
- Create modules with public interfaces, and give each module sole ownership of its tables.
- Enforce the boundaries automatically, with architecture tests or a dependency checker in the build.
- Extract a service only where it pays: a module with a different scaling profile, release pace or owning team. Route traffic to it gradually, comparing results with the old path.
- Requests still enter through one application.
- Modules call each other only through public interfaces, checked in the build.
- Each module owns its own schema; no module reads another's tables.
- Only a module with different needs, here search, becomes a separate service.
Trade-offs and what to watch
Section titled “Trade-offs and what to watch”- Boundaries erode without enforcement. In one codebase it is always easy to reach into another module.
- A modular monolith still deploys as one unit, so one module can’t be scaled or released on its own.
- Every extracted service adds operations work: monitoring, on-call, versioned APIs and data consistency across a network.
How you’ll know it worked
Section titled “How you’ll know it worked”Lead time and change failure rate fall, releases stop needing coordination meetings, and a change in one module rarely breaks tests in another.
Seen in the real world
Section titled “Seen in the real world”- Shopify kept one deployment and built tooling to enforce boundaries between components.
- Airbnb extracted services gradually, comparing each against the monolith on live traffic.
- Segment went the other way, merging 140 services back into one.
Related on ArchitectureCompass
Section titled “Related on ArchitectureCompass”Written and edited by Abhinav Taduka, enterprise software architect.
New pages are added regularly. Follow Abhinav on LinkedIn to see them first.