qdrant-tenant-scaling
它能做什么
这份指南可以帮你在拥有大量用户或客户(即“租户”)时,妥善组织 Qdrant 中的数据。它会讲解如何高效地把每个租户的数据分开保存,让一切运行得更快。
适用场景
- ✓当你有很多客户,并希望整理他们的数据时。
- ✓如果某个客户的数据运行缓慢,或者给其他客户带来了问题。
- ✓当你需要确保一个客户的数据不会和另一个客户的数据混在一起时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/qdrant-scaling/scaling-data-volume/tenant-scaling/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我该如何为成千上万个客户组织 Qdrant 中的数据,让一切运行顺畅?”
每周 5 个新技能,1 分钟读完。
工作原理
Qdrant 建议你在共享的 collection 中,通过 payload(额外的数据信息)上的过滤器来区分不同的客户。客户数量很多时,它还建议把工作拆分成更小的部分(分片,shard)。对于体量特别大的客户,或需要额外安全保障的客户,甚至可以为他们设置专用的分片。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
What to Do When Scaling Multi-Tenant Qdrant
Do not create one collection per tenant. Does not scale past a few hundred and wastes resources. One company hit the 1000 collection limit after a year of collection-per-repo and had to migrate to payload partitioning. Use a shared collection with a tenant key.
- Understand multitenancy patterns Multitenancy
Here is a short summary of the patterns:
Number of Tenants is around 10k
Use the default multitenancy strategy via payload filtering.
Read about Partition by payload and Calibrate performance for best practices on indexing and query performance.
Number of Tenants is around 100k and more
At this scale, the cluster may consist of several peers. To localize tenant data and improve performance, use custom sharding to assign tenants to specific shards based on tenant ID hash. This will localize tenant requests to specific nodes instead of broadcasting them to all nodes, improving performance and reducing load on each node.
If tenants are unevenly sized
If some tenants are much larger than others, use tiered multitenancy to promote large tenants to dedicated shards while keeping small tenants on shared shards. This optimizes resource allocation and performance for tenants of varying sizes.
Need Strict Tenant Isolation
Use when: legal/compliance requirements demand per-tenant encryption or strict isolation beyond what payload filtering provides.
- Multiple collections may be necessary for per-tenant encryption keys
- Limit collection count and use payload filtering within each collection
- This is the exception, not the default. Only use when compliance requires it.
What NOT to Do
- Do not create one collection per tenant without compliance justification (does not scale past hundreds)
- Do not skip
is_tenant=trueon the tenant index (kills sequential read performance) - Do not build global HNSW for multi-tenant collections (wasteful, use
payload_minstead)
常见问题
我应该为每个客户单独创建一个 collection 吗?
一般不建议。collection 创建得太多会占用大量资源,而且超过几百个客户后扩展性就不太好了。更好的做法是使用一个共享的 collection,再配合过滤器来区分数据。
什么是“租户”?
“租户”指的是使用你的系统的客户、用户或用户组。每个租户都有自己的数据,需要彼此分开保存。
什么时候需要严格的租户隔离?
只有当法律或合规要求规定每个租户的数据必须单独加密,或者需要比普通过滤器更强的数据隔离时,才需要严格隔离。
详情
作者的原始描述
Guides Qdrant multi-tenant scaling. Use when someone asks 'how to scale tenants', 'one collection per tenant?', 'tenant isolation', 'dedicated shards', or reports tenant performance issues. Also use when multi-tenant workloads outgrow shared infrastructure.
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7368
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。