multi-tenancy

Implement multi-tenant architecture with tenant isolation and automated query scoping.

783|62|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/dadbodgeoff/drift --skill multi-tenancy-dadbodgeoff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: multi-tenancy
Source: https://github.com/dadbodgeoff/drift/tree/main/drift%20v1%20depreciated/skills/multi-tenancy
Command: npx skills add https://github.com/dadbodgeoff/drift --skill multi-tenancy-dadbodgeoff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables the development of robust multi-tenant SaaS applications, ensuring secure data separation and customized experiences for each organization.

Core Features & Use Cases

  • Tenant Isolation Models: Supports shared database/schema, schema-per-tenant, and database-per-tenant strategies.
  • Context Management: Implements AsyncLocalStorage in TypeScript and ContextVar in Python for managing tenant context across requests.
  • Automated Query Scoping: Integrates with ORMs like Prisma to automatically filter and scope database operations by tenant.
  • Per-Tenant Configuration: Manages unique branding, feature flags, and integrations for each tenant.
  • Use Case: Building a SaaS project management tool where each client company (tenant) has its own isolated workspace, users, and project data, all managed through a unified codebase.

Quick Start

Implement tenant isolation in your application by integrating the provided tenant middleware and context management utilities.

Frequently Asked Questions about multi-tenancy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I isolate data between tenants in a SaaS application?

Data isolation in multi-tenant SaaS applications is achieved by implementing shared database, schema-per-tenant, or database-per-tenant models, ensuring secure data separation and customized experiences for each organization.

What is the best way to manage tenant context across async requests in Python?

Managing tenant context across async requests in Python uses ContextVar, while TypeScript uses AsyncLocalStorage, maintaining tenant state throughout the request lifecycle for accurate query scoping.

Can I automatically scope database queries by tenant with Prisma?

Yes, you can automatically scope database queries by tenant with Prisma. This Skill integrates with ORMs like Prisma to automatically filter and scope database operations based on the active tenant context.

When should I use a schema-per-tenant vs a database-per-tenant architecture?

Choose schema-per-tenant for logical separation within a shared database, or database-per-tenant for complete physical data isolation, depending on your SaaS application's security and scalability requirements.

How to handle per-tenant configuration for branding and feature flags?

Handle per-tenant configuration for branding and feature flags by implementing tenant context management, allowing your SaaS application to manage unique branding, feature flags, and integrations for each tenant.