Home > OS >  Does a Cosmos DB physical partition hold 50GB or 100GB?
Does a Cosmos DB physical partition hold 50GB or 100GB?

Time:02-17

According to Microsoft's documentation on physical partitions, each one can hold 50GB and supply 10,000RU of throughput. Provisioning physical partitions involves initialising the container in increments of 10,000RU max scale.

However, looking at their documentation on Autoscale and storage limits it claims that a max scale of 50,000RU can hold 500GB of data, double the amount stated that 5 partitions should be able to hold.

These two statements seem to be in conflict with each other. Does each partition actually hold 100GB, not 50GB?

CodePudding user response:

It is still 50GB. I believe what the 2nd link does not talk about is the number of physical partitions it would create.

Each physical partition has a limit of 10,000 RU and 50GB so if your storage is 500GB (and max throughput is 50,000 RU), there would be 10 physical partitions where each partition has 5,000 RU and 50GB.

From this link:

When you first select the max RU/s, Azure Cosmos DB will provision: Max RU/s / 10,000 RU/s = # of physical partitions. Each physical partition can support up to 10,000 RU/s and 50 GB of storage. As storage size grows, Azure Cosmos DB will automatically split the partitions to add more physical partitions to handle the storage increase, or increase the max RU/s if storage exceeds the associated limit.

CodePudding user response:

The maximum size of a physical partition is 50GB.

What your second article is describing is how the minimum RU is automatically adjusted based on the size of your container or database. The minimum RU is the bigger value between 400RU/s and the size in GB * 10RU/s (and 1/100 * the max you've ever set).

A few examples what that means for different database sizes:

1GB   -> 400RU/s
30GB  -> 400RU/s
50GB  -> 500RU/s
500GB -> 5000RU/s
600GB -> 6000RU/s
(examples assumes you don't participate in a special program)

When using autoscale you can define a lower/upper limit with 10x difference. You however still have to consider the previous rule. Once you go from 500GB to 600GB in size your autoscale rule also automatically adjusts its lower and upper limit following the ruleset above based on the lower limit.

  • Related