Cosmos DB 固定 (10GB) 集合的分区键的用途 [英] Purpose of a Partition Key for a Cosmos DB Fixed (10GB) Collection

查看:20
本文介绍了Cosmos DB 固定 (10GB) 集合的分区键的用途的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Cosmos DB 文档中,我看到分配一个固定 (10GB) 集合意味着永远只会分配一个分区来保存集合中的文档.

In the Cosmos DB docs, I see that allocating a Fixed (10GB) Collection means that there will only ever be a single partition allocated to hold documents within the Collection.

我的问题:如果我选择一个固定集合,如果我只有一个分区,为什么仍然提示我选择一个分区键?

My question: if I choose a Fixed Collection, why am I still prompted to choose a partition key if I will only ever have a single partition?

我的猜测是,单分区指的是单物理分区,但还是可以在单物理分区内存储 N 个逻辑分区(每个由一个分区键标识).但如果这是正确的,除了每个分区所需的最小 RU/s 之外,我认为选择固定(10GB)分区而不是无限分区没有任何优势.

My guess is that the single partition refers to a single physical partition, but it is still possible to store N logical partitions (each identified by a partition key) within the single physical partition. But if this is correct, I do not see any advantages to choosing a Fixed (10GB) partition over an Unlimited partition aside from the minimum RU/s required for each.

推荐答案

当我们创建分区集合时,我们处理的是逻辑分区"而不是物理分区,物理分区由 Cosmos 服务管理.

When we create partitioned collection we are dealing with "logical partitions" not physical ones, the physical partitions is managed by the Cosmos service.

对于我应该对我的收藏进行分区吗?"问题,在 这个博客,你可以找到:

For "Should I partition my collection?" question, in this blog, you can find:

  • 单分区集合:具有较低的价格选项和执行查询和跨所有事务执行事务的能力收集数据.它们具有可扩展性和存储限制单个分区(10GB 和 10,000 RU/s).您不必指定这些集合的分区键.对于不需要的场景大容量存储或吞吐量,单分区集合很合适.
  • 分区集合:可以跨越多个分区并支持非常大的存储量和吞吐量.您必须指定一个这些集合的分区键.
  • Single-partition collections: have lower price options and the ability to execute queries and perform transactions across all collection data. They have the scalability and storage limits of a single partition (10GB and 10,000 RU/s). You do not have to specify a partition key for these collections. For scenarios that do not need large volumes of storage or throughput, single partition collections are a good fit.
  • Partitioned collections: can span multiple partitions and support very large amounts of storage and throughput. You must specify a partition key for these collection.

这篇关于Cosmos DB 固定 (10GB) 集合的分区键的用途的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