Multi-Tenancy
Multi-tenancy means that one system, or one ecosystem of systems, serves several tenants: groups of users and data that must be kept apart, while sharing the same software, operations and, to varying degrees, infrastructure.
Multi-tenancy is rarely a feature of one component. In a multi-tenant system it is a cross-cutting concern that has to be implemented consistently across the whole ecosystem: identity, APIs, services, events, data stores, the data lake, observability, cost management, deployment and AI features. A single component that ignores the tenant can leak one tenant's data to another, or let one tenant's load slow down everyone else.
What is a tenant?
The word tenant means different things in different businesses. Defining it explicitly, as an entity in the enterprise data model, is the first architectural decision.
| Business context | Tenant is | Example |
|---|---|---|
| Software as a service (SaaS) | A customer organization, the classic meaning | Each company using a CRM product, with its own users and data |
| Integration platforms | An integration partner | Each retailer connected to a marketplace or logistics platform |
| Data platforms | A data provider or data consumer | Each supplier delivering product data, each partner receiving reports |
| Global businesses | A market, country or region | Each country with its own legal entity, regulations, language, prices and data residency rules |
| Groups after mergers | A brand or business unit | Each acquired company running on a shared platform (see organizing legacy spaghetti) |
| Internal platforms | A team or product | Each product team sharing a Kubernetes cluster or data platform |
Several of these can apply at once: a global SaaS business may have customers as tenants and markets as a second dimension, each with its own data residency requirements. The model should be clear about which dimensions exist and how they relate.
Tenant context: the thread through the ecosystem
The foundation of multi-tenancy is tenant context: every request, event, log entry and data record must carry the identity of the tenant it belongs to, from the moment a user signs in to the moment data is stored.
- Identity: the tenant is part of the user's identity, typically a claim in the access token issued by the identity provider. It is never taken from user input such as a URL parameter alone.
- Propagation: services pass the tenant context on every call and event, so downstream components can enforce isolation.
- Enforcement: data access, authorization and resource limits are applied using the tenant context, ideally in shared libraries and platform components rather than in every piece of business code.
Isolation and deployment models
The AWS Well-Architected SaaS Lens describes three basic models for how tenants share resources (see silo, pool and bridge models):
| Model | Description | Strengths | Weaknesses |
|---|---|---|---|
| Silo | Tenants get dedicated resources: a separate database, separate compute, or a fully separate stack per tenant | Strong isolation, easier compliance, no noisy neighbors, per-tenant cost is clear | Higher cost, more resources to operate, slower onboarding at scale |
| Pool | Tenants share resources: the same services, databases and queues, with isolation enforced in software | Economies of scale, efficient use of capacity, simple operations and fast onboarding | Isolation depends on correct implementation; noisy neighbor risk; per-tenant cost must be measured |
| Bridge | A mix: some parts siloed, others pooled, decided per service | Isolation where it matters, efficiency elsewhere | More design decisions; two operational patterns to support |
The SaaS Lens stresses that even in a silo model, tenants are still managed through one shared identity, onboarding and operational experience. That is what distinguishes a multi-tenant platform from running separate, individually customized installations for each customer.
Models are often combined with tiers. Basic-tier tenants run in a pooled environment; premium tenants, or tenants with strict regulatory requirements, get siloed resources or a full dedicated stack. The deployment and operations are still the same, with no one-off customizations per tenant.
The choice can be made per component. A service handling sensitive regulated data may be siloed, while a catalog service is pooled. For market-based tenancy, data residency often forces at least regional silos: European customer data stays in a European deployment.
Data partitioning
Data is where isolation matters most. Common strategies, from strongest to most efficient:
| Strategy | Description | Notes |
|---|---|---|
| Account or stack per tenant | Separate cloud account or full environment | Strongest isolation; used for large or regulated tenants |
| Database per tenant | Separate database instance or cluster | Simple to reason about, easy per-tenant backup, restore and deletion |
| Schema per tenant | One database, separate schema per tenant | Middle ground; can become hard to manage with many tenants |
| Shared tables with a tenant key | Every row carries tenant_id; queries are always filtered | Most efficient; must be enforced systematically, for example with row-level security in the database |
Beyond databases, the same decisions apply to every data store:
- Object storage: separate buckets or tenant-specific prefixes, with access policies per tenant.
- Encryption: optionally separate encryption keys per tenant, so a tenant's data can be made unreadable by revoking its key.
- Search and vector indexes: tenant filters on every query; for semantic search and RAG, a missing tenant filter means one tenant's documents can appear in another tenant's answers.
- Data lake: tenant as a partition key or separate tables, with access control per tenant in the catalog.
- Caches: tenant ID as part of every cache key.
Multi-tenancy across platform capabilities
Because it is cross-cutting, multi-tenancy touches every platform capability:
| Capability | Multi-tenancy concerns |
|---|---|
| Identity and access management | Tenant in the token; users belong to tenants; per-tenant identity federation (each customer's own IdP); tenant administrators managing their own users |
| API management | Tenant-aware routing, rate limits and quotas per tenant and tier; per-tenant API keys for partners |
| Event-driven architecture | Tenant ID in every event envelope; shared topics with tenant filtering, or topics per tenant for siloed tenants |
| Observability | Tenant as a dimension on logs, metrics and traces; per-tenant dashboards and SLOs; masking in shared tools |
| Provisioning | Automated tenant onboarding: creating the tenant, its configuration, users, resources (for siloed tiers) and initial data, through code |
| Security | Automated tests that verify one tenant cannot access another's data; isolation reviewed in threat models |
| Costs | Metering usage per tenant; cost per tenant, the essential unit cost for SaaS pricing and profitability |
| AI features | Tenant context in retrieval and tools; per-tenant budgets in the LLM gateway; no tenant data in shared prompts, caches or fine-tuning without consent |
| Deployment and releases | Rolling out changes tenant by tenant or tier by tier; tenant-specific feature flags without forking the code |
| Compliance | Data residency per market or tenant; per-tenant retention, export and deletion |
The noisy neighbor problem
In pooled environments, one tenant's heavy usage can degrade service for others. Mitigations include:
- rate limits and quotas per tenant and tier at the gateway and in services
- fair scheduling of background jobs and queues, so one tenant's batch does not block everyone
- resource limits per tenant in shared compute, such as Kubernetes namespaces with quotas (see Kubernetes multi-tenancy)
- monitoring per tenant, to detect which tenant causes load
- moving heavy tenants to their own pool or silo, which the bridge model makes possible
Tenant lifecycle
Tenants are created, changed and removed, and each step should be automated:
| Stage | Activities |
|---|---|
| Onboarding | Create the tenant record, identity configuration, resources for its tier, default settings and admin users |
| Tier change | Move between pooled and siloed resources, adjust quotas and features |
| Suspension | Block access while keeping data, for example for unpaid invoices |
| Offboarding | Export data on request, delete all tenant data across every store, including backups, logs, the data lake and search indexes, within the agreed retention period |
Offboarding is the real test of a multi-tenant design: if nobody can say where a tenant's data lives, it cannot be deleted reliably.
Further guidance
- AWS Well-Architected SaaS Lens: tenant isolation, silo, pool and bridge models, onboarding, tiering, metering and operations, as part of the AWS Well-Architected Framework
- Architect multitenant solutions on Azure: Microsoft's guidance with similar models and trade-offs
- Kubernetes multi-tenancy: sharing clusters between teams or customers
Common pitfalls
- Tenant as an afterthought: adding multi-tenancy to a single-tenant design later, touching every table, query and API.
- Isolation only in the UI: filtering by tenant in the front end while APIs, events or exports return everything.
- Inconsistent implementation: one service, report, cache or AI index that forgets the tenant filter.
- Custom versions per tenant: one-off code branches for big customers, which destroy the operational benefits of a shared platform.
- Unclear tenant definition: customers, markets and brands mixed up in one
tenant_idwithout a clear model. - No per-tenant cost or usage data: pricing and tiering decisions made without knowing what each tenant costs.