Multi-Tenant Applications: The Decisions That Matter
Software that serves many customer organizations from one application, keeping their data separate.
On this page
At a glance
- Shared database tenants are separated by identifiers in the data
- Separate databases stronger isolation at higher operational cost
- Scoping every query must be scoped to a tenant
- Testing isolation needs automated tests
Why it matters
Why it matters: Tenant isolation mistakes leak one customer's data to another, which is among the worst failures a product can have.
Best practice
- Enforce tenant scoping at the data layer
- Write tests that attempt cross-tenant access
- Include tenant identifiers in caches and queues
- Audit background jobs for scoping
- Plan tenant data export and deletion
Common pitfalls
Watch out for:
- Manual tenant filters in each query
- Caches shared across tenants
- Background jobs without tenant context
- Isolation tested only by hand
When to call in a specialist
Bottom line Bring in help when building software for multiple organizations.
Where this comes from
- Microsoft Learn — Multitenant architecture
- OWASP — Access Control Cheat Sheet
The figures and practices above come from the sources listed.
Working on something like this?
We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.
Where to go next
Spotted something wrong? Report an error on this page. We correct on the page and say what changed.