One application serving many customers — and the isolation decision that shapes everything afterwards.
A multi-tenant application serves multiple customers from one deployment, with each tenant's data logically separated. The alternative is a separate instance per customer. Multi-tenancy is cheaper to run and upgrade, because there is one application to patch, and it concentrates risk, because a flaw in tenant isolation affects everyone at once.
The isolation model is chosen once and is very expensive to change. It determines your hosting cost per customer, how you handle a customer who wants their data in a specific country, how you restore a single tenant's data after an error, and how convincingly you can answer a security questionnaire. It is an architectural decision with commercial consequences.
One database, one set of tables, a tenant identifier on every row. Cheapest to run, and every query must filter correctly — one that does not is a data leak.
One database, a schema each. Better isolation and per-tenant restore, at the cost of migrations running many times.
Strongest isolation and simplest restore. Highest operational cost, and the model that suits regulated or enterprise customers.
Database-enforced filtering, so isolation does not depend on every query being written correctly. Worth the effort on a shared schema.
Caching, background jobs, logs and exports all need the tenant context, and each is a place isolation is commonly forgotten.
A shared-schema application puts a tenant identifier on every table and filters by it in every query. One new endpoint, written in a hurry, omits the filter on a secondary lookup.
In testing nothing is wrong, because the test database has one tenant and the filter makes no difference. In production the endpoint returns another customer's records. This is the characteristic multi-tenant failure, and it is a single forgotten clause rather than a sophisticated attack — which is precisely why it is dangerous.
The defences are structural rather than diligent. Enforce tenant filtering at the data access layer or through database row-level security so an application developer cannot forget it. Seed test environments with multiple tenants so cross-tenant leakage fails a test rather than passing one. And add automated checks that assert isolation on every endpoint. Relying on every developer remembering every time is not a security model; it is a hope with a deployment pipeline attached.
| Term | What it means |
|---|---|
| Tenant | One customer organisation and all its data within a shared application. |
| Tenant isolation | The mechanism preventing one tenant from seeing another's data. The central security concern. |
| Shared schema | All tenants in one database with a tenant identifier on every row. |
| Database per tenant | Each tenant in its own database. Stronger isolation, higher operational cost. |
| Noisy neighbour | One tenant's load degrading performance for others. |
One missing filter exposes another tenant's data. Enforce at the database layer as well.
A cache key that omits the tenant will serve one customer's data to another. This is a classic and serious bug.
Async jobs often run outside the request that carried the tenant. The context has to be passed explicitly.
On a shared schema, restoring one tenant without affecting others needs to be designed, not improvised during an incident.
| Metric | What it tells you | What distorts it |
|---|---|---|
| Cross-tenant access attempts | Should be zero, and should be alerted on rather than logged. | |
| Per-tenant resource consumption | Identifies noisy neighbours before other tenants report them. | |
| Tenant onboarding time | How long to stand up a new customer. A proxy for how automated provisioning really is. | |
| Query performance by tenant size | Whether large tenants degrade as they grow, which shared schemas do without partitioning. |
We build and support the systems this page describes. Start with a free working proof of concept — no cost, no commitment.