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-multitenancy

SKILL.md

The same SKILL.md was published earlier as dev-toolbelt/dev-team-agents/database-multitenancy.

Choosing a Multi-Tenancy Strategy

StrategyIsolationMigration complexityCostBest for
Row-Level Security (RLS)Logical (DB-enforced)Single schemaLowSaaS with many tenants, PostgreSQL-native stacks
Schema-per-tenantStrong (namespace)Multiplies with tenant countMedium≤ a few hundred tenants, data residency requirements
Database-per-tenantMaximumHighest (separate infra)HighRegulated 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

SignalMulti-tenancy indicator
tenant_id column in schemaRLS or shared-schema approach
Multiple schemas with identical structureSchema-per-tenant
Multiple databases with identical structureDatabase-per-tenant
app.tenant_id in SQL or ORM configRLS with session variable
PgBouncer in transaction modeRLS with SET LOCAL required

Quick Rules

  • Always use FORCE ROW LEVEL SECURITY — not just ENABLE — so the table owner is also subject to policies.
  • Use SET LOCAL app.tenant_id inside transactions, never at session level, when connection pooling is present.
  • Include tenant_id as the leading column in all composite indexes on multi-tenant tables.
  • Never trust user_metadata for access control in Supabase — use app_metadata only.

Load on Demand

WhenLoad
Implementing RLS, schema-per-tenant, database-per-tenant, or pgvector with multi-tenancyreferences/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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dev-toolbelt/dev-team-agents/database-multitenancy/badge)](https://verified-skill.com/skills/dev-toolbelt/dev-team-agents/database-multitenancy)

Something wrong with this skill or its page? Tell us.