1
votes

The Microsoft advice for partition-key selection encourages the selection of a key that will lead to 100's or 1000's of partitions. The general theme is "more is better".

My question is, can a CosmosDb suffer from a partition key that leads to an excessive number of highly fragmented logical partitions?

I am considering using a partition-key that defines a team-workgroup id and which also equates to a customer tenant boundary. This partition-key maps very well onto data query and transaction boundary access patterns in my application. However, I am concerned that with just 100 stored docs per tenant and an estimated 50 kb of storage per tenant, by the time my CosmosDb collection reaches 10Gb the collection would have 200,000 partitions.

Please note: I already understand that a logical partition does not map 1:1 to a physical CosmosDb partition and in my proposed case a physical partition is likely to contain 1000+ logical partitions.

1

1 Answers

0
votes

There is no practical limit to the number of logical partitions you are allowed to have. The system can scale to millions or billions of logical partitions. It's just a simple hash operation on your partition key to determine which physical partition holds the logical partition that your document lives in.