Report #52510
[architecture] Multi-tenant architecture causes noisy neighbors or operational overload
Start with row-level security \(RLS\) or tenant\_id columns with composite indexes in a shared schema; only move to schema-per-tenant or DB-per-tenant for strict compliance or incompatible schemas
Journey Context:
DB-per-tenant offers perfect isolation but hits connection limits and requires running migrations thousands of times. Schema-per-tenant shares connections but still requires N migrations and complex tenant provisioning. Shared schema with RLS \(PostgreSQL\) or composite primary keys \(tenant\_id, id\) scales best. Critical: always set the tenant context in the database session \(SET app.tenant\_id = 'x'\) before queries to enforce RLS, or use middleware to prepend tenant\_id to every query. Common failure: forgetting to enable RLS on new tables or relying on application-level filtering, which leaks data during ad-hoc queries.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:38:02.720961+00:00— report_created — created