multi-tenant-data-partitioner
Skill26 starsChanged 4 months agoMITView on GitHub
Architects database multi-tenancy models (Shared DB/Schema vs Separate Schema vs Separate Database) and tenant routing.
In this repository119 other files it gives its agents.
- adr-writerSkill
- architecture-reviewerSkill
- cache-strategy-plannerSkill
- cost-optimization-auditorSkill
- cqrs-event-sourcing-designerSkill
- disaster-recovery-plannerSkill
- event-driven-architectSkill
- feature-flag-lifecycle-managerSkill
- migration-plannerSkill
- project-plannerSkill
- rate-limiting-architectSkill
- tech-debt-assessorSkill
- zero-downtime-migration-plannerSkill
- api-designerSkill
- bug-hunterSkill
- code-reviewerSkill
- concurrency-race-detectorSkill
- database-architectSkill
- dependency-auditorSkill
- error-handling-architectSkill
- graphql-schema-designerSkill
- legacy-code-refactorerSkill
- memory-leak-detectorSkill
- microservices-boundary-definerSkill
- performance-auditorSkill
- pr-reviewerSkill
- refactor-expertSkill
- resilience-circuit-breaker-designerSkill
- security-auditorSkill
- sql-query-optimizerSkill
- state-machine-designerSkill
- typescript-guardianSkill
- websocket-protocol-designerSkill
- adr-generatorSkill
- changelog-generatorSkill
- codebase-glossary-builderSkill
- commit-message-expertSkill
- contributor-guide-writerSkill
- documentation-writerSkill
- executive-summary-writerSkill
- readme-builderSkill
- release-notes-writerSkill
- rfc-proposal-writerSkill
- runbook-generatorSkill
- sdk-getting-started-writerSkill
- status-update-writerSkill
- ci-cd-pipeline-optimizerSkill
- context-window-optimizerSkill
- git-conflict-resolverSkill
- interview-question-generatorSkill
- meeting-notes-distillerSkill
- monorepo-workflow-architectSkill
- onboarding-guide-generatorSkill
- on-call-handover-writerSkill
- prompt-enhancerSkill
- retro-facilitatorSkill
- task-breakdown-assistantSkill
- tech-debt-burndown-plannerSkill
- cognitive-bias-detectorSkill
- decision-makerSkill
- The first 60 shown.
The file
Files
Purpose
Architect secure, cost-effective, and scalable database multi-tenancy models (Shared Database/Shared Schema with Row-Level Security, Database-per-Tenant, Schema-per-Tenant) tailored to compliance, isolation, and cost constraints.
When to Use
- Designing the data architecture for a B2B SaaS application.
- Enterprise customers requesting strict physical data isolation or custom backup schedules.
- Evaluating database costs vs cross-tenant data leakage risks.
What to Analyze
- Isolation Model Selection:
- Shared Database, Shared Schema (Pool): Highest resource efficiency, lowest cost, enforced via Postgres RLS.
- Separate Schema (Bridge): Logical isolation, schema migration overhead at 1,000+ tenants.
- Separate Database (Silo): Complete physical isolation, highest cost, individual tenant disaster recovery.
- Tenant Context Resolution: Subdomain (
tenant.app.com), JWT claim, or custom HTTP header routing. - Connection Pool Management: Dynamic connection routing without exhausting database connection limits.
- Cross-Tenant Leakage Prevention: Automated query filters and database-enforced Row-Level Security (RLS).
- Noisy Neighbor Defense: Per-tenant query rate limits and compute quotas.
Output Format
- Multi-Tenancy Tradeoff Matrix: Comparison of Pool vs Bridge vs Silo for your specific scale.
- Postgres Row-Level Security (RLS) Policy: SQL script enforcing
tenant_idsession boundaries. - Tenant Routing Middleware: Code extracting and injecting tenant context into database queries.
Avoid
- Relying solely on application-level
WHERE tenant_id = :idqueries without database-level RLS enforcement. - Creating 10,000 PostgreSQL schemas on a single instance (causes heavy catalog metadata lock contention).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

