dev-toolbelt/dev-team-agents/database-multitenancy
Claude Code and agent skill by dev-toolbelt/dev-team-agents
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Multi-tenancy DB — RLS, schema-per-tenant, database-per-tenant.
Install
npx vskill@latest install dev-toolbelt/dev-team-agents/database-multitenancySKILL.md
The same SKILL.md was published earlier as dev-toolbelt/dev-team-agents/database-multitenancy.
Choosing a Multi-Tenancy Strategy
| Strategy | Isolation | Migration complexity | Cost | Best for | |
|---|---|---|---|---|---|
| Row-Level Security (RLS) | Logical (DB-enforced) | Single schema | Low | SaaS with many tenants, PostgreSQL-native stacks | |
| Schema-per-tenant | Strong (namespace) | Multiplies with tenant count | Medium | ≤ a few hundred tenants, data residency requirements | |
| Database-per-tenant | Maximum | Highest (separate infra) | High | Regulated industries (HIPAA, SOC 2), contractual isolation |
Default recommendation: start with RLS. Move to schema-per-tenant only when tenant count or compliance demands it. Never add database-per-tenant complexity speculatively.
Detection Signals
| Signal | Multi-tenancy indicator | |
|---|---|---|
tenant_id column in schema | RLS or shared-schema approach | |
| Multiple schemas with identical structure | Schema-per-tenant | |
| Multiple databases with identical structure | Database-per-tenant | |
app.tenant_id in SQL or ORM config | RLS with session variable | |
| PgBouncer in transaction mode | RLS with SET LOCAL required |
Quick Rules
- Always use
FORCE ROW LEVEL SECURITY— not justENABLE— so the table owner is also subject to policies. - Use
SET LOCAL app.tenant_idinside transactions, never at session level, when connection pooling is present. - Include
tenant_idas the leading column in all composite indexes on multi-tenant tables. - Never trust
user_metadatafor access control in Supabase — useapp_metadataonly.
Load on Demand
| When | Load | |
|---|---|---|
| Implementing RLS, schema-per-tenant, database-per-tenant, or pgvector with multi-tenancy | references/tenant-isolation.md |
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/integrations/database-multitenancy/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dev-toolbelt/dev-team-agents/database-multitenancy)