Cell-Based Architecture: Shrinking the Blast Radius of Every Failure


System Design Phase 11: Resilience Engineering
Advanced Lesson 65 of 86 15 min read Updated Nov 30, 2026

A configuration change goes out at 14:05. It contains a regular expression that takes exponential time on one specific kind of input. Within 90 seconds every API server in the region is pinned at 100% CPU, because every server shares the same config, the same database and the same queue. Two million customers are down. The fix takes four minutes to identify and twenty to roll back.

Now run the same afternoon on a different design. The service is split into 20 independent copies, called cells, each with its own servers, database and queue, each serving about 100,000 customers. Config rolls out one cell at a time with a 30 minute bake between waves. The bad regex reaches cell 1, which falls over. Alarms fire, the rollout halts automatically, cell 1 is rolled back. 100,000 customers had a bad 10 minutes. 1.9 million never noticed.

The bug was the same. The blast radius was 20 times smaller. That is what cell-based architecture buys: not fewer failures, but failures that can only reach a bounded fraction of your customers.

What it is

A cell is a complete, independent instance of a service (compute, storage, caches, queues) that serves a fixed subset of the workload, usually a set of customers or tenants. Cells share nothing on the request path. A cell router sits in front and sends each request to the cell that owns its partition key. A control plane creates cells, assigns customers to them and deploys to them, but is not needed to serve a request.

The defining property: any failure that starts inside a cell, whether a bad deploy, a poison request, a hot tenant, a corrupted index or a full disk, stays inside that cell. With N equal cells, a single-cell failure affects 1/N of customers.

Cells vs shards vs regions

These get conflated, so be precise.

Shard Cell Region
What is split one data store the whole stack everything, by geography
Shares with siblings app tier, caches, queues nothing on the request path little, often a global control plane
Protects against data volume and write load bad deploys, poison requests, noisy tenants, local corruption regional disasters, latency to far users
Typical count tens to thousands tens per region a handful

Sharding splits data in one layer, but a shard key bug in the shared app tier still takes every shard down. A cell is a shard of the entire stack. Regions are failure domains defined by geography (covered in multi-region architecture); cells usually live inside a region, and many designs align cells with availability zones or place each cell across zones.

How it works

The router and partition mapping

flowchart TD
U["Client request<br/>(tenant id in token or path)"] --> R["Cell router<br/>(thin, cached mapping)"]
M[("Mapping table<br/>tenant to cell")] -.->|"pushed, cached"| R
R --> C1["Cell 1<br/>API, DB, cache, queue"]
R --> C2["Cell 2<br/>API, DB, cache, queue"]
R --> C3["Cell 3<br/>API, DB, cache, queue"]
R --> CN["Cell N"]
style R fill:#EEEDFE,stroke:#534AB7,color:#3C3489
style M fill:#F1EFE8,stroke:#888780,color:#444441
style C1 fill:#E1F5EE,stroke:#0F6E56,color:#085041
style C2 fill:#FCEBEB,stroke:#A32D2D,color:#791F1F
style C3 fill:#E1F5EE,stroke:#0F6E56,color:#085041
style CN fill:#E1F5EE,stroke:#0F6E56,color:#085041

The router is the one component every request touches, so it is the one place a bug can still hit everyone. Keep it as dumb as possible: extract the partition key, look it up, forward. No business logic, no calls to other services on the request path, and deploy it more carefully than anything else.

Choosing the partition key is the same exercise as choosing a shard key: it must be available on every request (a tenant ID in the auth token, an account ID in the path) and every operation should touch exactly one cell. Cross-cell operations are the enemy of isolation; if a common request needs data from three cells, either the key is wrong or that data belongs in a separate service.

Mapping a key to a cell has three common shapes:

  • Mapping table. An explicit tenant → cell table. Most flexible: you can place a large tenant on a dedicated cell and move any tenant individually. It needs a store and a distribution mechanism, and the router caches the whole table in memory.
  • Hash or consistent hashing. No table, but moving a single tenant is awkward, and adding cells moves tenants you did not choose.
  • Ranges or prefixes, often combined with a table of overrides.

Most production designs use a table, because moving customers between cells is a routine operation, not an exception.

Cell sizing and the maximum size

Each cell has a maximum size: the largest load, data volume and tenant count you have actually tested it at. When a cell approaches it, you stop placing new tenants there and open a new cell. You scale out by adding cells, never by growing one cell past what you have proven, which means every cell runs inside a known-good envelope and a load test on one cell tells you the behaviour of all of them.

The size is a trade-off:

  • Smaller cells give a smaller blast radius and cheaper load tests, but more fixed overhead (each cell has its own database, monitoring and baseline capacity) and more operational surface.
  • Larger cells amortise overhead and absorb big tenants, but each failure hits more customers.
  • Whale tenants do not fit the average. A tenant that alone needs half a cell gets a dedicated cell or is split by a secondary key.

