What Is Multi-Tenancy in SaaS Applications
Multi-tenancy lets one SaaS app serve many customers on shared infrastructure. Learn the isolation models and how IAM enforces tenant boundaries.
Multi-tenancy lets one SaaS app serve many customers on shared infrastructure. Learn the isolation models and how IAM enforces tenant boundaries.
Multi-tenancy is a software architecture where a single application instance serves multiple customers, called tenants, who share infrastructure while keeping their data logically separated. It is the foundation of nearly every SaaS product you use, from Salesforce to Slack to GitHub. Get multi-tenancy right, and you have a product that scales. Get the tenant boundary wrong and you have a breach.
Getting multi-tenancy right means getting identity right. This guide covers how multi-tenant architectures work, the isolation models that protect tenant data, and how customer identity and access management enforce the boundaries that make shared infrastructure safe.
Key Takeaways
Multi-tenancy is a software architecture where a single application instance serves multiple independent customers who share the underlying infrastructure while keeping their data logically separated. Picture an apartment building. Everyone lives under the same roof and shares the plumbing, but each unit is private and locked.
A tenant represents a customer organization, not an individual user. Each tenant has its own users, data, and configurations, yet they all run on the same codebase and infrastructure. The system distinguishes between tenants using a Tenant ID (sometimes called an Organization ID), which tags every piece of data and every request so it reaches the right customer.
What do tenants typically share?
In a single-tenant architecture, each customer has their own dedicated application instance. Separate servers, separate databases, completely isolated. Multi-tenant flips this model by consolidating customers onto shared infrastructure with logical boundaries instead of physical ones.
| Aspect | Single-Tenant | Multi-Tenant |
|---|---|---|
| Infrastructure | Dedicated per customer | Shared across customers |
| Cost Model | Higher per-customer cost | Lower, distributed cost |
| Customization | Deep customization possible | Configuration-based flexibility |
| Maintenance | Update each instance separately | Single update for all tenants |
| Isolation | Physical separation | Logical separation |
Single-tenant makes sense when customers have strict compliance requirements or when they need heavy customization that would break a shared codebase. Most modern SaaS applications default to multi-tenant because the economics work better at scale. The trade-off is straightforward: lower costs and simpler operations in exchange for more complex access control engineering.
The core mechanism is simple. Every request, every database query, and every resource access is filtered through the tenant's unique identifier. When a user logs in, the system determines which tenant they belong to, and that context follows them throughout their session.
The architecture enforces logical partitioning so each tenant only sees resources tagged with their specific ID. How that partitioning occurs varies with isolation requirements and cost constraints.
Each tenant gets dedicated resources in the silo model. Separate compute instances, storage, and sometimes even network segments. This approach provides the strongest isolation but costs the most to operate. Enterprise customers with strict security or compliance requirements often demand silo isolation and typically pay a premium for it, which offsets higher infrastructure costs.
All tenants share the same resources in the pool model, with separation enforced purely through Tenant ID filtering at the application and database layers. This is the most cost-effective approach. It is also the least forgiving. A single bug in query filtering could expose one tenant's data to another. That risk makes robust identity and access management non-negotiable for any pooled architecture.
Most SaaS platforms land somewhere between silo and pool. Standard customers might share pooled resources, while enterprise customers get dedicated database instances or compute clusters. This tiered approach lets vendors optimize costs for the majority while meeting stricter requirements for customers who pay for them. You will often see this reflected in pricing tiers, where the “Enterprise” plan includes dedicated infrastructure.
The database layer is where isolation decisions get concrete. Three common patterns exist:
Why do most SaaS vendors choose multi-tenancy despite its complexity? The benefits compound across both the vendor and customer sides of the equation.
Shared resources mean vendors do not pay for idle capacity sitting in single-tenant instances. When one tenant is quiet, another can use those resources. The savings typically flow through to customers as lower subscription costs.
A single codebase means bug fixes and new features roll out to all tenants simultaneously. There is no version fragmentation, no tracking of which customers are on which releases, and no painful upgrade cycles. When a security vulnerability is patched, everyone gets the fix at once.
New tenants can be provisioned in seconds. Create a Tenant ID, set up their configuration, and they are live. No infrastructure to spin up, no deployment pipelines to run. Identity systems like Ory Kratos enable self-service tenant onboarding, in which customers sign up and start using the product without any manual intervention by the vendor's team.
Pooled resources scale based on aggregate demand rather than per-tenant peaks. Individual tenants benefit from the capacity they could not afford if they were paying for dedicated infrastructure. During traffic spikes, the shared pool absorbs the load across all customers.
Multi-tenancy introduces complexity that requires deliberate engineering to address. The challenges below are not reasons to avoid the architecture; they are risks to design around from the start.
Access control bugs can inadvertently expose data across tenants. According to OWASP, broken access control ranks as the number one web application security risk, and multi-tenant systems have more surface area for access control failures than single-tenant systems. Every database query, every API endpoint, and every file access point requires tenant-scoped authorization. Fine-grained authorization systems like Ory Keto enforce tenant boundaries at the permission layer, which helps prevent cross-tenant access even when application code has bugs elsewhere.
One tenant's heavy usage can degrade performance for others sharing the same resources. A single customer running expensive queries or consuming excessive bandwidth affects everyone in the pool. Common mitigation approaches include:
Some regulations require data to be stored in specific geographic regions or fully isolated from other customers. GDPR, HIPAA, and financial services regulations often carry data residency requirements that pure pooled multi-tenancy cannot satisfy. Architectures that support geographic data partitioning or offer hybrid isolation for regulated tenants address compliance constraints without abandoning multi-tenancy entirely.
A standardized codebase limits how much any single tenant can customize the application. Heavy customization requests that would require code changes are typically declined or priced as custom development work. Configuration flags and feature toggles provide flexibility without forking the codebase. Tenants can enable or disable features, adjust settings, and customize branding within the boundaries defined by the platform.
See how Ory handles B2B multi-tenant identity
Identity is the enforcement layer that makes multi-tenancy secure. IAM associates every user and session with the correct Tenant ID, then ensures that identity context flows through every authorization decision in the system.
Each tenant may use a different identity provider. One customer might require corporate SSO through Okta, another might want social logins, and a third might prefer passwordless authentication with passkeys. The platform handles all these authentication methods and maps each authenticated user to their correct tenant. Ory supports OAuth2 and OpenID Connect, SAML, and passkeys out of the box, with tenant-aware configuration that lets each customer organization choose its preferred authentication methods.
Users within a tenant typically have different permission levels. Admins, members, viewers, and custom roles all coexist within the same tenant organization. Authorization policies are tenant-scoped, meaning an admin in Tenant A has no privileges in Tenant B, even when both tenants use the same role names. Ory Keto implements a Zanzibar-inspired permission model that scales tenant-aware authorization, enforcing relationship-based access control across millions of objects and users. The Ory Permission Language is how you express those tenant-scoped rules.
B2B SaaS often requires tenants to manage their own users, roles, and identity provider connections without involving the vendor's support team. Self-service admin portals reduce operational burden while giving customers control over their identity configuration. Ory supports delegated administration and SCIM provisioning for automated user lifecycle management. When a tenant adds or removes employees in their corporate directory, those changes automatically sync with the SaaS application.
Multi-tenancy powers most of the SaaS products you use daily:
B2B SaaS products built on identity platforms like Ory follow the same pattern, where each customer organization is a tenant with its own users and permissions. If you are designing the data and auth model from scratch, our guide on what to look for in a SaaS starter kit covers the identity decisions that are hard to reverse later.
Ory is purpose-built for multi-tenant B2B SaaS, providing the customer identity and access management infrastructure that enforces tenant boundaries throughout the application stack.
Ory Hydra handles the OAuth 2.0 and OpenID Connect layer, Kratos handles authentication and user management, and Keto handles fine-grained authorization. For a hands-on look at pairing authentication and authorization in one app, see securing a Flask application with Kratos and Keto.
Explore Ory's B2B IAM solution
Yes, for most SaaS applications. Multi-tenancy reduces infrastructure costs, simplifies maintenance, and enables faster customer onboarding. Some enterprise customers may still require single-tenant isolation for compliance, which is why hybrid models exist.
Salesforce is the classic example. Thousands of companies share the same platform, but each company's data and users are logically isolated by Tenant ID. Slack workspaces, GitHub organizations, and most B2B SaaS products follow the same pattern.
Data isolation typically uses one of three approaches: Tenant ID columns in shared tables, separate schemas per tenant within a shared database, or fully isolated databases per tenant. The choice depends on security requirements and cost constraints.
Customization is typically limited to configuration options, feature flags, and UI theming, since all tenants share the same codebase. Deep customization that requires code changes is usually not available in multi-tenant architectures. For where this fits in the wider customer identity picture, see the difference between CIAM vs IAM, as well as our primer on what CIAM is.
See how Ory Kratos and Keto enforce tenant boundaries
Multi-tenancy is not the hard part. The hard part is the boundary between tenants, and that boundary lives entirely in your identity and authorization layer. Tag every request with a Tenant ID, scope every permission to it, and never let a query run without a tenant filter it cannot forget. The teams that treat the tenant boundary as an identity problem from day one ship products that scale. The ones that treat it as a database afterthought end up explaining a cross-tenant leak to their largest customer.