Multi-tenancy is a software architecture in which one installation of an application serves many customers, called tenants. All tenants share the same code and infrastructure, but each tenant's data, users and settings are strictly separated, so no customer can see another's data. Multi-tenancy is the basis of almost every SaaS product: it lets the provider run and update one platform for all customers instead of a separate installation per customer.
Multi-tenant data models
- Shared database, shared tables: every record has a tenant ID, and every query filters on it. Most efficient and easiest to scale to many tenants, but isolation depends entirely on the application (or on database features such as PostgreSQL row-level security).
- Shared database, schema per tenant: each tenant has its own set of tables in the same database. Stronger separation, more management with many tenants.
- Database per tenant: strongest isolation, easy per-tenant backup, restore and data location, but higher costs and more complex migrations.
- Hybrid: small customers share, large or regulated customers get their own database or environment.
Multi-tenant vs. single-tenant
In a single-tenant setup, every customer gets their own installation. That offers maximum isolation and customisation, but every installation must be deployed, updated and monitored separately, which becomes expensive as the number of customers grows. Multi-tenancy is cheaper to run and keeps all customers on the same version, at the cost of more care in the design.
What to get right
- Isolation everywhere: not just in the database, but also in file storage, caches, search indexes, background jobs and logs.
- Noisy neighbours: one heavy tenant must not slow down the others; rate limits and per-tenant quotas help.
- Per-tenant configuration: features, branding, user roles and integrations per customer, without separate code branches.
- Tenant-aware operations: exporting, restoring or deleting one tenant's data, and monitoring per tenant.
- Security and compliance: automated tests that prove tenants can't access each other's data, and clear agreements on where data is stored.
Multi-tenancy is also the foundation of white-label software, where each tenant appears under its own brand. See our multi-tenant platform development and SaaS platform development.
Frequently Asked Questions about Multi-Tenancy
What is a tenant?
A tenant is one customer of a multi-tenant application, usually an organisation with its own users, data and settings.
Is multi-tenancy secure?
Yes, if isolation is designed in from the start and enforced at every layer, not added later. Most data leaks between tenants come from a single query or file path that forgets the tenant filter.
Can an existing single-tenant application become multi-tenant?
Yes, but it is a significant change: data models, queries, file storage and background processes all need to become tenant-aware. It is usually done step by step, with thorough tests.
Which multi-tenant model should I choose?
For many small customers, shared tables with a tenant ID are usually best. For few large or regulated customers, a database per tenant may be worth the extra cost. A hybrid model gives the flexibility to offer both.