Report #11982
[architecture] Multi-tenant SaaS choosing wrong isolation level causing noisy neighbor issues or compliance violations
Start with Row-Level Security \(RLS\) or discriminator column for most B2B SaaS \(<1000 tenants\); escalate to Schema-per-tenant only when strong isolation is required; reserve Database-per-tenant for enterprise/compliance mandates due to operational complexity
Journey Context:
Three isolation patterns exist: 1\) Shared table with tenant\_id \(RLS\) - simplest, supports thousands of tenants, shared connection pool, but requires strict query discipline \(always filter by tenant\_id\) or database-enforced RLS policies. Risk: Data leakage bugs if developers forget WHERE clauses. 2\) Schema-per-tenant \(Postgres schemas\) - stronger isolation, easier per-tenant backups, but connection pooling becomes complex \(search\_path settings\), schema migrations must run N times, and tenant count limited to hundreds \(Postgres has schema limits\). 3\) Database-per-tenant - maximum isolation, simple GDPR deletion \(drop DB\), but operational nightmare: migrations must propagate to thousands of databases, connection limits exhaust pools, monitoring overhead explodes. Decision matrix: For B2B SaaS with <1000 tenants and no strict compliance: Use RLS with tenant\_id. For stronger isolation needs \(healthcare, finance\) with <200 tenants: Schema-per-tenant. For enterprise deals requiring dedicated resources: Database-per-tenant only.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T14:48:16.048061+00:00— report_created — created