Course map

Project 20

Multi-tenant SaaS platform

Tenant isolation, enterprise design

Start after Part 12 + topics 211–212

Key topics 163, 211, 212

Architecture Full-depth design — every choice yours to defend

Published reference Shopify, "A Pods Architecture To Allow Shopify To Scale" (Xavier Denis, 2 Mar 2018)

Brief

Take a B2B product (a helpdesk or project tool) and design it as enterprise SaaS: thousands of tenants from 5-seat startups to 50k-seat enterprises, tiered plans, SSO, per-tenant data isolation, usage-based billing, compliance-grade controls.

Targets

10k tenants; the largest tenant 10,000× the median · per-tenant p99 unaffected by neighbors · tenant data provably isolated · enterprise tier offers regional data residency · tenant onboarding fully automated.

Must cover

  • Tenant-aware authorization — every check carries the tenant context (→ 163).
  • Isolation models, quotas and noisy neighbors (→ 211).
  • Cells — blast-radius containment and cell routing (→ 212).
  • Provisioning — fully automated tenant onboarding (P).
  • Metering and billing — usage events to auditable invoices (P).
  • Moving a tenant between databases live (P; → 189 as the sequence).

Design challenges

  1. The tenancy-model ADR (→ 211): shared schema vs. schema-per-tenant vs. database-per-tenant — possibly mixed by tier — with cost, isolation, migration, and operations analysis for each.
  2. Cell-based isolation (→ 212): shard-nothing cells; cell routing; which tiers get dedicated cells.
  3. Noisy neighbors (→ 96, 97): per-tenant rate limits, fair queuing, and quotas at every shared layer — API, database, queues, search.
  4. Tenant context propagation (→ 147): tenant ID through every call, query, event, and log — enforced centrally, impossible to forget; row-level security as the backstop.
  5. Enterprise identity (→ 161, 163, Project 3 reuse): per-tenant SSO and federation, SCIM-style provisioning awareness, tenant-admin RBAC.
  6. Data residency and the largest tenant (→ 142): regional cells; live tenant migration between cells (→ 189).
  7. Metering and billing: usage events → aggregation → invoices, accurate and auditable (reuse Projects 19 and 9).
  8. Tenant-aware operations (→ 201–203, 188): per-tenant observability and feature flags; blast-radius analysis for every deploy.
  9. The compliance pack (→ 170–171, 195): audit logs, encryption posture, backup and DR per tier, and tenant deletion — the right to erasure across every store and backup (→ 81).

Expected output

A full architecture document — all 21 method steps at full depth — plus five or more ADRs, C4 diagrams, a capacity model, and a one-page executive summary. This is the portfolio piece.

Search the guide