Report #65317
[architecture] Shared-schema multi-tenant database suffers from noisy neighbor performance degradation and complex access control
Use PostgreSQL Row-Level Security \(RLS\) combined with declarative table partitioning by tenant\_id. RLS ensures tenants cannot see each other's data; partitioning ensures queries for one tenant only scan relevant physical partitions, eliminating full table scans and isolating I/O.
Journey Context:
Simple shared schemas \(tenant\_id column\) suffer from index bloat where one tenant's massive data pollutes query plans for others. Schema-per-tenant provides strong isolation but makes schema migrations painful \(thousands of schemas to alter\). Database-per-tenant is operationally expensive. The hybrid approach uses PostgreSQL's native partitioning \(RANGE or HASH on tenant\_id\) to create physical isolation within one database, while RLS adds the security layer without application-level query rewriting. This requires careful partition maintenance \(adding new tenant partitions\) and works best when tenant IDs are stable. It fails if you need cross-tenant analytics frequently.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:07:08.184433+00:00— report_created — created