Scrivio Interview library
DesignAdvanced6 min read · updated 12 November 2026

Your SaaS platform has grown to 20,000 tenants in one region, and incidents affect all tenants at once. Design a cell-based architecture to limit blast radius.

A cell is an independent copy of the application stack, its services, databases and queues, that serves a fixed subset of tenants, so a failure in one cell affects only those tenants. A thin routing layer maps each tenant to its cell using a tenant directory cached at the edge or gateway, and changes are deployed cell by cell, starting with an internal or low-risk cell. We build tooling to move tenants between cells, keep truly global services such as identity, the tenant directory and billing small and off the cells' critical path where possible, and size cells by tested capacity, adding new cells instead of growing existing ones without limit.

Why this question is asked

When one regional deployment serves all 20,000 tenants, every incident is an all-tenant incident: a bad release, a database failover, a runaway query from one customer. Adding more instances does not help, because the problem is that everything is shared. A cell-based architecture changes the unit of failure. Interviewers ask this to see whether we understand what to put in a cell, what must stay global, and the tooling that makes cells practical. In this answer, we will define a cell and its blast radius, route tenants to cells, deploy progressively, move tenants between cells, keep global services small, and size cells.

1What a Cell Is and Why It Limits Blast Radius

A cell is a complete, independent copy of the application: its own service instances, its own databases, caches and queues, deployed from the same code. Each tenant belongs to exactly one cell, and a cell never calls into another cell. Blast radius is the share of customers affected when something goes wrong.

If we split 20,000 tenants into 20 cells of about 1,000 each, a database failure, a poison message in a queue, or a bad deploy in one cell affects 5 percent of tenants instead of all of them. It also caps the damage a single tenant can do: a customer that triggers a pathological query can only hurt its own cell. The cost is more infrastructure to run, which is why automation is not optional with cells.

Step throughCell-based platform
  1. Edge or gateway routertenant -> cell from cached directory
  2. Global servicesidentity, tenant directory, billing: small and replicated
  3. Cell 1 ... Cell 20services, databases, caches, queues per cell
  4. Shared toolingdeployment pipeline, observability, tenant mover

4 layers, from the top down. Step through them one at a time.

Cells never call each other; global services stay off the request path where possible.

2Routing Tenants to Their Cell

Requests need to reach the right cell, so a thin routing layer sits at the edge or gateway. It extracts the tenant, from a subdomain such as acme.app.example.com or from the token, looks up the tenant's cell in the tenant directory, and forwards the request. The directory is small, 20,000 entries, so each router keeps the whole thing in memory and refreshes it on changes.

The router must be thin because it is shared by all cells: it does no business logic, has no database of its own on the request path, and keeps working from its cached copy if the directory service is unavailable. A router bug is the one thing that can affect everyone, so it changes rarely and is deployed with extra care.

3Deploying Cell by Cell

Cells make progressive delivery natural. A release goes first to an internal cell that serves our own company and test tenants, then to a low-risk cell, then to a few percent of cells, then to the rest, with a bake time between waves during which automated checks compare error rates and latency against the previous version. If a check fails, the pipeline stops and rolls back the affected cells.

Database migrations follow the same waves, which is another reason to keep them backward-compatible. A bad migration now hurts one cell for an hour instead of every tenant.

A release in waves
WaveCellsShare of tenantsBake time
0internal cellstaff and test tenants2 hours
1one low-risk cellabout 5 percent4 hours
2three cellsabout 15 percent12 hours
3remaining cellsthe restrolling

4Moving Tenants Between Cells

Tenants grow, cells fill up, and sometimes one large tenant should get a cell of its own. So we need a reliable tenant mover. It copies the tenant's data from the source cell to the target cell, keeps it in sync with change data capture while the tenant keeps working, pauses the tenant's writes for a short moment, switches the directory entry so the routers send traffic to the new cell, verifies row counts and checksums, and finally deletes the data from the old cell after a safety period.

