Senior Track Roadmap

Architecture: multi-tenant

This course studies multi-tenancy using an application that has a single tenant. It starts by measuring the schema: 33 tables, 13 with a user_id, and a shared catalog of nine tables. It compares row-level, schema-level and database-level isolation by migration cost, connections and leak risk. It maps which tables would need a tenant key, lists five places where tenant data leaks, and covers PostgreSQL row-level security. It ends with preparations that commit to no pattern and an ADR recording the single-tenant decision.

What you'll learn

  • ✓The difference between a user_id and a tenant key
  • ✓Row-level, schema-level and database-level tenancy and their trade-offs
  • ✓Deciding table by table which tables get a tenant key
  • ✓Five places where tenant data leaks, and PostgreSQL row-level security
  • ✓When schema or database per tenant, or a hybrid, fits
  • ✓Low-cost preparation and an ADR that choose no pattern
Free preview · Lesson 1 4 min read

This application is not multi-tenant

Multi-tenancy is easiest to understand from an application that doesn't have it, because the gap is measurable.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...