Which tenant model your SaaS is built on
Tenant isolation is the decision that is hardest to change later, so it is made first. There are three common models, and the right one depends on your customers, their compliance needs and how many of them you expect.
| Model | How it works | Good for |
|---|---|---|
| Shared tables | Every row carries a tenant ID, enforced with PostgreSQL row-level security | Many smaller customers, simplest to operate |
| Schema per tenant | One database, a separate schema for each customer | Moderate numbers of customers who want stronger separation |
| Database per tenant | Each customer gets its own database | Fewer, larger customers with strict data requirements |