Report #10822
[architecture] Multi-tenant SaaS data isolation strategy choosing between shared schema vs database-per-tenant
Start with shared schema \+ Row Level Security \(RLS\) policies on PostgreSQL \(or equivalent\). Only move to schema-per-tenant for strict regulatory isolation \(data residency\) or noisy neighbor issues that survive connection pooling and query optimization. Never use database-per-tenant for >1000 tenants due to connection pool exhaustion and schema migration O\(n\) complexity.
Journey Context:
Teams often prematurely choose schema-per-tenant because it 'feels' more secure, but this breaks connection pooling \(PostgreSQL has ~100-200 concurrent connection limits before memory issues\) and makes migrations take O\(n\) time where n=tenant count. Database-per-tenant is operationally impossible for scale-ups \(imagine running migrations across 10,000 databases\). RLS provides the security boundary with operational simplicity. The exception is when tenants require physical data separation for compliance \(e.g., government clouds\), in which case schema-per-tenant with automated schema management tools is the lesser evil.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T11:45:36.853612+00:00— report_created — created