saas-multi-tenant
使用 PostgreSQL 和 TypeScript 设计并实现多租户 SaaS 架构,涵盖行级安全、租户范围查询、共享 schema 隔离及安全的跨租户管理模式。
译文已校对查看英文原文
Design and implement multi-tenant SaaS architectures with row-level security, tenant-scoped queries, shared-schema isolation, and safe cross-tenant admin patterns in PostgreSQL and TypeScript.
适用对象:数据库。自动收录 · 待核查。
原作者说明节选
从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。
查看英文原文
原文涵盖的主题
- SaaS Multi-Tenant Architecture
- When to Use This Skill
- Core Workflow
- Examples
- Example 1: PostgreSQL RLS Policy for Tenant Isolation
- Example 2: Express Middleware That Sets Tenant Context per Request
- Example 3: Prisma Middleware for Automatic Tenant Scoping
- Never Do This
The user is building a SaaS application where multiple customers share the same database The user asks about tenant isolation, row-level security, or data leakage prevention The user needs to scope every database query to a specific tenant without manual WHERE clauses The user asks about shared-schema vs schema-per-tenant vs database-per-tenant tradeoffs The user is implementing admin endpoints that must access data across tenants The user needs to add tenantid columns to an existing single-tenant application The user asks about PostgreSQL RLS policies for tenant isolation The user is building tenant-aware middleware in Express, Fastify, or Next.js API routes Do NOT use this skill when: The user is building a single-user application with no shared infrastructure The user asks about authentication only without tenant scoping (use an auth skill instead) The user needs general database schema design without multi-tenancy requirements 1. Determine the tenancy model. Ask the user about their scale expectations and isolation requirements. For most SaaS apps under 1000 tenants, shared-schema with a tenantid column on every table is the correct default. Schema-per-tenant adds operational o
这里只展示节选,请以完整原文和当前要求为准。
- 来源仓库
- davila7/claude-code-templates
- 源文件
- cli-tool/components/skills/development/saas-multi-tenant/SKILL.md
- 固定版本
- 21be197f100a12b8d0dd9a211cc244c8179f84d3
来源与内容状态
本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。
原作者:davila7/claude-code-templates · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-09T14:01:44.696Z。
分类由名称、说明与路径规则生成,分类不代表已核实适配。
许可与权利归属
MIT。第三方内容及版权归原作者,使用条件以原文为准。
许可原文 ↗本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。
限制与注意事项
- 元数据收录不代表本站已经安装、适配、实测或进行安全审查。