跳到正文
Skillpedia
数据库40k · #7368

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/github/awesome-copilot/blob/main/skills/qdrant-scaling/scaling-data-volume/tenant-scaling/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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.

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=true on the tenant index (kills sequential read performance)
  • Do not build global HNSW for multi-tenant collections (wasteful, use payload_m instead)
常见问题

我应该为每个客户单独创建一个 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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能