Lesson 02 of 16 · Cells
Sizing a cell
Decide how big a cell may get: list every limit a cell can hit, find the first one with load tests, add headroom, cap it by how many tenants you are willing to lose at once, and turn the result into placement rules for new tenants.
Size is a decision, not an accident
If cells grow until something breaks, you rediscover the problems of one big platform. Define a maximum cell size up front, from measurements and a business decision.
A school bus has a fixed number of seats for safety. When more children need to travel, you don't squeeze them in; you send another bus. To pick the bus size you check the engine, the brakes and the doors, and the smallest of those limits wins.
List every limit
A cell is only as big as its weakest component. Typical limits:
| Layer | Limits to measure |
|---|---|
| Database | Write IOPS and throughput, storage, max connections, replication lag under load, failover time |
| Messaging | Partitions per broker and per cluster, throughput, consumer lag, retention storage |
| Kubernetes | Nodes and pods, API server and etcd load (many controllers and CRDs add up), pod IPs per subnet |
| Cloud account / subscription | Load balancers, network interfaces and IPs, instance quotas, KMS and API rate limits |
| Services | Requests per second, connection pools, cache memory, background job throughput |
Find the knee with load tests
- Build a cell exactly as production (same code, add-ons and instance types).
- Load it with synthetic tenants that match real tenant shapes (many small, some large; realistic read/write mix).
- Increase load until latency or errors rise sharply (the knee). Record which limit hit first.
- Fix cheap bottlenecks (connection pooling, indexes, partition counts) and repeat.
Run the cell at about 60-70% of the knee, so spikes, failovers and organic growth don't push it over, and so you have time to open a new cell.
Cap it by blast radius
Capacity says how many tenants a cell can hold. Blast radius says how many you are willing to affect in one incident. Agree it with the business, for example:
- at most 2% of all tenants per cell, or
- at most N of the largest customers per cell, or
- at most X% of revenue per cell.
The smaller of the two limits wins.
Turn it into placement rules
new tenant arrives → tier and expected size from the contract or sign-up
├─ regulated or residency-bound → a cell with that compliance label in the right region
├─ projected > 10% of a cell → dedicated cell (or a larger cell class)
└─ otherwise → the shared cell with the most headroom in the region
when a shared cell reaches 70% → stop placing new tenants there; open the next cell
when a tenant grows past its share → move it (lesson 4)
Store cell capacity and usage as data (in the tenant directory) so placement is automatic and reviewable.
Cell classes
Offer a few standard sizes (small, standard, large), each load-tested once. Exotic one-off cell shapes become support burdens.
Try it
For a system you know, fill in the limits table with real or estimated numbers. Identify the first limit, compute 70% of it, then apply a blast-radius cap of 2% of tenants. Which one sets the cell size? Write the placement rule for a tenant that is 15% of a cell.
Recap
- Cell size = the first measured limit (with headroom) or the blast-radius budget, whichever is smaller.
- Measure database, messaging, Kubernetes and cloud-quota limits with realistic synthetic tenants.
- Turn sizes into placement rules and a few standard cell classes; open new cells before old ones fill.
This site is a public version of my personal engineering knowledge hub. It intentionally excludes confidential company information and internal operational details.