Control plane vs data plane

flowchart LR
subgraph CP["Control plane (can be down for a while)"]
  P["Provision cells"]
  A["Assign and migrate tenants"]
  D["Deploy in waves"]
end
subgraph DP["Data plane (must stay up)"]
  R["Router with cached mapping"]
  C["Cells serving traffic"]
end
A -.->|"async mapping push"| R
D -.->|"new versions"| C
P -.-> C
R --> C
style CP fill:#F1EFE8,stroke:#888780,color:#444441
style DP fill:#E1F5EE,stroke:#0F6E56,color:#085041

The data plane serves requests. The control plane changes the system: creates cells, updates the mapping, deploys code. The control plane is more complex and changes more often, so it fails more often. The rule is that the data plane must keep working, with its last known configuration, when the control plane is down. The router keeps serving from its cached mapping; cells keep serving with the version they have. You lose the ability to change things for a while, not the ability to serve.

Static stability

AWS calls this property static stability: a system that keeps working in a degraded event without needing to make changes, such as launching instances, updating DNS or calling a control plane. The Amazon Builders’ Library article “Static stability using Availability Zones” gives the classic sizing example. A service spread over 3 AZs that needs 100% of capacity to serve peak should run 50% of peak in each AZ (150% total), so that losing an AZ leaves exactly 100% without launching anything during the event. The reasoning: during a large failure, the control planes you would use to add capacity are the ones most likely to be overloaded.

For cells, static stability means: pre-provisioned capacity, mapping cached in the router, no synchronous dependency from a cell to a global service on the request path, and credentials and config that remain valid if the issuing service is down for hours.

Shuffle sharding

Cells limit the blast radius of failures that start inside a cell. Shuffle sharding limits the blast radius of failures caused by a customer, such as a poison request that crashes any worker it touches, or a tenant whose traffic overwhelms its workers.

Instead of putting each customer in one fixed group, give each customer a random combination of workers. Two customers then share their entire set of workers only rarely, so one bad customer takes out its own workers and leaves almost everyone else with at least one healthy worker. Clients must retry on another worker in their shard for this to work.

Shuffle sharding works inside a cell (workers, queues, partitions) or across cells (each tenant lives in 2 of N cells, if the data model allows active-active placement).

Deployment waves across cells

Cells turn a deploy into a controlled experiment. A typical rollout:

  1. Canary cell or a single host in one cell, ideally one with synthetic or internal tenants.
  2. One production cell, then bake for 30 to 60 minutes while automated alarms watch error rate and latency.
  3. A wave of about 10% of cells, bake.
  4. The rest in larger waves, still with bake time, never all at once.

Waves should also respect regions and AZs: do not deploy to the same AZ in every region at once, and never deploy to two regions in the same wave. Config changes and feature flags go through the same waves, because configuration is one of the most common causes of large outages. Halts and rollbacks should be automatic, triggered by alarms rather than a human noticing. The mechanics of canaries and flags are covered in deployment strategies and feature flags.

Migrating customers between cells

Tenants move for rebalancing, for a whale outgrowing a shared cell, or to drain a cell for retirement. A safe migration:

  1. Copy the tenant’s data to the target cell from a snapshot.
  2. Stream ongoing changes with change data capture until the target is caught up (see outbox, inbox and CDC).
  3. Briefly block or queue writes for that tenant (seconds), let the last changes drain, and verify counts or checksums.
  4. Flip the tenant’s entry in the mapping table and push it to routers; requests that hit the old cell during propagation get a redirect or a retryable error.
  5. Keep the old copy read-only for a rollback window, then delete it.

Migration tooling is not optional. If you cannot move a tenant in a routine, tested way, your cells will become unbalanced and you will eventually be forced to grow a cell past its tested maximum.

Where it breaks

Global dependencies. The most common way cells fail together is a shared service they all call: authentication, billing, a feature flag service, a global database for “just the account table”. Each one puts every cell back in a single blast radius. Make such dependencies cellular too, cache their answers locally, or make sure cells keep working without them.

The router as a single point of failure. It is shared by definition. Keep it tiny, replicate it widely, deploy it in its own slow waves, and keep its mapping cached so it does not depend on the mapping store at request time.

Cross-cell operations. Admin reports across all tenants, tenant-to-tenant features and global search pull cells back together. Serve them from an asynchronous copy (an analytics pipeline fed by every cell), not by fanning out to cells on the request path.

Uneven cells. Without migration tooling, the first cells fill with the oldest and biggest customers and drift past their tested size.

Cost and toil. Twenty databases are not one database. Each needs backups, monitoring, upgrades and on-call attention. Automation of cell creation and operation is the price of entry.

Correlated failures that ignore cells. A cloud provider’s regional outage, a certificate expiring in every cell on the same day, or a bad base image rolled out everywhere still hits all cells. Cells reduce blast radius for failures that start locally; they do not replace multi-region or disaster recovery planning.

