Multi-Tenant SaaS Architecture: Design, Isolation, Security and Scalability
A practical guide to choosing tenancy models and enforcing tenant isolation across identity, databases, caches, storage, queues and operations.

Multi-Tenant SaaS Architecture: Design, Isolation, Security and Scalability
A multi-tenant application lets multiple customers use a shared software platform while keeping each customer’s data, permissions and workloads appropriately separated. The model can reduce duplicated infrastructure and simplify operations, but it changes the consequences of a design mistake: a missing tenant filter, incorrectly scoped cache entry or overloaded shared queue can affect more than one customer.
The central design question is not simply whether to share a database. It is which parts of the system should be shared, which require isolation, and how tenant context is enforced across every path that touches customer data.
First, define what a tenant is
A tenant is the customer boundary used by an application to group users, data, configuration and entitlements. In a business-to-business product, one tenant commonly represents a customer organisation, with multiple employees or service accounts inside it. In a consumer product, a tenant might represent an individual, household or another user group.
A tenant is not necessarily the same thing as a user, account, workspace, subscription or identity-provider directory. Those concepts can map to one another, but the mapping must be explicit. Microsoft’s architecture guidance distinguishes a SaaS business model from multitenancy as an architectural approach: SaaS describes how software is delivered, while multitenancy describes how components are shared across tenants. A SaaS product can use dedicated infrastructure for some customers, and a multitenant platform can also serve internal business units rather than paying customers.
That distinction affects data ownership, membership, billing, support access and the way users switch between organisations. A person may belong to several tenants, each with different roles and permissions. The application must resolve the active tenant and verify that the authenticated identity is allowed to act within it; a tenant identifier supplied by a browser is not proof of access.
Three common tenancy models
The familiar silo, bridge and pool labels describe common patterns, especially at the database and application layers. They are not a rule that every component must follow the same model.

Silo: dedicated resources per tenant
In a silo model, each tenant receives a dedicated application stack, database or both. This offers a strong infrastructure boundary and can make tenant-specific backup, recovery, regional placement or performance management easier.
The trade-off is operational cost. More deployments, databases, credentials, monitoring targets and upgrades must be managed. A silo model also does not automatically make a product secure: identity, administrative access, deployment automation and support tooling still need controls.
Siloing is useful when a customer has strict isolation, regulatory, residency, recovery or workload requirements, or when a high-volume tenant would otherwise dominate shared capacity.
Bridge: shared application, separate schemas
In a bridge model, tenants share the application stack and database instance, but each tenant has a separate schema. This can reduce infrastructure duplication while retaining a database-level organisational boundary.
The application must still select the correct schema using trusted tenant context. Provisioning, migrations, connection permissions and schema discovery become more involved as the tenant count grows. A shared database instance also means tenants can still compete for the same underlying compute, storage and connection capacity.
Pool: shared tables, tenant-scoped rows
In a pool model, tenants share application services and database objects. Rows belonging to different tenants coexist in the same tables, and a tenant key or equivalent policy determines which records a request can access.
This often offers high resource density and can simplify schema migrations. It also places greater pressure on the correctness of every data-access path. A missing tenant predicate or an overly broad administrative query can expose records across customer boundaries.
AWS describes silo, bridge and pool as a spectrum of isolation, cost and complexity, and notes that a hybrid approach is possible. A product might pool ordinary customers while assigning dedicated databases or messaging infrastructure to customers with different risk or workload requirements.
Choose isolation per component, not by slogan
The database model is only one part of the architecture. A tenant boundary can be crossed through an API, cache, file store, background worker, search index, analytics pipeline, log viewer or support console.
A useful design exercise is to classify each component as global, tenant-scoped, user-scoped or explicitly cross-tenant. Then decide what enforces that boundary. A tenant ID in a table is useful, but a column alone is not an access-control mechanism.
| Component | Questions to answer |
|---|---|
| API and application services | Is tenant context resolved from authenticated identity and checked for every tenant-owned resource? |
| Database | Are queries scoped, and is there a database-level control where appropriate? |
| Cache and sessions | Do keys include tenant and any user, role, locale or permission attributes that change the result? |
| Object storage | Is each object authorised for the tenant, rather than merely stored under a tenant-looking path? |
| Queues and workers | Is tenant context bound to the job by a trusted producer and re-authorised by the consumer? |
| Search and analytics | Can filters, exports or dashboards return records outside the caller’s tenant? |
| Logs and support tools | Are tenant context and actor recorded, and are cross-tenant views separately authorised? |
Identity: authenticate the person, authorise the tenant action
Authentication answers who the user is. Authorisation answers what that user may do. Multitenant applications need both the user identity and the tenant context for a request.
A common approach is to issue a token containing a tenant claim and, where appropriate, role or permission information. Another approach keeps membership data in the application and checks it when the request is handled. Either way, the system must verify that the user belongs to the selected tenant and has permission for the requested resource and action.
Do not treat a URL segment, request parameter or custom HTTP header such as X-Tenant-ID as an authority. It can express which tenant the user wants to work in, but the server must validate that selection against authenticated membership or an explicitly authorised service identity. A user who belongs to several organisations should be able to switch context deliberately, with the active tenant reflected in the resulting authorisation decision.
Support impersonation deserves additional controls. If support staff can act as a customer user, record both the support actor and the impersonated identity, restrict the capability, and make its use auditable. Microsoft’s identity guidance highlights federation, tenant-specific identity requirements and the distinction between role-based and resource-based authorisation.
Database isolation and PostgreSQL row-level security
For a pooled relational database, application-level tenant filters should be consistent and difficult to bypass. PostgreSQL Row-Level Security (RLS) can add a database-enforced layer: after RLS is enabled on a table, normal reads and writes must be permitted by a policy. If RLS is enabled and no applicable policy exists, PostgreSQL uses default-deny behaviour.
A policy might compare a row’s tenant identifier with a trusted tenant value established for the current transaction. The exact policy needs to cover the operations the application supports, including reads and writes. PostgreSQL policies can use separate USING and WITH CHECK expressions to control which existing rows are visible or targetable and which new or changed rows are allowed.
RLS is not a substitute for correct database roles. PostgreSQL documents important exceptions: superusers and roles with BYPASSRLS always bypass row security, and table owners normally bypass it unless row security is forced for the table. The ordinary application role should not have those bypass privileges if RLS is intended to be part of the tenant boundary.
Connection pooling introduces another failure mode. If tenant context is stored in a connection-level setting and the connection is reused, the next request could inherit stale context unless it is reset reliably. OWASP recommends transaction-local tenant context, re-established for each transaction, and failing closed when the context is absent or invalid. Test connection reuse and rollback paths rather than assuming a pool will isolate requests automatically.

