Multi-tenancy is the decision that quietly shapes your entire SaaS backend. Get it right and you scale smoothly to thousands of accounts. Get it wrong and you're rewriting your data layer under load, mid-growth, with customers watching. The good news: for most products the right answer is simpler than the internet suggests.

The three models

There are three canonical ways to isolate tenants, and they trade isolation against operational cost:

Row-level (shared schema). Every table has a tenant_id\ column, and every query filters on it. One database, one schema, all tenants together.

Schema-per-tenant. Each tenant gets its own PostgreSQL schema inside a shared database. Stronger isolation, more objects to manage.