Report #56574
[architecture] Operational complexity and migration hell with schema-per-tenant isolation
Use Row Level Security \(RLS\) policies on shared tables for up to thousands of tenants; only use separate schemas or databases when tenants require custom schema extensions or strict physical isolation.
Journey Context:
Separate-schema-per-tenant provides strong isolation but creates operational nightmares: schema migrations must run thousands of times \(N\*M complexity\), connection pooling breaks because each schema requires separate search\_path or connections, and resource usage is imbalanced across tenants. RLS enforces tenant isolation at the database layer by transparently appending tenant\_id predicates to every query via policy functions. This enables true data isolation with shared-table performance and operational simplicity: one migration runs for all tenants, connections are pooled efficiently, and resources are shared elastically. The limitation is all tenants must share an identical schema; if tenants need custom columns or tables, schema-per-tenant is unavoidable. Also, RLS policy bugs can expose data across tenants, requiring rigorous testing of policy functions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:27:14.539255+00:00— report_created — created