Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Multi Tenancy?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ansh44233-multi-tenancy)
---
description: Isolate tenant data in SaaS apps with enforced tenant scoping, per-tenant limits and safe migrations
profile: full
tags: saas, multi-tenancy, security, database
---
# Multi-tenancy
Cross-tenant data leaks are the worst SaaS bug. Make isolation structural, not remembered.
## Isolation model
- Choose: shared tables with `tenant_id`, schema-per-tenant, or database-per-tenant; document why.
- With shared tables, enforce scoping centrally (row-level security, ORM default scope, repository layer), not in each query by hand.
## Request handling
- Tenant comes from the authenticated session or verified subdomain, never from a request field alone.
- Every cache key, queue message, search query and file path includes the tenant.
## Operations
- Per-tenant rate limits and quotas; noisy-neighbor protection.
- Tenant deletion and export paths that reach every store.
## Verify
A test logs in as tenant A and tries to read, update and list tenant B's records by id and via search: all are denied or empty.