Report #101991
[architecture] Multi-tenant data isolation strategy
Prefer a shared schema with a mandatory \`tenant\_id\` column plus row-level security \(RLS\) policies for strong isolation. Reserve separate schemas or separate databases for regulatory or noisy-neighbor requirements, not as the default.
Journey Context:
Schema-per-tenant seems clean but explodes operational complexity: migrations run N times, connection pooling breaks, and schema count limits become real. Database-per-tenant adds cross-tenant query and backup overhead. A shared schema with RLS enforces isolation at the database layer, supports joins across tenants for admin features, and keeps migrations simple. The main risk is a misconfigured RLS policy or a query missing the tenant predicate; always test with a non-superuser role.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T04:47:28.201545+00:00— report_created — created