Caches, files and asynchronous jobs are part of the boundary
A correct database query does not protect data copied into a shared cache. If a cached response varies by tenant, the tenant must be part of the cache key. The same applies to user permissions, locale, feature flags or other attributes that change the response. Authorisation should happen before returning protected cached data; a tenant-aware key does not replace the permission check.
For object storage, a prefix such as tenants/acme/ is an organisational convention, not an authorisation control by itself. The service must authorise the tenant, object and operation before issuing a download or upload URL. Deletion and retention workflows must account for object versions, replicas and backups.
Background jobs need the same discipline. A shared queue is not automatically an isolation boundary. The producer should attach tenant context through a trusted, authenticated path, and the consumer should re-establish that context and authorise the target operation. Retry state, idempotency keys, dead-letter access and job results may also need tenant scope. A delayed job may need to re-check membership or permissions because access can change after the job is queued.
Scalability and the noisy-neighbour problem
Shared infrastructure creates economies of scale, but it also creates shared bottlenecks. A tenant generating unusually high API traffic, database load, queue volume or report exports can degrade service for others. This is the noisy-neighbour problem.
Controls should match the resource being shared: tenant-aware rate limits, quotas, queue-depth limits, concurrency controls, database connection budgets and workload isolation. Keep service-wide limits as well; per-tenant limits alone do not prevent aggregate exhaustion. Monitor resource consumption by tenant so capacity and pricing decisions are based on actual usage rather than guesswork.
A hybrid model can move a tenant or a specific component to dedicated infrastructure when its traffic, compliance requirements or recovery objectives justify the added cost. AWS and Microsoft both describe hybrid or component-level isolation as valid approaches. The important requirement is to preserve a unified operational model: onboarding, deployment, monitoring, billing and support should continue to work across different tenancy placements.
Onboarding, offboarding and recovery
Tenant lifecycle operations are security-sensitive. Provisioning should create the tenant’s membership, configuration, storage and any dedicated resources as one controlled workflow. It should be repeatable and observable, with a clear response to partial failure.
Offboarding is more than disabling login. Revoke sessions and credentials, remove or suspend memberships, stop scheduled jobs, apply the documented retention policy and ensure tenant-owned objects are handled consistently. Backups and replicas complicate deletion and recovery: a restore for one tenant must not unintentionally expose or overwrite another tenant’s live data.
Audit events should record the verified tenant context and the actor where one exists, without copying secrets or unnecessary personal data into logs. Monitor denied cross-tenant access attempts and unusual administrative activity. Tenant administrators should not automatically receive platform-wide audit access.
A practical design checklist
Before launching a multitenant service, verify that the architecture can answer these questions:
- Is the tenant definition explicit, including users who belong to multiple tenants?
- Is tenant selection validated against authenticated membership or service scope?
- Does every tenant-owned API operation enforce both tenant scope and resource permission?
- Are database access controls tested for cross-tenant reads, inserts, updates and deletes?
- Can the normal application database role bypass RLS or access another tenant’s schema?
- Are cache keys, files, search results, exports, queues and job results tenant-aware?
- Are shared resources protected by tenant-level and service-wide quotas?
- Are support impersonation and cross-tenant administration separately authorised and audited?
- Can one tenant be onboarded, offboarded, backed up and restored without affecting another?
- Are isolation tests run for every tenant-owned data path, including failure and retry paths?
Multitenancy is not a single database pattern. It is a system-wide contract about who can access which resources, under what identity, and with what operational limits. Silo, bridge and pool are useful starting points, but mature architectures often combine them. The right design is the least complex model that meets the product’s security, compliance, performance, recovery and cost requirements—and can prove those boundaries through tests and operations.
AI-assisted content
This story was drafted and/or edited with AI assistance and reviewed before publishing.
Explore more topics
Related stories

Multi-Tenant Architecture in SaaS: Isolation Models, Security and Scaling
A practical guide to multi-tenant architecture in SaaS: compare silo, bridge and pooled models, design tenant-aware identity and data access, and prevent cross-tenant leaks across databases, APIs, caches, storage and background jobs.

OpenAI and Cisco Launch Shirudo, an Experimental Runtime Shield for Linux
OpenAI and Cisco have open-sourced Shirudo, a project designed to deploy temporary protections while teams prepare software patches. Its first public demonstration is narrow, and the project’s own documentation says it is not ready for production.
