Skip to main content

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 contextTenant isExample
Software as a service (SaaS)A customer organization, the classic meaningEach company using a CRM product, with its own users and data
Integration platformsAn integration partnerEach retailer connected to a marketplace or logistics platform
Data platformsA data provider or data consumerEach supplier delivering product data, each partner receiving reports
Global businessesA market, country or regionEach country with its own legal entity, regulations, language, prices and data residency rules
Groups after mergersA brand or business unitEach acquired company running on a shared platform (see organizing legacy spaghetti)
Internal platformsA team or productEach 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):

ModelDescriptionStrengthsWeaknesses
SiloTenants get dedicated resources: a separate database, separate compute, or a fully separate stack per tenantStrong isolation, easier compliance, no noisy neighbors, per-tenant cost is clearHigher cost, more resources to operate, slower onboarding at scale
PoolTenants share resources: the same services, databases and queues, with isolation enforced in softwareEconomies of scale, efficient use of capacity, simple operations and fast onboardingIsolation depends on correct implementation; noisy neighbor risk; per-tenant cost must be measured
BridgeA mix: some parts siloed, others pooled, decided per serviceIsolation where it matters, efficiency elsewhereMore 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:

StrategyDescriptionNotes
Account or stack per tenantSeparate cloud account or full environmentStrongest isolation; used for large or regulated tenants
Database per tenantSeparate database instance or clusterSimple to reason about, easy per-tenant backup, restore and deletion
Schema per tenantOne database, separate schema per tenantMiddle ground; can become hard to manage with many tenants
Shared tables with a tenant keyEvery row carries tenant_id; queries are always filteredMost 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:

CapabilityMulti-tenancy concerns
Identity and access managementTenant in the token; users belong to tenants; per-tenant identity federation (each customer's own IdP); tenant administrators managing their own users
API managementTenant-aware routing, rate limits and quotas per tenant and tier; per-tenant API keys for partners
Event-driven architectureTenant ID in every event envelope; shared topics with tenant filtering, or topics per tenant for siloed tenants
ObservabilityTenant as a dimension on logs, metrics and traces; per-tenant dashboards and SLOs; masking in shared tools
ProvisioningAutomated tenant onboarding: creating the tenant, its configuration, users, resources (for siloed tiers) and initial data, through code
SecurityAutomated tests that verify one tenant cannot access another's data; isolation reviewed in threat models
CostsMetering usage per tenant; cost per tenant, the essential unit cost for SaaS pricing and profitability
AI featuresTenant 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 releasesRolling out changes tenant by tenant or tier by tier; tenant-specific feature flags without forking the code
ComplianceData 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:

StageActivities
OnboardingCreate the tenant record, identity configuration, resources for its tier, default settings and admin users
Tier changeMove between pooled and siloed resources, adjust quotas and features
SuspensionBlock access while keeping data, for example for unpaid invoices
OffboardingExport 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​

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_id without a clear model.
  • No per-tenant cost or usage data: pricing and tiering decisions made without knowing what each tenant costs.