Dashboard
Courses
Problems
Badges
Theme
Sign inStart free
Courses/Operating at Scale
Lesson 11 of 16

Multi-tenancy and noisy neighbours

Share infrastructure across many customers while keeping their data separate and their workloads from hurting each other.

16 min read

Isolation models

Multi-tenant systems sit on a spectrum between pooled and siloed. In a pooled model every tenant shares the same services and tables, separated by a tenant_id column; it is cheap and simple to operate but every tenant shares every failure. In a siloed model each tenant gets its own database or even its own stack; isolation is strong, but cost and operations scale with tenant count. Most SaaS platforms mix them: pooled for the long tail of small tenants, dedicated cells or databases for the largest or most regulated customers.

  • Pooled: lowest cost per tenant, weakest isolation
  • Bridge: shared services, separate schemas or databases
  • Silo or cell: dedicated stack per tenant or group of tenants, highest cost

Data isolation

In pooled storage, one missing WHERE clause leaks another customer's data, which is a trust-ending incident. Enforce isolation below the application: row-level security policies in the database, tenant-scoped credentials or connection context, and partition keys that start with the tenant ID. Test it explicitly with integration tests that try to read across tenants. Encrypt sensitive tenants' data with per-tenant keys so that deleting a key effectively deletes their data. Apply the same rule to caches, search indexes and object storage paths: every key or path should include the tenant ID.

Noisy neighbours

Tenant load is heavily skewed: in many SaaS products the top 1% of tenants generate more than half of the traffic. A single tenant running a bulk export can saturate a shared database and raise p99 latency for thousands of others. Defences work at every layer: per-tenant rate limits and quotas at the edge, per-tenant concurrency limits in workers, fair queuing so one tenant's backlog cannot starve others, and separate queues or worker pools for bulk and interactive work. When a tenant outgrows the pool, move them to a dedicated shard or cell.

Cells and blast radius

Cell-based architecture splits the platform into independent copies, each serving a subset of tenants, with a thin routing layer that maps tenant to cell. A bad deploy or overloaded database then affects one cell, perhaps 5% of tenants, instead of everyone. Cells also make capacity simple: when a cell is full, open another. Observe everything per tenant, so you can answer which customers were affected by an incident and what each one costs to serve. Deploy to cells one at a time, so a bad release is caught in the first cell.

Key takeaways

  • Choose pooled, bridge or siloed isolation per tenant tier, not once for all
  • Enforce data isolation in the database, not only in application code
  • Per-tenant quotas, fair queuing and separate pools contain noisy neighbours
  • Cells cap the blast radius of failures to a fraction of tenants

Sign in to track lessons and earn badges.

Cost optimisation leversRelease engineering and CI/CD at scale

Challenge checkpoint

Course: 0/16 lessons · 0/10 challenges0%

Build it on the canvas, pass the review (70+) and mark it complete to count it toward the course badge.

  1. 6/10Design a Multi-Tenant SaaS BackendServe 20k tenants with data isolation, per-tenant limits and partitioning that contains noisy neighbours.MAJORMedium
All 10 challenges →