Lesson 7 of 10 Serverless and API Architecture

Designing Multi-Tenant SaaS Architectures with Tenant Isolation

This lesson compares silo, pool and bridge tenancy models and explains how tenant context and isolation are enforced at each layer of a SaaS application.

Learning outcomes

After completing this lesson, you will be able to:

  • Compare the silo, pool and bridge tenancy models.
  • Explain how tenant context is carried securely in identity tokens.
  • Identify isolation mechanisms for IAM, databases and encryption.

Silo, pool and bridge

In the silo model, each tenant has dedicated resources, often a separate account or stack: isolation is strong, per-tenant cost is clear and noisy neighbours cannot occur, but cost and operational effort grow with every tenant. In the pool model, tenants share compute and data stores, which is efficient and easy to operate, but isolation must be enforced on every request and one tenant's load can affect others. The bridge model mixes them by layer (pooled compute with siloed databases) or by tier (pooled basic tenants and siloed premium tenants).

Silo
IsolationStrongest, by account or stack
Cost efficiencyLowest
Noisy neighboursNone
OnboardingProvision a stack per tenant
Choose when Few large or regulated tenants needing dedicated resources.
Pool
IsolationEnforced in code and policies
Cost efficiencyHighest
Noisy neighboursMust be managed with throttling
OnboardingAdd tenant records
Choose when Many small tenants at the lowest cost.

The following diagram compares the three models for two tenants.

Silo, pool and bridge tenancy models. In the silo model each tenant has its own compute and database, giving strong isolation at a cost that grows with every tenant. In the pool model tenants share compute and tables keyed by tenant ID, which is efficient but requires isolation on every request. The bridge model mixes them, for example pooled compute with a database per tenant.
A tick marks a strength and a cross a cost. The bridge model can also pool small tenants and silo premium ones.
Sort into groups

Silo or pool?

Exam skills 1.1.13

Decide which tenancy model each statement describes.

Log in to try this activity Interactive activities are free with an account.

Tenant context and isolation

Every request must carry a trustworthy tenant context. Amazon Cognito (or another identity provider) puts the tenant ID in a token claim, for example a custom attribute set when the user is created, and services read it from the validated token, never from the request body. Isolation is then enforced at each layer: services assume a role with the tenant ID as a session tag, so IAM policies allow access only to that tenant's DynamoDB items (dynamodb:LeadingKeys) or S3 prefixes; relational databases apply row-level security on a tenant column; and tenant-specific KMS keys separate encryption, letting a tenant revoke access to its own data.

Scenario questions

Enforcing tenant isolation

Exam skills 1.1.13 · 2.1.3

Enforce tenant isolation in pooled resources.

Log in to try this activity Interactive activities are free with an account.

Operating a multi-tenant system

  • Noisy neighbours: API Gateway usage plans per tenant tier, per-tenant queues and cell-based partitioning.
  • Onboarding: automated tenant provisioning, with account vending or stack deployment for silo tenants.
  • Metering: tenant ID in logs and metrics to attribute usage and cost to each tenant.
  • Tiering: move a growing tenant from the pool to a silo without changing its identity or APIs.
Worked example

An analytics SaaS

A SaaS company has 3,000 small business tenants and 15 enterprise tenants. Enterprises require dedicated infrastructure and the ability to revoke the provider's access to their data.

Small tenants share pooled ECS services and one DynamoDB table partitioned by tenant ID; each request's tenant comes from the Cognito token, and services use tenant-scoped session tags with dynamodb:LeadingKeys.

Each enterprise tenant gets its own account, vended automatically when the contract is signed, with data encrypted under a KMS key in the tenant's own account. Usage plans per tier limit request rates, so a busy small tenant cannot slow the others.

Check yourself

Why should a service never take the tenant ID from the request body?

Show answer

The client controls the body and could claim another tenant's ID. The tenant must come from a claim in a token that the service validates.

Exam Tips

Remember for the exam

  • Strict isolation and per-tenant cost for a few large tenants: silo, often one account per tenant.
  • Tenant isolation in a pooled DynamoDB table: session tags with dynamodb:LeadingKeys.
  • Trustworthy tenant context: a claim in the validated identity token.
  • Tenant must be able to revoke access to its data: tenant-specific KMS key, ideally in its own account.