Stage 6 · Architecture at scale · Hard · 15 min
Architecture evolution and service boundaries
A system starts as one app with clear modules. Learn when to split a part out, how to move it one route at a time, and what each split costs.
What each interview level is expected to know
Learn first: Reverse proxies and API gateways, Event-driven fan-out: push vs pull, CI/CD and safe deployments
After this lesson you can:
- Start with a modular monolith, and spot a real boundary to split on.
- Move a part out one route at a time with the strangler fig.
- Spot a distributed monolith and a boundary in the wrong place.
Start here
See it in 60 seconds
When to split a part out
Start with one app and one database, and move a part into its own service only when a clear need, such as separate scaling, appears.
Scene 1 of 7 · One app, one database
A young product is one app and one database: quick to change, test and release.
- Users — healthy
- The app — healthy — orders, payments, search
- Main database — healthy
- One app, one database. A young product is one app and one database: quick to change, test and release.
- Teams start to collide. As the team grows, everyone releases the same app, so one slow change holds up all the others.
- One part outgrows it. Search now needs far more servers than the rest, and when it crashes, the whole app goes down.
- Move it out. So search moves into its own service, with its own data and its own servers.
- A routing layer in front. A routing layer in front sends each route, a path like /search, to the old app or the new service.
- One route at a time. Move one route at a time, such as /search, keeping the old code as a fallback until done.
- Split only for a reason. Every split adds network calls and one more thing to run, so split only when a clear signal says so.
- Now you try. Tap every signal that is true for search; a simple count of reasons for and against suggests split or keep. For example, tapping "Its team waits on others to release" and "It needs 10 times the servers of the rest" gives this: Split search out: its team needs its own releases and it needs its own scaling. Each reason is about running search apart from the rest, which is what a service gives.
Scene 1 of 7: One app, one database. A young product is one app and one database: quick to change, test and release.
Key points
- One app with clear modules and one database is the fastest way to start.
- Split a part out when it needs its own releases, scaling or failure limits.
- A split-out service owns its data; others reach it only through its API or events.
- Move one route at a time, and keep the old path as a fallback until done.
In plain words
Say a shop starts as one app with one database. The app holds orders, payments and search. Five developers can change, test and release it in one go. Later the team has grown, and everyone waits on the same release. Search now uses 10 times as many servers as everything else, and a crash in search takes orders and payments down too. The team then gives search a service of its own, which holds its own data. Architecture evolution is this habit: start with the simplest design, and change it only when a clear need appears. One app that holds everything is called a monolith. A system split into many small services is called (A small service that owns one job and its own data, such as payments, and talks to other services over the network.).
The split happens one job at a time. The new search service takes over search while the old code still runs as a (A simpler answer sent instead of the real one, used when a call is skipped or fails.), until the move is proven safe. Draw the lines by who owns each part and its data. Splitting too early creates services that still deploy together and share a database. That adds the costs of separate services, and no team can release alone.
The problem it solves
One app shared by many teams slows everyone: each change waits for the same release, and one bad part can crash the rest. Splitting too early is the opposite mistake. You get a distributed monolith: services that share a database, call each other on every request, and must be released together. Then you pay for the network calls and the extra failures, and no service can change alone.
Why it matters
A design that suits five developers and a hundred users is wrong for fifty teams and ten million users. The reverse is also true. So a good design is a path: where to start, and what would make you change it. Splitting a system into services too early is a costly mistake, because every split adds parts that can fail.
A worked example
Say a monolith handles 1,000 requests per second, and the team migrates one route at a time instead of rewriting everything at once. Moving the /search route, worth 50 of those requests per second, means only 50 ÷ 1,000 = 5% of traffic touches new code at first. A failed migration then risks 5% of traffic, not the full 100%.
Think of it like…
Think of a small tailor shop where one tailor cuts, sews and alters. As orders grow, one job at a time moves to its own station. The first tailor still helps until the new station runs well alone.
Where this analogy stops working
Splitting one job at a time, with the old way as a fallback, is the useful part. But stations in one room hand work over by hand. Services hand it over a network, which is slower and can fail. Each new service also needs its own data, its own releases and someone on call.
Try it
See it working
- Users — healthy
- One server — app + database — healthy
- Request/response
- Why this step
- Nothing yet — start simple. One machine runs the app and the database.
- What it costs
- Any crash or deploy is downtime, and the app and database compete for CPU and memory.
- Numbers to watch
- CPU and memory of the one box; time to restore from backup.
In an interview, name the trigger — a QPS, data size or latency target from your estimates — before adding a component. Jumping straight to stage 7 without numbers reads as pattern-matching.
Also try: Scaling from 1 server to millions of users · Multi-region & disaster recovery
Mechanics
How it works
The diagram above shows the whole journey. The small pictures beside three steps each follow one change: moving the /search route, a release with a bug, and one busy customer.
Start with a modular monolith
Build one app that is deployed as one unit, with one database. Inside it, keep clear modules, such as orders, payments and search, that call each other through agreed functions. This is called a modular monolith. It is fast to build and simple to run, and clear modules make a later split easier.
Split on a real boundary
Move a part out when it needs its own releases, its own scaling or its own failure limits. In the diagram above, search needs all three. The new service owns its data: the search (An extra structure, kept sorted or grouped, that lets a database find matching items without reading all of them.). Other parts reach that data through the service's API or its events, not by reading its tables.
Migrate with the strangler fig
Pick a case to follow belowWith this case: The router sent /search to the new service and every other route to the monolith.
Users, all routes Users all routes Routing layer, route by path, NOW Routing layer route by path /search → new NOW Monolith, old code Monolith old code Search service, new code Search service new code - Users — all routes — healthy
- Routing layer — route by path — healthy — NOW — /search → new
- Monolith — old code — healthy
- Search service — new code — healthy
- Request or release
Step 1 of 3Step 1 of 3 · Routing layer
Done: A search request reaches the routing layer
- What happens
- The router looks at the path: /search.
- Why
- The routing layer decides, one route at a time, which code answers.
- What changes
- /search is the one route that has moved to the new service.
- Next
- The new search service answers
Routes moved to new code1 of 3/search only/search answered by–Step 1 of 3: Routing layer. A search request reaches the routing layer. The router looks at the path: /search.
Do not rewrite the system in one go. Put a routing layer in front, and send one route, such as /search, to the new service. The old code stays as a fallback until the new path has proved itself. Then move the next route. The name comes from a fig that grows around a tree and, over years, takes its place.
In the picture, the routing layer sends /search to the new search service, and /orders and /checkout to the monolith. When the new service fails, the (In a move to new services: the part in front of the app that sends each request path, such as /search, to the code that handles it.) sends /search back to the old code, and users still get results.
Agree contracts
Once services are apart, each team changes its own on its own schedule. So the API and the events between them become a contract. Give each contract a version, and add fields without removing old ones. Before a breaking change, tell the callers and keep the old version running for a set time.
Contain the blast radius with cells
Pick a case to follow belowWith this case: In one shared system, the bad release reached all 50,000 customers.
Release, version 2 Release version 2 Customers, 50,000 Customers 50,000 The whole system, one copy, NOW The whole system one copy version 2 NOW - Release — version 2 — healthy
- Customers — 50,000 — healthy
- The whole system — one copy — healthy — NOW — version 2
- Request or release
- Error
Step 1 of 2Step 1 of 2 · The whole system
Watch: Version 2 goes out with a bug in checkout
- What happens
- The whole system gets the new version at once.
- Why
- There is one copy of the system, so a release has nowhere smaller to start.
- What changes
- Every customer now runs version 2.
- Next
- All 50,000 customers hit the bug
Customers who hit the bug0none yetStep 1 of 2: The whole system. Version 2 goes out with a bug in checkout. The whole system gets the new version at once.
The share of users one failure can reach is called its blast radius. A very large system can shrink it by running many identical copies, called cells. Each cell has its own servers and data, and a router sends each customer to one cell. A bad deploy or an overload then hits one cell: with 10 equal cells, about a tenth of the customers.
In the picture, 50,000 customers are spread over 10 cells. A release with a bug goes to cell 1 first, so 5,000 customers hit it. In one shared system, all 50,000 would.
One system for many customers
Pick a case to follow belowWith this case: With no limit, the database was asked for 1,200 queries a second, more than its 1,000, and every tenant slowed down.
Tenant 7, runs a report Tenant 7 runs a report Other tenants, 999 small Other tenants 999 small The door, limit per tenant, NOW The door limit per tenant no limit NOW Shared database, 1,000 a second Shared database 1,000 a second - Tenant 7 — runs a report — healthy
- Other tenants — 999 small — healthy
- The door — limit per tenant — healthy — NOW — no limit
- Shared database — 1,000 a second — healthy
- Request or release
Step 1 of 2Step 1 of 2 · The door
Done: Tenant 7 starts a huge report
- What happens
- The report sends 900 queries a second.
- Why
- Nothing at the door limits one tenant.
- What changes
- All of them go on to the database.
- Next
- The database gets 1,200 queries a second
Queries a second at the database–Other tenants' pages–Step 1 of 2: The door. Tenant 7 starts a huge report. The report sends 900 queries a second.
What these pictures simplify. These pictures use stated numbers: 50,000 customers in 10 equal cells, and a database that does 1,000 queries a second. Real cells are rarely exactly equal, and real database limits depend on the queries.
Many products serve many customers from one app and one database. Each customer is called a (One customer of a system that many customers share.), and the design is called (Serving many customers from one shared app and database, with each customer's data kept apart.). It is cheap, because 1,000 small customers share the same servers. The risk is a (One customer on a shared system whose heavy load slows the other customers down.): one customer runs a huge report and uses the database that all the others need. A limit for each tenant, set at the door, keeps one customer from slowing the rest.
In the picture, a shared database does 1,000 queries a second. Tenant 7's report sends 900, and the other 999 tenants need 300. So the database is asked for 1,200 queries a second, and everyone slows down. With a limit of 100 a second per tenant, it gets 400. The report takes about 9 times as long, and nobody else notices.
Use it when
- Showing how a design grows: start with one app, then name the number or the team problem that forces each change.
- A part with a clear reason to stand alone: its own team, 10 times the load of the rest, or crashes that must not spread.
- Replacing an old system that must keep running: move one route at a time behind a routing layer.
- A very large system where one failure must not reach every customer: cells keep it to one share of them.
Skip it when
- A small product with one team: one app is faster to build and cheaper to run.
- A young product whose boundaries still change: a line between modules is cheap to move, and a line between services is not.
- A part that shares most of its tables with others: split the data first, or you get a distributed monolith.
- No team, scaling or failure reason: a split made only because others do it adds cost and gives nothing back.
Check yourself
Also
More in 60 seconds
One busy customer on a shared system
Many customers share one app and one database, so one customer's heavy load can slow all the others unless each has a limit.
Scene 1 of 6 · Many customers, one system
Three customers share one app and one database, and each customer is called a tenant.
- Customer A — healthy — 20 a second
- Customer B — healthy — 20 a second
- Customer C — healthy — 20 a second
- Shared app — healthy — serves 3 tenants
- Shared database — healthy — can answer 100 a second
- Queries a second let through to the database
- 60
- Customer B: queries with no answer, each second
- not shown yet
- Customer A: queries refused by its limit, each second
- not shown yet
- Many customers, one system. Three customers share one app and one database, and each customer is called a tenant.
- A normal day. Each sends 20 queries a second, and the database can answer 100, so everyone is served.
- One customer gets busy. Customer A runs a huge report and sends 200 queries a second, but the database answers only 100.
- The others lose out. The database shares its 100 by who sent most, so customers B and C get 8 of their 20.
- A limit for each. A limit of 40 a second each lets only 80 through, so B and C are served in full.
- Only A pays. The 160 queries refused each second are all customer A's own, and B and C lose nothing.
- Now you try. Customer A sends 200 queries a second, and B and C send 20 each. Set the limit for each customer. For example: With a limit of 40 each, customer A gets 40 of its 200 answered, and customer B gets 20 of its 20. The limit lets 80 a second through, and the database can answer 100, so nobody waits behind customer A.
Scene 1 of 6: Many customers, one system. Three customers share one app and one database, and each customer is called a tenant.
Key points
- A tenant is one customer of a system that many customers share.
- Sharing is cheap, but one busy tenant, a noisy neighbour, can use what the others need.
- A limit for each tenant refuses the extra load at the door.
- Set the limit too high and the others still lose some; too low and it hurts everyone.
Judgement
Trade-offs and how it fails
What you give up
- Autonomy
- A team with its own service releases when it is ready and scales its part alone. It no longer waits on the shared release.
- Complexity
- Each split turns a function call into a network call, which is slower and can fail. Data that sat in one database now sits in two, so a change across both needs a saga or an outbox. There is also one more thing to deploy, watch and be on call for.
- Failure
- A crash in a separate service stays there only if its callers set a (The time a caller waits before giving up on a call and treating it as failed.) and have a fallback. Without them, a slow service makes its callers slow too.
Failure modes
- Distributed monolith: the services share a database or call each other in long chains. One change then needs several teams to release together.
- Big-bang rewrite: the team builds a full replacement for months, then switches everything at once. A fault found at the switch hits every user.
- A boundary in the wrong place: one page now needs dozens of calls between two services. Merge them, or move the line.
- The old path is not removed: both versions run for years, and each change has to be made twice.
- Noisy neighbour: one customer's heavy load uses the database that all the tenants share. A limit per tenant keeps the harm to that customer.
In the real world
- Shopify's engineering blog (2019) describes keeping its large Ruby on Rails app as one deployed unit. It set strict boundaries between the parts inside, in place of separate services. Source: Shopify engineering: Deconstructing the Monolith (2019) (checked 14 October 2026)
- In a 2006 ACM Queue interview, Werner Vogels describes Amazon's move from one large app to services. Each service keeps its own data, and others reach it only through its interface.
- Martin Fowler named the strangler fig pattern in 2004, after figs he had seen in Queensland that grow around a host tree. Source: Martin Fowler, "StranglerFigApplication" (2004) (checked 14 October 2026)
- Fowler's note "MonolithFirst" (2015) reports what he had seen: almost all the successful microservice stories began as a monolith that grew too big. Source: Martin Fowler, "MonolithFirst" (2015) (checked 14 October 2026)
- An AWS guide on cell-based architecture (2023) gives an example: with 10 cells, one failed cell leaves 90% of requests untouched. Source: AWS guide: What is a cell-based architecture? (checked 14 October 2026)
Trade-offs to be ready to discuss: Monolith vs microservices · Big bang rewrite vs strangler fig
Check yourself
Interview
What interviewers look for
- Tell the design as a path: "Start as one app with clear modules. Split search out when it needs 10 times the servers of the rest."
- For each service you draw, say which team owns it and which data it owns.
- Name the cost of a split: "That is one more network call that can fail, so the caller needs a timeout and a fallback."
- For a migration, say "one route at a time, with the old path as a fallback". For blast radius at very large scale, mention cells.
Say it out loud: What is a distributed monolith, and why is it worse than a monolith?
Expected depth by interview level
Levels describe the depth interviewers probe, not years of experience. Choose a level on the learning path to highlight it.
- JuniorBeyond this level
- Not usually expected.
- MidUseful
- Start simple: monolith vs microservices.
- SeniorExpected
- Splitting on ownership and data boundaries; the strangler fig.
- StaffCore
- Evolution plans, contracts, cells, and what not to build.
Practice
Apply it
Three harder questions
The first two use the idea on a new case. The last asks you to judge a design.
Apply it
Apply it
Judge a design
Go deeper
Sources and further reading
First-hand sources to check this page against and to go further. They are standards, official docs, original papers, and guides from engineering and security teams. Each link was opened on 8 November 2026.
- Engineering guideMonolithFirstMartin FowlerFowler notes that most systems of many services that worked well began as one app that grew too big.
- Engineering guideStranglerFigApplicationMartin FowlerReplacing an old system piece by piece while it keeps running.
- Engineering guideMicroservicesLewis and FowlerWhat makes a service boundary, and the costs that come with many services.