问题描述
在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 theability to execute queries and perform transactions across allcollection data. They have the scalability and storage limits of asingle partition (10GB and 10,000 RU/s). You do not have to specify apartition key for these collections. For scenarios that do not needlarge volumes of storage or throughput, single partition collectionsare a good fit.
- Partitioned collections: can span multiple partitions and supportvery large amounts of storage and throughput. You must specify apartition key for these collection.
这篇关于Cosmos DB固定(10GB)集合的分区键的用途的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!