Multi-tenancy means one running instance of an application serves many customers, called tenants, while keeping each tenant's data and settings separate. Most B2B SaaS products work this way: every company gets its own workspace, but all of them run on the same code and infrastructure. Single tenancy is the opposite, with a separate deployment for each customer.
In cloud computing, the same word describes a provider running many customers' workloads on shared hardware, isolated by virtualisation. In Kubernetes it means teams or customers sharing one cluster, separated by namespaces, quotas and network policies. This page is about multi-tenancy inside an application.
Tenancy models
AWS's SaaS guidance names three models:
- Silo. Each tenant gets dedicated resources, such as its own database or a full stack, while onboarding, identity and operations stay shared. It gives the strongest isolation at the highest cost per tenant.
- Pool. Tenants share the same compute and the same tables, with a tenant ID on every row. It is the cheapest to run and the simplest to upgrade, but isolation depends on your code and database rules.
- Bridge. A mix of the two. Some services are siloed and others pooled, for example pooled storage for small customers and a dedicated database for an enterprise customer who asks for one.
In the database, these map to a shared schema with a tenant column, a schema per tenant, or a database per tenant.
Example: pooled tenants with PostgreSQL row-level security
A school management SaaS serves 600 schools from one PostgreSQL database. Every table has a tenant_id column, and row-level security (RLS) makes the database enforce isolation even if a query forgets the filter:
ALTER TABLE students ENABLE ROW LEVEL SECURITY;
CREATE POLICY tenant_isolation ON students
USING (tenant_id = current_setting('app.tenant_id')::uuid);
-- per request, inside the transaction, with the tenant taken from the verified token:
SELECT set_config('app.tenant_id', $1, true);
Now SELECT * FROM students returns only the current school's students. Two details matter. PostgreSQL lets table owners and superusers bypass RLS, so the application must connect as a separate role without the BYPASSRLS attribute, or the table must use FORCE ROW LEVEL SECURITY. And a table with RLS enabled but no policy returns no rows at all, which is a safe default.
Risks to design for
- Data leaking between tenants. This is the worst incident a SaaS company can have. Enforce the tenant scope in the database, cache keys, search indexes, file storage paths and background jobs, not only in API handlers, and give each component least privilege.
- Noisy neighbours. One tenant's bulk import slows everyone else. Use per-tenant rate limits, quotas and separate queues for heavy jobs.
- Per-tenant obligations. Enterprise customers ask for tenant-level audit logs, retention settings, export and deletion. Under India's DPDP Act, your customer is usually the Data Fiduciary and you are their data processor, so after a breach you must be able to say quickly which tenants were affected.
- Growth. When one database is no longer enough, the tenant ID is a natural shard key for database sharding.
DPDP for SaaS companies lists the tenant-level features Indian enterprise buyers now ask for, and our SaaS page covers the products we build.