/ blog/multi-tenant-isolation
blog / multi-tenant-isolation / overview.md

Three models, three failure modes

When building multi-tenant systems, you pick your isolation model early and live with it. Here is an analysis of Database-per-tenant, Schema-per-tenant, and Row-level security.

When building multi-tenant systems, you pick your isolation model early and live with it. The three common approaches:

Database-per-tenant: Strongest isolation. Falls apart operationally — connection pools don't scale beyond a few hundred tenants, migrations become a distributed systems problem, monitoring overhead is O(n tenants).

Schema-per-tenant: Better operationally. Postgres connections can be pointed at the right schema with SET search_path. Breaks down around 500 schemas due to catalog bloat, and shared Postgres processes still see all schema names.

Row-level security (RLS): Single schema, single connection pool. Isolation enforced at the database kernel level — even buggy application code can't read another tenant's data.

Tags

databasepostgresarchitecture
0
0