Real-world systems

  • AWS publishes the Well-Architected guidance “Reducing the Scope of Impact with Cell-Based Architecture”, which covers cell routers, sizing, partition mapping, migration and deployment, and the Builders’ Library articles on static stability and shuffle sharding. It describes cells as a pattern used across many AWS services.
  • Route 53 uses shuffle sharding of virtual name servers, as described in the Builders’ Library.
  • Slack has written about its migration to a cellular architecture, treating availability zones as cells. The work was motivated by partial failures inside a single zone, and a central piece is the ability to drain all traffic from one AZ quickly, by signalling the edge Envoy load balancers through Slack’s control plane, without depending on anything inside the zone being drained.

Many large SaaS companies describe cell-like designs under other names (pods, stamps, shards of the whole stack). Treat any specific claim you hear about cell counts or sizes as unverified unless the company has published it.

How to apply it

Cells are a serious investment. Use them when the cost of a full outage is high and you have the automation to run many copies.

Signal Lean toward cells Not yet
Customers many independent tenants a single global dataset
Cost of total outage contractual SLAs, revenue critical internal tool
Request pattern each request touches one tenant most requests cross tenants
Team platform team, strong automation a few engineers, manual ops

Checklist:

  • Pick a partition key present on every request; check that 99% or more of operations touch one cell.
  • Build a thin router with an in-memory, pushed mapping table.
  • Define and load test a maximum cell size; open new cells instead of growing old ones.
  • Remove or cellularise synchronous global dependencies; make the data plane statically stable.
  • Use shuffle sharding inside cells where poison requests or noisy tenants are a risk.
  • Deploy code and config in waves with bake time and automatic halt.
  • Build tenant migration tooling and use it regularly so it stays working.
  • Report health and SLOs per cell, so one bad cell is visible instead of averaged away (SLI, SLO, SLA).

Interview questions

Q1: What is the difference between sharding a database and a cell-based architecture?

Sharding splits one data store so it can hold more data and handle more writes. The app servers, caches, queues and config above the shards are still shared, so a bad deploy, a poison request crashing the app tier or a broken shared cache affects all shards. A cell is a partition of the whole stack: each cell has its own compute, storage and queues, and shares nothing on the request path except a thin router. Sharding addresses scale; cells address blast radius. A cell usually contains a sharded or unsharded database of its own.

Q2: You have 16 workers and assign each customer a shuffle shard of 4. A poison customer crashes its 4 workers. What fraction of other customers lose all their workers, and what does that require of the client?

Possible shards: C(16, 4) = 16 times 15 times 14 times 13 / 24 = 1,820. A customer loses everything only if its shard is the same 4 workers, probability 1/1,820, about 0.05%. Most customers share 0 or 1 workers with the poison shard and keep at least 3 of 4 healthy workers. That only helps if the client retries on a different worker in its shard when one fails, and if the poison request is not retried onto the customer’s healthy workers by some other path. With plain sharding into 4 groups of 4, the figure would be 25%.

Q3: Your cell router reads the mapping table from a database on every request. What is wrong and how do you fix it?

The mapping database becomes a synchronous dependency of every request in every cell, so its outage or slowness is a global outage, which defeats the point of cells, and it also adds a round trip of latency to every call. Make the mapping a data plane artefact: the control plane writes it, pushes or publishes it (for example as a versioned snapshot), and each router holds the whole table in memory and keeps serving from the last good version if updates stop. Requests that arrive at the wrong cell during a migration get a redirect or retryable error, which keeps correctness without a lookup per request.

✅ Key takeaways

  • A cell is a full, independent copy of the stack serving a subset of tenants; a failure inside one cell reaches only that cell’s 1/N of customers.
  • Keep the router thin with a cached mapping table, choose a partition key on every request, and avoid cross-cell work on the request path.
  • Give cells a tested maximum size, scale by adding cells, and build tenant migration tooling (snapshot, CDC, brief freeze, mapping flip).
  • Separate control plane from data plane and make the data plane statically stable: pre-provisioned capacity, no synchronous global dependencies.
  • Shuffle sharding cuts the chance that a bad customer takes out a neighbour from one in the number of fixed groups to one in C(n, k); deploy code and config across cells in waves with bake time.

🧠 Check your understanding

0 / 4
  1. 1Which failure does a cell-based architecture contain best?

  2. 2With 8 workers and each customer assigned a random pair, a poison customer crashes its pair. What is the probability that a given other customer loses both of its workers?

  3. 3A service runs in 3 AZs and needs 900 instances of capacity at peak. To be statically stable against losing one AZ, how many should run in each AZ?

  4. 4Every cell calls a global authentication service synchronously on each request. What is the main problem?

Where to go next

Finished this lesson?

Mark it complete to track your progress across the roadmap.