single-database-tenant-isolation

Community

Enforce true tenant isolation in a shared database.

Authormarquesfelip
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Tenant isolation in a single shared database is challenging; this skill provides patterns and steps to ensure data belonging to one tenant cannot be accessed by another, preventing cross-tenant leakage and performance degradation.

Core Features & Use Cases

  • Audit data model to classify tables as tenant-scoped, platform-level, or cross-tenant data.
  • Add and enforce tenant_id columns, backfill strategies, and not-null constraints with safe migrations.
  • Implement ORM global scopes or repository patterns to automatically filter by tenant_id.
  • Design and enforce leading-column indexes on tenant_id for all tenant-scoped queries.
  • Provide safe cross-tenant access paths for admin or platform operations and corresponding tests.

Quick Start

Audit the current data model, add a NOT NULL tenant_id column to all tenant-scoped tables, and enable automatic tenant filtering in your ORM or data access layer.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: single-database-tenant-isolation
Download link: https://github.com/marquesfelip/agents-and-skills/archive/main.zip#single-database-tenant-isolation

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.