Report #43929
[architecture] Multi-tenant data isolation strategy causing security leaks or scalability bottlenecks
For <1000 tenants requiring strict isolation: use schema-per-tenant; for >1000 tenants: use shared tables with Row Level Security \(RLS\) policies and ensure tenant\_id is the leading column in all relevant indexes; avoid database-per-tenant in serverless or connection-pooled environments.
Journey Context:
Schema-per-tenant offers strong isolation \(tenant data separation at the OS level, easy per-tenant backup/restore\) but hits connection limits and memory bloat \(each schema consumes catalog cache\). RLS is lightweight but complex policies can bypass indexes if not written carefully—policies must be sargable and tenant\_id must lead composite indexes. Database-per-tenant fails catastrophically with modern serverless architectures due to connection pooling limits and cross-database query impossibility. The RLS approach requires disciplined application-layer enforcement of tenant\_id setting to prevent privilege escalation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:12:22.061702+00:00— report_created — created