$npx skillfedfor your agent

Multi Tenancy

Master multi-tenant SaaS design with three isolation models—shared database with shared schema, schema-per-tenant, or dedicated databases. This skill covers tenant context management, middleware routing, automatic query scoping, and per-tenant configuration in TypeScript and Python.

Multi Tenancy teaches you to build SaaS applications that securely serve multiple organizations with isolated data and per-tenant configuration.

AI-generated summary based on this skill's SKILL.md

782 63 unlicensed, metadata onlyupdated by dadbodgeoff

Decision gist · record as of 2026-05-31

Multi Tenancy teaches you to build SaaS applications that securely serve multiple organizations with isolated data and per-tenant configuration. Master multi-tenant SaaS design with three isolation models—shared database with shared schema, schema-per-tenant, or dedicated databases. This skill covers tenant context management, middleware routing, automatic query scoping, and per-tenant configuration in TypeScript and Python.

manual: git clone https://github.com/dadbodgeoff/drift → cp -r drift ~/.claude/skills/multi-tenancy

Use it when

  • Multi Tenancy isolation strategies include three core models: shared database with shared schema (lowest cost, highest complexity).
  • Multi Tenancy architecture implementation starts with selecting your isolation model.
Same gist for agents: .md · .json

Install

dadbodgeoff/drift/multi-tenancy · repository language: TypeScript

generated, unverified - the skill's exact subdirectory could not be determined; check the repository on GitHub

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I set up multitenancy for a SaaS application?

Multi Tenancy setup involves choosing an isolation model—shared database with shared schema, schema-per-tenant, or dedicated databases—then implementing tenant context management and middleware routing. You'll configure automatic query scoping to ensure each tenant accesses only their data, set up per-tenant configuration handling, and establish provisioning automation. TypeScript and Python examples show how to inject tenant context through request middleware and apply it consistently across your application layer.

What are the main tenant isolation strategies in multi-tenant systems?

Multi Tenancy isolation strategies include three core models: shared database with shared schema (lowest cost, highest complexity), schema-per-tenant (moderate isolation, easier debugging), and dedicated databases (strongest isolation, highest cost). Each strategy requires different tenant data separation approaches—shared schema uses row-level security and tenant ID columns, schema-per-tenant uses PostgreSQL schemas or similar constructs, and dedicated databases use separate connection strings. Middleware routing and automatic query scoping enforce isolation at the application level regardless of database model chosen.

How to implement multi tenant architecture with proper data separation?

Multi Tenancy architecture implementation starts with selecting your isolation model, then building tenant context management into your request pipeline. Use middleware to extract tenant identifiers from headers, subdomains, or JWT claims, then pass context through your application. Implement automatic query scoping by wrapping database queries with tenant ID filters. For schema-per-tenant, route connections to the appropriate schema; for shared schema, append WHERE tenant_id = ? to all queries. Configure per-tenant settings separately and automate tenant provisioning to create resources on demand.

What are multitenancy best practices for SaaS applications?

Multi Tenancy best practices include: enforce tenant isolation at multiple layers (middleware, ORM, database), use parameterized queries to prevent cross-tenant data leaks, implement comprehensive audit logging per tenant, automate tenant provisioning and resource allocation, monitor per-tenant resource usage, and design your schema to make tenant context explicit. Avoid implicit tenant assumptions; always require tenant context in queries. Test isolation thoroughly with multi-tenant test data. Use connection pooling efficiently across tenants and implement rate limiting per tenant to prevent resource exhaustion.

What is multi-tenant database design and how does it differ?

Multi Tenancy database design varies by isolation model: shared database with shared schema stores all tenants' data in one schema with a tenant_id column on every table; schema-per-tenant creates separate schemas per tenant within one database; dedicated databases provision entirely separate database instances per tenant. Shared schema is most cost-efficient but requires strict query discipline. Schema-per-tenant offers better isolation and easier per-tenant migrations. Dedicated databases provide maximum isolation and independent scaling but highest operational overhead. Choose based on tenant count, data sensitivity, and cost constraints.

How do you configure tenant provisioning and resource allocation?

Multi Tenancy provisioning automation creates new tenant resources on signup or request. For shared schema, insert tenant metadata and initialize default settings. For schema-per-tenant, create a new schema and run migrations. For dedicated databases, provision a new database instance and connection pool. Implement resource allocation policies—set storage quotas, API rate limits, and concurrent user limits per tenant. Use background jobs to handle provisioning asynchronously. Track resource usage per tenant and implement auto-scaling or quota enforcement. Store tenant configuration centrally and make it accessible to all application instances for consistent per-tenant behavior.

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Learn how to design and implement multi-tenant architecture”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

multi-tenant-architecture
by mblode · mblode/agent-skills

Plan a multi-tenant SaaS platform by choosing between Cloudflare Workers and Vercel, then work through tenant identification, isolation, routing, context propagation, and custom domain support. Maps platform limits to pricing tiers and covers domain strategy decisions including PSL submission.

MITupdated Jul 2026
★ 71repo stars
saas-platforms
by miles990 · miles990/claude-software-skills

Learn to architect multi-tenant SaaS platforms with database isolation strategies, Stripe subscription management, and usage tracking. Covers tenant context injection, row-level security, plan entitlements, and webhook handling for production-ready billing systems.

MITupdated Jan 2026
★ 19repo stars
Multitenant
by TheBeardedBearSAS · TheBeardedBearSAS/claude-craft

Build multitenant applications with three isolation tiers—from cost-effective shared schema to enterprise-grade dedicated databases—each with automatic tenant filtering and PostgreSQL Row-Level Security. Covers RBAC/ABAC patterns, field-level encryption for sensitive data, and critical anti-patterns to avoid cross-tenant data leaks.

MITfor claude-codeupdated Jul 2026
★ 99repo stars
agentsop-multi-tenant-rag
by agentsope · agentsope/SkillAlchemy

This skill encodes security-first isolation patterns for RAG systems serving multiple tenants, customers, or permission scopes. It teaches agents to enforce tenant filtering at the vector store query boundary—the only place where isolation truly matters—and pairs vendor-specific primitives (Pinecone namespaces, Weaviate multiTenancy, Qdrant payload filters, pgvector RLS) with framework adapters like LlamaIndex and LangChain. Activate when designing, reviewing, or debugging any retrieval pipeline where the corpus spans more than one tenant.

MITupdated Jun 2026
★ 219repo stars
prowler-api
by prowler-cloud · prowler-cloud/prowler

This skill guides implementation of Prowler's multi-tenant API architecture, covering row-level security enforcement, role-based access control, provider validation, and async task patterns. Learn the 4-database setup, RLS model constraints, M2M through-model requirements, and critical decorator ordering for tenant-isolated operations.

Apache-2.0updated Jul 2026
★ 14,491repo stars
qdrant-tenant-scaling
by qdrant · qdrant/skills

This skill explains how to architect Qdrant for multiple tenants at scale. It covers payload-based filtering for smaller deployments, custom sharding to localize tenant data across 100k+ tenants, and tiered multitenancy for uneven tenant sizes. It also clarifies when strict isolation via separate collections is justified and what practices to avoid.

Apache-2.0updated Jul 2026
★ 209repo stars

More skills multi-tenant-llm-hosting (MIT) · qdrant-multitenancy (Apache-2.0)

Tags
tenant-isolationsaas-architecturemulti-user-systemsdata-segregationscalable-applicationstenant-managementresource-sharingdeployment-patterns