Architecture patterns
Tenant isolation models
The spectrum from shared tables to a dedicated stack per tenant, what each model costs, and the enterprise requirements that push large customers toward more isolation.
Tenant isolation is a spectrum from sharing everything to sharing nothing. AWS's SaaS guidance names three broad models, pool, bridge and silo, and real systems mix them by layer. The choice is a trade-off between cost per tenant and how strongly each tenant is separated from the others.
Concept
A pool shares tables and servers, with a tenant column on each row. A bridge shares servers but gives each tenant its own schema or database. A silo gives each tenant a complete stack of its own.
The big idea
Sharing lowers cost and raises risk. A pool is the cheapest, and one missing filter can leak data across customers. A silo is the most isolated, and every tenant costs real money to run. Most mature SaaS companies end up tiered. Free and small tenants share a pool, large tenants get dedicated databases or cells, and the enterprise price covers the difference.
Walking through it
The four models side by side:
| Model | Cost per tenant | Data isolation | Performance isolation | Operational load | Typical use |
|---|---|---|---|---|---|
| Shared tables (pool) | Lowest | Logical: code and row-level security | Weak | Lowest | Free and small tiers |
| Schema per tenant (bridge) | Low | Logical, stronger | Weak | Medium | Mid-size B2B |
| Database per tenant | High | Physical | Strong for storage | High | Enterprise, regulated |
| Silo or cell | Highest | Physical | Strong | Highest | Largest customers, government |
In the pool model, onboarding a tenant is an INSERT, and migrations run once. The cost is that every query must filter by tenant, and every noisy tenant shares every resource. The schema-per-tenant model runs migrations once per tenant. At thousands of tenants that gets slow and fragile, and Postgres catalogs grow large with tens of thousands of schemas. The database-per-tenant model is expensive. A small managed database instance can cost tens of dollars a month, which can exceed what a small tenant pays.
Why enterprise customers push you up the spectrum
Large customers bring a predictable checklist. Each item has architectural consequences.
- Data residency. Data must stay in a region, so tenants need regional deployments. Logs, backups and analytics must stay in-region too. See multi-region architecture.
- Bring your own key (BYOK). The customer controls the encryption key, usually in their own cloud KMS. You use envelope encryption: data is encrypted with data keys, and the data keys are encrypted with the customer's key. If the customer revokes that key, their data becomes unreadable. This is far easier with a database per tenant. See secrets and encryption.
- SSO and SCIM. Employees log in through the corporate identity provider, and SCIM provisioning deactivates accounts automatically when people leave.
- Audit logs. An immutable, per-tenant record of who did what, kept for a year or more and exportable. Treat it as a product feature with its own storage.
Common mistakes
- Choosing a silo for every tenant. The cost per tenant then exceeds what small tenants pay.
- Choosing a pool without a scoping plan. Pooled data needs enforced isolation. See enforcing tenant scoping.
- Ignoring how tenants move between tiers. Upgrades and residency changes will happen, so design for moving a tenant.
Check yourself
-
Why does the pool model cost the least per tenant?
Tenants share tables, servers and operations. Onboarding is an INSERT, and migrations run once for everyone.
-
Why can a small tenant not afford a database per tenant?
A small managed database instance costs tens of dollars a month, which can be more than the tenant pays.
Key takeaways
- Isolation is a spectrum: pool, bridge and silo, with real systems mixing them by layer.
- Pools are cheapest and rely on enforced scoping. Silos are most isolated and cost the most.
- Enterprise requirements such as residency, BYOK, SSO and audit logs push large tenants toward more isolation.
Further learning
Next: enforcing tenant scoping, which covers how a pooled system keeps tenants apart.
Related
Multi-tenant SaaS architecture
Designing one system for many customers, covering isolation models, tenant scoping, noisy neighbors, tenant-aware sharding and per-tenant cost.
Sharding and partitioning
Split data across machines by choosing a shard key, hashing or ranging it, routing requests, handling hot spots, resharding without downtime and generating IDs that stay unique.
Secrets management and encryption
Keeping credentials out of code and data safe at rest and in transit with KMS, Vault and envelope encryption — plus how to catch leaks before they become incidents.