The Three Database Tenancy Models Compared
At the database layer, multi-tenancy comes down to a fundamental architectural trade-off between isolation and density. There are three primary design patterns:
1. The Silo Model (Database-per-Tenant): Every tenant receives a physically distinct database. This offers the ultimate isolation and makes regulatory compliance (such as HIPAA, SOC2 Type II, or FedRAMP) straightforward. However, it imposes extreme operational penalties: running schema migrations across 2,000 separate databases takes hours, infrastructure costs balloon due to idle compute headroom, and cross-tenant analytics require complex ETL pipelines.
2. The Bridge Model (Schema-per-Tenant): Tenants share a single database cluster but reside in isolated PostgreSQL schemas (CREATE SCHEMA tenant_abc). While this allows shared connection pools and easier single-tenant backup exports, it suffers from a fatal ceiling: PostgreSQL's system catalogs (pg_catalog) degrade severely when crossing 1,000+ schemas, and ORM schema migration tools (like Prisma or Flyway) slow to an agonizing crawl.
3. The Pool Model (Shared Database, Shared Schema): All tenant data resides in the same tables, segregated by a tenant_id foreign key. This maximizes resource density, minimizes infrastructure costs to fractions of a cent per tenant, and allows instantaneous global schema migrations. The challenge is ensuring that no tenant can ever see another's data, which requires database-enforced Row-Level Security.
- Evaluate Silo vs. Bridge vs. Pool models against compliance mandates, operational capacity, and unit economics.
- Avoid schema-per-tenant architectures if you anticipate scaling beyond 1,000 active organizations due to catalog bloat.
- Adopt the shared-schema pooled model with PostgreSQL Row-Level Security as the default for scalable B2B SaaS.
