Skip to main content
PreparationZone Logo
PrepZone

Cell-Based Architecture

Isolate failure domains into cells so one outage cannot take down the entire platform.

Pass checkpoint below

Read these first

Why this matters

  • AWS, Slack, and Discord use cells to contain blast radius — a bad deploy or database corruption in Cell A does not take down Cells B through Z.
  • StreamHub's 2024 us-east-1 incident affected all users because they shared one monolithic database. Cells would have limited impact to ~5% of users.
  • Cells trade operational complexity (managing N independent stacks) for resilience at scale.

Cell architecture components

  • Cell router — maps user ID to cell assignment; sticky for lifetime of account.
  • Cell — self-contained stack: LB + app tier + database + cache.
  • Control plane — shared services across cells: auth, billing, global config.
  • Cell provisioning — automated pipeline to spin up a new cell when capacity fills.
  • Cross-cell operations — admin tools, monitoring, and deploy orchestration across all cells.

Topology

Cell A
ALB + EKS + RDSusers 0–1M
Cell B
ALB + EKS + RDSusers 1M–2M
Cell C
ALB + EKS + RDSusers 2M–3M
Each cell is a mini EKS + RDS stack; failures stay contained to one user slice.

User-to-cell assignment

Assign users to cells via consistent hashing on user ID. Once assigned, the mapping is permanent.

Java
CELL_COUNT = 20

def get_cell_id(user_id: str) -> int:
    hash_val = int(hashlib.sha256(user_id.encode()).hexdigest(), 16)
    return hash_val % CELL_COUNT

# usr_42 → cell 7
# usr_99 → cell 14
Java
{
  "user_id": "usr_42",
  "cell_id": 7,
  "assigned_at": "2025-01-15T10:00:00Z"
}

Store the mapping in a global metadata service (small, highly available, rarely changes).

The rest of this guide is part of Pro

Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.

Still to come · 4 sections

  • Cell internals
  • Routing requests to the correct cell
  • Shared control plane
  • Cell provisioning and capacity

Test yourself

Answer these before moving on — recall is what makes it stick.