尽管在 Azure Cosmos DB 中使用分区键,但无法使用物理分区

问题描述 投票:0回答:1

我们使用 Azure Cosmos DB、Azure Cosmos SDK v3.35.4、.NET Core 7。

在我们的数据中,其中一列值是不同的数字,例如 1, 2, 3, 4, ...., 7869, ...., 34562, 34563,... 因此我们在我们的 C# 模型类代表范围。

示例 1-1000 是范围 = 1,1001-2000 是范围 = 2 等等。

示例:

enter image description here

我们也将这个“范围”属性插入到 cosmos 容器中,并将其定义为

PartitionKey
。对于 CRUD 操作,我们也使用这个
PartitionKey

enter image description here

我们在 Azure 门户中检查了容器的 Azure Cosmos DB 见解:

enter image description here

enter image description here

仅使用 1 个物理分区?我在选择分区键时做错了什么?

c# azure .net-core azure-cosmosdb azure-cosmosdb-sqlapi
1个回答
0
投票

数据根据分区键分为逻辑分区。在以下情况下添加物理分区:

  • 容器的 RU/秒需求超出了物理分区支持的最大值(10K RU/秒)
  • 容器的容量需求超出了单个物理分区 (50GB)

假设您的容器中的数据非常少,并且您的 RU/秒低于 10,000,则所有逻辑分区都适合单个物理分区(这就是为什么您只看到 1 个物理分区)。

当超过两个阈值之一(或两个)时,您的逻辑分区将分布在多个物理分区上。

© www.soinside.com 2019 - 2024. All rights reserved.