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

查看:86
本文介绍了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天全站免登陆