在Azure Cosmos DB中实施分区密钥 [英] Implementing Partition Key In Azure Cosmos DB

查看:200
本文介绍了在Azure Cosmos DB中实施分区密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

很明显,逻辑分区的限制为10 GB,我们不能超过此限制.我与此相关的查询很少:

This is clear that logical partition has a limit of 10 GB we cannot exceed more than that. I have few queries related to that:

我们的组织计划使用Cosmos Db,并决定制作一个名为brand的系列,在其中我们拥有不同的品牌文件,例如Adidas,Reebok,Nike等.

Our organization is planning to use Cosmos Db and deciding to make a collection called brands in which we have different brands documents like Adidas, Reebok , Nike etc.

包含这些品牌的所有文档的ID从1到200000,文档的最大大小为100 KB.

根据情况,我们需要创建一个具有无限存储空间的集合.在ID列中使用分区键的最佳做法是什么.

  • 第一种情况-创建2个分区键值-ID为1至100000的'Partition 1'和100001至200000的'Partition 2'(2个逻辑分区,每个10 GB)
  • 第二种情况-创建10个分区键值-ID为1到20000的分区1",ID为20001到40000的分区2",直到ID 180001到200000的"Partition 10"(10个逻辑分区,每个分区2 GB)

同时使用这两种情况的优点和缺点是什么?

  • 在第一种情况下,存储空间为20 GB(分区1"为10 Gb,分区2"为10 GB)-这是正确的&收费将基于每月20 GB加上预订的吞吐量?
  • 在第二种情况下,为10个逻辑分区预订了100 GB的存储空间或为1个分区预订了10 GB的存储空间?在这种情况下,如果逻辑分区大小始终保持为2 GB,则意味着每个逻辑分区浪费了8 GB ?
  • 在第二种情况下,未使用80 GB的存储,我们仍然需要为那80 GB支付费用.意味着我们每个月必须支付100 GB的总费用?

任何人都请分享您的宝贵意见.

Anyone please share your valuable inputs.

谢谢

Sakshi

推荐答案

<Duplicate Post>

解决方案是创建不固定的集合.

Solution is to create collections that are not fixed. 

嗨Sakshi_ar,

Hi Sakshi_ar,

请查看Azure Cosmos DB容量规划器和价格计算器.如果使用了计划在解决方案中使用的示例Json文档,则可以更准确地了解Cosmos DB如何定价.再次,它一样准确 作为示例Json,您提供了它作为吞吐量计算的基础.

Please take a look at the Azure Cosmos DB capacity planner and pricing calculator. When used will example Json documents you plan to use in your solution, you can get a more accurate sense of how Cosmos DB prices things out. Again, it is as accurate as the example Json you provide it to base the throughput calculation upon.

估算请求单位和数据存储

使用此容量规划器生成的信息,您可以继续进行价格计算器,现在您可以在其中获得更多相关信息,以使价格计算器可以以此为基础进行计算.有一个转到Azure.com定价" 容量规划器中的链接.单击该按钮,然后添加"Cosmos DB"定价刀片,如果该价格刀片尚未显示在页面的下半部分.

With the information generated by this capacity planner, you can then proceed to the pricing calculator where you now have more relevant information for the pricing calculator to base that calculation on. There is a "Go to Azure.com for Pricing" link from the Capacity Planner. Click that and then add the 'Cosmos DB' pricing blade if it is not already displayed on the lower half of the page.

对于固定的收藏集,您有问题要问吗?您是否预见没有增长问题?如果您添加所有示例文档的副本,容量规划师将为您提供一个好主意.

I have a question for you with regard to the collection being fixed? Do you foresee not having growth issues? The capacity planner will give you a good idea if you add copies of all sample docs. 

如果您还有其他疑问,请告诉我们.

Please let us know if you have additional questions.

问候

迈克


这篇关于在Azure Cosmos DB中实施分区密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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