Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

2.1.1.11. Multi-Tenant SaaS Isolation Patterns (Silo, Pool, Tenant Context)

2.1.1.11. Multi-Tenant SaaS Isolation Patterns (Silo, Pool, Tenant Context)

💡 First Principle: Tenant isolation must hold even when application code has a bug. The tenant's identity has to come from a trusted source, and something below the application (IAM, the database or the key) has to refuse cross-tenant access.

  • Isolation models: Silo gives each tenant its own resources (an account, a stack, a database), the strongest isolation with the highest cost and operational load. Pool shares resources and enforces isolation through tenant context, the cheapest and easiest to operate. Bridge mixes them per layer, for example pooled compute with siloed data. Tiering lets premium or regulated tenants get silo resources while the long tail stays pooled.
  • Tenant context from identity: Put the tenant ID in the user's identity, for example a "Amazon Cognito" user pool custom attribute (custom:tenant_id) or group that appears as a claim in the token. API Gateway validates the token (Cognito authorizer or Lambda authorizer) and passes the tenant ID to the backend. A tenant ID taken from a query string, header or request body can be changed by the caller and is not a trust boundary.
  • Scoped credentials for pooled AWS resources: The service assumes a role with the tenant as a session tag (or with a tenant-specific session policy). Policies then use ${aws:PrincipalTag/TenantId}: dynamodb:LeadingKeys limits DynamoDB access to items whose partition key is that tenant, and S3 resource ARNs or s3:prefix conditions limit access to the tenant's prefix. A coding error in a query then fails with AccessDenied instead of returning another tenant's data.
  • Relational data: Row-level security in Aurora PostgreSQL attaches a policy to each pooled table so that every query only sees rows whose tenant_id matches a session setting the application sets per request or connection; a query that forgets its WHERE clause still returns only that tenant's rows. Schema-per-tenant and database-per-tenant are bridge and silo variants with more objects to operate.
  • Tenant-specific encryption: A per-tenant KMS key lets you show a tenant its own key usage in CloudTrail and revoke or disable one tenant's key (crypto-shredding) without touching others; with a shared key, put the tenant ID in the encryption context and require it with kms:EncryptionContext conditions.
  • Noisy neighbours: API Gateway usage plans per tenant tier throttle request rates and quotas so one tenant cannot exhaust shared capacity.

⚠️ Exam Trap: Treating an application-level WHERE tenant_id = ? filter, or a tenant ID passed as a request parameter, as tenant isolation. The exam expects enforcement the application cannot bypass: scoped IAM credentials, row-level security, or separate resources.

See how it connects
Alvin Varughese
Written byAlvin Varughese
Founder•20 professional certifications