Most SaaS products start the same way: one database, a tenant_id column on every
table and a filter in every query. It is the right place to start. It becomes the wrong place to be on the
day an enterprise prospect asks for data residency in their region, their own encryption keys, or assurance
that another customer's month-end batch cannot slow them down.
None of those requests is unusual. What makes them expensive is discovering, at that moment, that the tenancy model was never chosen. It was inherited from the first sprint.
The three models, honestly
| Aspect | Shared schema | Schema per tenant | Database per tenant |
|---|---|---|---|
| Isolation | Logical, enforced in code or by the database | Separate schemas on a shared server | Physical, separate databases |
| Cost per tenant | Lowest | Moderate | Highest |
| Schema migrations | One schema to change | Run per schema; slower at scale | Run per database; needs orchestration |
| Noisy neighbours | Shared resources; needs quotas | Shared server | Isolated |
| Residency, own keys | Hard | Possible but awkward | Natural fit |
| Per-tenant restore or deletion | Careful scripting | Straightforward | Straightforward |
No column is universally correct. A product with thousands of small tenants and little regulatory exposure should be pooled. A product selling to a few dozen banks will end up isolating many of them, whether it planned to or not.
Decide on the requirements you will be asked for
The useful question is not which model is best, but which of these requests you expect in the next two years:
- Data stored in a specific region or country.
- Customer-managed encryption keys.
- Restoring one tenant's data to a point in time without affecting anyone else.
- Provable deletion of a tenant's data when they leave.
- Performance that does not depend on other tenants' load.
- Audit evidence of isolation for a security review.
If the honest answer is none of them, pool and move on. If it is several, from your largest customers, design for them now.
The pragmatic default: pooled, with an exit
For most products the right architecture is pooled by default, with the ability to move an individual tenant to dedicated infrastructure. That needs two things from the start. First, a routing layer that resolves each tenant to where its data lives, rather than assuming a single database. Second, tenant data that can be identified and moved as a unit, which a consistent tenant key on every table makes possible.
With those in place, a large customer who needs isolation becomes a migration measured in days, not a re-architecture measured in quarters.
Enforce isolation in one place
In a pooled model, the most dangerous line of code is a query that forgets its tenant filter. Relying on every developer to remember it in every query is not a control. Enforce it once, with row-level security in the database or a single data-access layer that sets the tenant context and cannot be bypassed. Then test it the way an attacker would: automated tests that try to read another tenant's data, and must fail.
Meter from the first release
Record usage per tenant from day one: requests, storage, background job time. You will need it for usage-based pricing sooner or later, and you need it immediately to see which tenant is causing load. Per-tenant quotas and rate limits turn a noisy-neighbour incident from an outage into a throttled request.
The one-paragraph version
Choose a tenancy model deliberately, against the enterprise requirements you expect: residency, own keys, per-tenant restore and deletion, performance isolation. For most products, pool by default, resolve every tenant through a lookup of where its data lives, enforce isolation in the database or one data-access layer and test it adversarially, and meter usage per tenant from the start. You keep the economics of pooling and a short path to isolation for the customers who need it.
Written by the Bytescope Tech engineering team from live engagement work. If you want to argue with any of it, or you have a case where the opposite held, tell us. Those are our favourite emails.