Multi-tenant SaaS design
One product, many customers
A tenant is an organizational boundary in a service: a customer may have many users, roles and records. Multi-tenant SaaS provides a common product and operating model to multiple tenants, even when some infrastructure is dedicated. Tenant isolation means preventing access to another tenant's resources, not just displaying a different customer name in the UI.
Imagine Papertrail, a fictional invoice application. Cedar and Maple share an application deployment but have different users and invoices. Cedar's invoice 7 and Maple's invoice 7 must remain separate. A user can belong to multiple organizations, but every request must select a tenant for which their current identity is authorized. All examples use synthetic data.
Choose pool, silo or bridge by resource
| Pattern | Example | Benefit | Cost or risk |
|---|---|---|---|
| Pool | Shared API and database tables | High resource utilization, uniform upgrades | Strong logical access checks and contention controls required |
| Silo | Dedicated application and database per tenant | Smaller tenant-level failure domain | More idle capacity, fleet maintenance and quotas |
| Bridge | Shared API, dedicated database for selected tenants | Isolation where needed without duplicating every component | Routing, credential and migration complexity |
A silo can still share identity, deployment pipelines, billing and operational management. A pool can be secure when controls enforce separation; a dedicated database can be insecure if the API routes requests incorrectly. Choose boundaries by data sensitivity, performance requirements, service limits, contract and cost. A deployment stamp is an independently operated copy of a system serving one or more tenants. More stamps can reduce outage scope, but a shared stamp still requires isolation inside it.
See AWS full stack isolation, Azure tenancy models, and deployment stamps.
Partition data without confusing it with authorization
Partitioning means placing data into logical or physical groups. Use a composite key (tenant_id, invoice_id) so identical local IDs do not collide. Pooled relational tables can use database row policies where supported, tenant-scoped queries and constrained database roles. Separate schemas or databases strengthen some boundaries but require correct tenant-to-database routing and credential scoping. Backups, caches, queues, search indexes and exports must preserve the same ownership boundary. A cache key needs both tenant and object identifiers, and sometimes role or permission context.
AWS guidance on SaaS data partitioning distinguishes placement from isolation in its Neptune context. Google Cloud Spanner guidance compares several placement levels; separate databases on one instance can still share underlying resources. GKE multi-tenancy guidance discusses isolation at cluster, namespace, node, Pod and container layers. A namespace alone is not a complete security boundary. These are service-specific examples, not equivalent guarantees.
Design the request and operational boundaries
[User] -> [Identity verification] -> [Membership and role check] | [Tenant routing registry] | [API + tenant-scoped data access] | | [Shared database] [Dedicated database] | | [Scoped backup and recovery]
[Control plane] -> onboarding, tiers, routing, migration, offboarding[Restricted audit sink] <- tenant-scoped decision metadataThe control plane manages tenancy and configuration; the data plane handles invoice requests. Never accept a tenant claim from an unverified header as proof of membership. Verify identity, resolve tenant membership server-side, check action permission, and independently scope the data query. Workers must validate queued job ownership before processing. Audit logs should capture tenant, action, result, request ID and time without tokens or invoice contents; denied attempts belong in a restricted security stream rather than a victim tenant's customer dashboard. Operations staff need separate, time-limited, audited support access. The customer manages its users and data choices; the SaaS provider operates the product, isolation, recovery and agreed service controls; underlying cloud responsibilities still depend on service and contract.
Limit noisy neighbors and budget capacity
A noisy neighbor consumes shared capacity and degrades other tenants. Use tenant-specific request and job limits, concurrency caps, fair scheduling, separate connection pools where justified, and platform-wide admission control. A tier defines entitlements, not guaranteed throughput unless specified. Configuration must be versioned and validated against entitlements on the server.
Assume a stamp can sustain 240 requests/s in a representative fictional test. Reserve 25% headroom, so admit at most 180 requests/s in steady state. Cedar and Maple have tier ceilings of 100 and 60 requests/s. At their ceilings, 20 requests/s remains for other admitted traffic. If a third tenant needs 50, the aggregate 210 exceeds the safe target by 30. Throttle or add verified capacity before admission; actual performance must be measured, including database, retries and burst behavior. A cap per tenant does not itself prevent exhaustion of shared dependencies.
Monitor request rate, error rate, latency, throttling and queue age by tenant or tier, with restricted access and bounded metric cardinality. A fleet average can hide one struggling tenant. See AWS noisy neighbor.
Lifecycle and recovery are part of the design
Onboard with a unique immutable tenant ID, verified administrator, plan and region, idempotent provisioning and a readiness check before activation. Configure routing and access policy together. For tier changes, copy only the tenant's records into the approved target, reconcile counts and content, freeze writes or use verified replication, update routing atomically and retain a tested rollback path. Do not copy all pooled records into a tenant export.
Offboarding first revokes access and stops scheduled jobs; export only authorized data, apply legal holds and contract retention rules, then remove active records, indexes, caches, replicas and credentials with recorded verification. Backups may expire on a different schedule; prevent deleted records from silently reappearing after restore. A tenant restore from a shared backup should use a restricted temporary environment, extract and validate only the intended tenant's records, and avoid overwriting unrelated live records. Measure RPO and RTO by tier; a backup setting is not recovery evidence. See Azure tenant lifecycle.
Practice: choose a bridge design for Cedar (shared) and Maple (dedicated data), specify two independent authorization controls, draw data and backup boundaries, calculate headroom, and list the offboarding verification steps.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Multi-tenant SaaS design — knowledge check
Choose the best answer for each offline scenario.
What does a bridge design combine?
What does a tenant ID in a table establish by itself?
A stamp sustains 240 requests/s with 25% reserved headroom. What is its planned admission target?
What is required before switching tenant routing during migration?
What should a tenant restore from a pooled backup avoid?