Cells & Shuffle Sharding
Limiting how many customers one failure can reach — splitting a service into independent cells, giving each customer a random handful of workers, and why "blast radius" is a number you can design.
#The question behind this page
Most reliability work asks: how do we make failures rarer? This page asks a different question: when something does fail, how many customers does it reach?
That number — the blast radius — is usually "everyone" by default. One shared fleet, one shared database, one shared deploy. A bug, a bad config push, an overloaded node or a single customer sending something pathological takes down the whole service, because nothing separates customers from each other.
Two techniques turn blast radius into a number you choose:
- Cells — split the service into several complete, independent copies, each serving a slice of customers.
- Shuffle sharding — give each customer a random small set of workers, so no two customers share exactly the same set.
#Cells
A cell is a complete, independent instance of your service — its own load balancers, application servers, caches, queues and databases — serving only the customers assigned to it. A thin cell router in front sends each request to its customer's cell.
┌──────────────┐
requests ───────────► │ cell router │ thin: looks up customer → cell
└──┬────┬────┬─┘
┌──────────────┘ │ └──────────────┐
▼ ▼ ▼
┌────────────┐ ┌────────────┐ ┌────────────┐
│ CELL 1 │ │ CELL 2 │ │ CELL 3 │
│ app · cache│ │ app · cache│ │ app · cache│
│ queue · DB │ │ queue · DB │ │ queue · DB │
└────────────┘ └────────────┘ └────────────┘
customers A–H customers I–P customers Q–Z
Nothing is shared between cells. A failure inside cell 2
reaches only cell 2's customers.What this buys:
- Bounded failures. A database melting down, a memory leak, a poison request (one whose contents crash whichever server handles it) — each reaches one cell. With 20 cells, a cell-wide failure affects 5% of customers instead of 100%.
- Safer deploys. Roll out to one cell, watch it, then the next. Since most outages are caused by change, deploying cell by cell turns a fleet-wide incident into a one-cell incident.
- A known unit of scale. You load-test one cell to its limit once. Growing means adding cells, not discovering how a single giant system behaves at a size nobody has run.
- Noisy-neighbour containment. A customer that hammers the service hurts only its own cell's neighbours.
This is the same idea as watertight compartments in a ship's hull: a breach floods one compartment, not the vessel. AWS has used it across many services, and published its approach as the cell-based architecture guidance.
#The cell router must be boring
The router is the one component every request passes through, so it must be the most reliable thing in the system:
- Do almost nothing. Look up the customer's cell and forward. No business logic, no calls to other services on the request path.
- Cache the mapping locally. The customer-to-cell table changes rarely; every router instance should hold a copy and keep working if the system that manages the table is down.
- Deploy it separately and rarely, with even more caution than the cells.
A clever router undoes the whole design — it becomes the shared component whose failure reaches everyone.
#Choosing the partition key and the cell size
The key is whatever every request carries and that groups data which belongs together — usually customer, tenant or account ID. Requests that need data from many cells (a global search, an admin report) don't fit the model. Serve them from a separate system — say, a search index or reporting database — that every cell streams copies of its changes into in the background. That way a global query never reaches into the cells themselves.
The size is a real trade-off:
| Smaller cells | Larger cells |
|---|---|
| Smaller blast radius | Larger blast radius |
| More cells to deploy and operate | Fewer to run |
| Worse capacity efficiency — each needs its own headroom | Better pooling of spare capacity |
| Big customers may not fit in one | Big customers fit |
The largest customer has to fit in a cell. Very large tenants often get dedicated cells, with small customers packed together in shared ones.
#Moving customers between cells
Cells fill up unevenly, so you need a migration path: copy the customer's data to the new cell, keep it in sync, flip the router entry, then clean up. That's a live data migration, and it's the main ongoing cost of running cells. Build it early — the first time you need it is usually when a cell is already in trouble.
#Shuffle sharding
Cells divide customers into groups that never share anything. Shuffle sharding goes further with a probabilistic trick: give each customer a small random combination of workers, so that customers overlap partially but almost never completely.
Start with plain sharding. Eight workers, split into four shards of two; each customer goes to one shard. A poison request that crashes the workers it reaches takes out one shard — a quarter of all customers.
Now shuffle shard. Each customer gets 2 workers chosen from 8, and every customer gets a different pair where possible:
That last line is a real system. Amazon Route 53 arranges its capacity into 2,048 virtual name servers and gives every customer domain a shuffle shard of four. A flood of traffic aimed at one domain — say, a denial-of-service attack — hits that domain's four name servers. The chance that some other domain has the same four is tiny, so everyone else keeps resolving through at least some healthy servers.
Plain sharding (4 shards of 2) Shuffle sharding (pairs from 8)
shard 1: workers 1,2 ← poison here poison customer: workers 3,7
shard 2: workers 3,4 customer X: workers 3,5 ✓ (5 ok)
shard 3: workers 5,6 customer Y: workers 1,7 ✓ (1 ok)
shard 4: workers 7,8 customer Z: workers 2,6 ✓ (both ok)
25% of customers fully down ~1/28 fully down (only exact pair)#What shuffle sharding needs to work
- Clients must try their other workers. The isolation only helps if a request that fails on one worker is retried on another from the same shard. A client that gives up after one failure gets none of the benefit.
- The problem must be tied to the customer. Shuffle sharding contains failures caused by a customer — poison requests, floods, pathological queries. A bug that crashes every worker regardless of input still crashes everything.
- Assignment is deterministic. Hash the customer ID to pick its combination, so every client and router agrees on the shard without a lookup service.
#Static stability
One more idea travels with cells: a system should keep working without needing to change anything when part of it fails. If a cell or zone dies, the survivors shouldn't need to call a control plane (the management systems that launch servers, change configuration and update routing), launch new capacity or rewrite routing tables in order to carry on — because those are exactly the systems most likely to be struggling during a large incident.
In practice: provision enough capacity in advance to absorb a failure, keep routing data cached locally, and treat control-plane changes (scaling, reconfiguring) as things that improve the situation later rather than things the data path depends on now.
#Check yourself
What is blast radius, and what is it by default?Show answer
What is a cell, and what does it buy?Show answer
Why must the cell router be boring?Show answer
What trade-offs come with cell size?Show answer
How does shuffle sharding limit a poison customer?Show answer
How does Route 53 use shuffle sharding?Show answer
What does shuffle sharding need to work?Show answer
How do cell-based systems still have fleet-wide outages?Show answer
#What to carry forward
- Design blast radius deliberately — "everyone" is just the default.
- Cells are independent full stacks behind a thin, boring router; they contain infrastructure failures and bad deploys.
- Shuffle sharding gives each customer a random combination of workers, so toxic traffic hurts almost no one else.
- Static stability: survivors keep working without needing control-plane changes.
- Anything shared crosses the boundary — especially configuration pushes.