Step throughMoving a tenant to another cell
  1. Copy tenant data to target celldatabases, files, search indices
  2. Sync changes with CDCuntil lag is a few seconds
  3. Pause writes for the tenantusually under a minute
  4. Switch directory entryrouters pick it up within seconds
  5. Verify counts and checksumsper table
  6. Clean up the source cellafter a safety period

6 steps in order. Play them, or step through them one at a time.

Because the mover is used for rebalancing as well as for large tenants, it must be routine, tested weekly, not a heroic manual procedure. A tenant whose data is in more than one place, such as files in object storage or messages in flight, needs every piece to move; the mover's checklist is built from the cell's list of data stores.

5Keeping Global Services Small and Off the Critical Path

Some things cannot live in a cell. Identity must know every user, the tenant directory must know every tenant, and billing needs a view across all customers. These global services are shared by all cells, so if they fail, everyone fails, which is exactly what cells are meant to prevent.

So we keep them small, simple and highly available, replicated across zones, and we keep them off the request path wherever possible. Cells validate tokens with cached signing keys instead of calling identity on every request. Routers use their cached directory. Billing receives usage events from cells asynchronously, so a billing outage delays invoices but never blocks a customer's work.

6Sizing Cells by Tested Capacity

A cell has a maximum size, and that size comes from load tests, not hope. We test how many tenants and how much traffic one cell handles while staying within its latency targets, for example 1,000 typical tenants or 5,000 requests per second, and set the limit below that.

When cells approach the limit, we add a new cell and place new tenants there, rather than scaling existing cells without limit. Growing a cell forever slowly turns it back into the monolithic deployment we started with, with a growing blast radius and untested scale. Every cell stays within the size we have actually tested.

7Follow-up questions

How do you choose the size of a cell?

Balance blast radius against overhead. Smaller cells limit damage but multiply fixed costs and the number of deployments; larger cells are cheaper but affect more tenants. Many teams start with cells of a few percent of tenants each and adjust from incident data and cost.

What happens to cross-tenant features, like reports across all tenants?

They read from data exported by each cell into a central analytics store, asynchronously. Nothing in the request path of a cell depends on data from another cell.

Isn't the router a single point of failure?

It is shared, so we make it as simple and redundant as possible, run many instances across zones, keep the directory cached locally, and change it rarely. It is much smaller and simpler than the application stack whose failures it now contains.

8Conclusion

In this answer, we defined a cell as an independent copy of the stack serving a fixed set of tenants, which cuts the blast radius of any failure to that cell. We routed tenants with a thin router and a cached tenant directory, deployed releases cell by cell starting with an internal cell, built a tenant mover for rebalancing and large tenants, kept identity, the directory and billing small and off the request path, and sized cells by tested capacity, adding cells rather than growing them.

What to say in the interviewAbout 80 seconds aloud

Open with

I would split the platform into cells, each a full independent copy of the stack with its own services, databases, caches and queues, serving a fixed set of tenants, for example 20 cells of about a thousand.

Then, if they want more

A database failure, a bad deploy or one tenant's runaway workload then affects about 5 percent of tenants instead of all of them. In front, a thin router at the gateway maps each tenant to its cell from a tenant directory that it caches entirely in memory, so it keeps working if the directory service is down.

Releases go cell by cell: an internal cell first, then a low-risk cell, then more, with bake times and automatic rollback on error-rate checks. I would build a tenant mover early, copy data, sync with CDC, short write pause, switch the directory, verify, because we need it for rebalancing and for giving large tenants their own cell.

Global services like identity, the directory and billing stay small and replicated, and I would keep them off the request path with cached signing keys and asynchronous usage events. Finally, each cell has a maximum size from load tests, and when cells fill up we add new ones rather than growing them.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Your SaaS platform has grown to 20,000 tenants in one region, and incidents affect all...": https://scrivio-interview-library.netlify.app/architecture/backend-system-design/7fe1c34f04/