Report #80344
[architecture] Schema-per-tenant architecture exhausts database connection pool
Use row-level security \(RLS\) with tenant\_id column instead of schema-per-tenant for high-tenant-density SaaS; reserve schema-per-tenant only for strict isolation requirements with few tenants
Journey Context:
Schema-per-tenant feels clean \(true isolation, easy backup/restore per tenant\) but PostgreSQL connections are process-based and heavy \(typically 50-100MB per connection\). With schema-per-tenant, connection poolers \(PgBouncer\) can't share connections across schemas easily due to search\_path and prepared statements. This limits you to hundreds of tenants, not thousands. Row-level security with tenant\_id column allows connection sharing and scales to millions of tenants. Only use schema-per-tenant for compliance-heavy scenarios with <100 tenants.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:27:48.288092+00:00— report_created — created