关于
This skill provides architectural guidance for implementing tenant isolation in Qdrant vector databases. It helps developers choose between payload-based, shard-based, or collection-based isolation strategies based on tenant count and data size distribution. Use it when designing multi-tenant search/RAG systems or troubleshooting performance issues from uneven tenant data.
快速安装
Claude Code
推荐npx skills add qdrant/skills -a claude-code/plugin add https://github.com/qdrant/skillsgit clone https://github.com/qdrant/skills.git ~/.claude/skills/qdrant-multitenancy在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
Qdrant Multitenancy
Multitenancy is how you isolate data across multiple users or tenants within a single Qdrant deployment.
- The question to ask is: how many tenants, and how unevenly sized are they? That answer picks the isolation strategy.
- Understand the three isolation levels before choosing: payload-based, shard-based and collection-based.
- For almost everyone the right default is a single collection partitioned by payload, NOT a collection per tenant.
Many Small Tenants (Default: Payload Partitioning)
Use when: you have many tenants of roughly similar, modest size. This is the recommended default for most users.
One collection holds every tenant. A payload field marks ownership, and a filter on that field at query time is what isolates each tenant's results.
How It Works
- Create a keyword payload index on the tenant field with
is_tenant=true(the flag requires v1.11+).is_tenanttells Qdrant the field identifies tenants, so each tenant's vectors are stored together and served by sequential reads. Check . - At query time, isolate each tenant with a
mustfilter on the tenant field. Without it, a query searches every tenant's data. Check Payload-based multitenancy. - With this strategy, the indexing speed might become a bottleneck at scale because every tenant indexes into the same collection. To avoid this, you can disable the global HNSW creation (for the entire collection) and only build per-tenant indexes: set
m=0andpayload_mto a non-zero value. Although this accelerates the indexing process, keep in mind that requests without a tenant filter will become slower as they must scan all groups. So only make this trade if you hit the bottleneck and cross-tenant search is rare. Calibrate performance.
A Few Large Tenants Plus a Long Tail (Tiered Multitenancy)
Use when: you have a realistic SaaS distribution: a few large customers and many small ones, possibly with small tenants that grow over time. Available in v1.16+. It avoids the noisy-neighbor problem, where one big tenant forces the whole cluster to scale, raising costs and degrading performance for everyone else.
Tiered multitenancy keeps small tenants together in a shared fallback shard while isolating large tenants in their own dedicated shards, all in one collection. It layers two isolation levels: payload-based tenancy for logical isolation, and custom sharding for physical/ resource-based isolation of the large tenants. A tenant that outgrows the shared shard can be promoted to a dedicated shard later with no downtime.
How It Works
- Create the collection with custom (user-defined) sharding, and configure payload-based tenancy. A single shared fallback shard holds all the small tenants. If you have large tenants, create dedicated shards (one per tenant). Check Tiered multitenancy.
- When to promote a tenant? If a tenant becomes large enough to warrant dedicated resources (a reasonable promotion trigger is when a tenant approaches the indexing threshold), promote it to a dedicated shard. Qdrant moves its data into a new shard transparently, serving reads and writes throughout. Check how to promote tenant to dedicated shard.
- Keep in mind that re-sharding can be an expensive and time-consuming process, so consider your tenant growth patterns carefully when deciding which tenants should receive dedicated shards.
- It's not recommended to exceed ~1000 dedicated shards per cluster (resource overhead).
- The fallback shard (small tenants) must fit on a single node.
- Sharding method is fixed at collection creation: an auto-sharded collection (default) cannot be converted to custom sharding in place. If there is any realistic chance you will need to isolate a large tenant later, create the collection with custom sharding up front and put every tenant in the fallback shard.
Few Non-Homogenous Tenants (Collection per Tenant)
Use when: you have a limited number of tenants with different per-tenant embedding models or collection schemas.
- You should only create multiple collections when your data is not homogenous or if users' vectors are created by different embedding models.
Data Residency and Geographic Isolation (Custom Sharding)
Use when: data must be physically pinned to a location, e.g. regional compliance for healthcare industry (one region's data in Canada, another's in Germany). This is not only a tenant concern, a single tenant may also need to separate its own data by region.
- Like tiered multitenancy, this uses custom sharding; the difference is what you shard by. Here the shard key is a region. Each key's data lands on specific shards you can place in specific locations, while everything stays in one collection. Combine it with payload partitioning if you also need per-tenant isolation within a region. Check User-defined sharding for setup.
- Geographic residency follows only if your cluster's nodes are actually in the target regions.
- Qdrant Cloud deploys a cluster in a single region and has no managed multi-region today.
What NOT to Do
- Treat a payload filter as your whole security model. In Qdrant, (unless you're using per-tenant collections), tenant isolation is payload-based. It is an application-layer responsibility, and the filter is only one small part of it.
GitHub 仓库
常见问题
什么是 qdrant-multitenancy Skill?
qdrant-multitenancy 是一个 Claude Skill,作者为 qdrant。Skill 将 Claude 按需加载的说明和资源打包,让 Claude 无需额外提示即可执行与 qdrant-multitenancy 相关的任务。
如何安装 qdrant-multitenancy?
使用本页的安装命令:将 qdrant-multitenancy 作为插件添加到 Claude Code,或将其仓库克隆到 skills 目录,然后重启 Claude 以加载该 Skill。
qdrant-multitenancy 属于哪个分类?
qdrant-multitenancy 属于元分类。
qdrant-multitenancy 可以免费使用吗?
可以。qdrant-multitenancy 已收录在 AIMCP,可免费安装。
相关推荐技能
Content Collections 是一个 TypeScript 优先的构建工具,可将本地 Markdown/MDX 文件转换为类型安全的数据集合。它专为构建博客、文档站和内容密集型 Vite+React 应用而设计,提供基于 Zod 的自动模式验证。该工具涵盖从 Vite 插件配置、MDX 编译到生产环境部署的完整工作流。
这个Claude Skill为开发者提供完整的Polymarket预测市场开发支持,涵盖API调用、交易执行和市场数据分析。关键特性包括实时WebSocket数据流,可监控实时交易、订单和市场动态。开发者可用它构建预测市场应用、实施交易策略并集成实时市场预测功能。
该Skill帮助开发者创建OpenCode插件,用于接入命令、文件、LSP等25+种事件。它提供了插件结构、事件API规范和JavaScript/TypeScript实现模式,适合需要拦截操作、扩展功能或自定义事件处理的场景。开发者可通过它快速构建响应式模块来增强OpenCode AI助手的能力。
SGLang是一个专为LLM设计的高性能推理框架,特别适用于需要结构化输出的场景。它通过RadixAttention前缀缓存技术,在处理JSON、正则表达式、工具调用等具有重复前缀的复杂工作流时,能实现极速生成。如果你正在构建智能体或多轮对话系统,并追求远超vLLM的推理性能,SGLang是理想选择。
