I am trying to understand the relationship between Physical/Logical partitions and throughput availability in Azure Cosmos DB and have a few questions.
Reference documentation: https://learn.microsoft.com/en-us/azure/cosmos-db/partitioning-overview.
Based on the documentation, here's my understanding:
Now my questions are:
Is it based on the space occupied by logical partitions or based on the throughput consumed by all logical partitions in a physical partition or something else completely. For example,
Any insights into this will be highly appreciated.
UPDATE
Based on the comments, I have split the original question in 2 parts. 2nd part of the question can be found here: How is the throughput available for a physical partition split amongst its logical partition in Cosmos DB?.
Some answers.
Cosmos will actually create 3 partitions if you provision a new container with 20K RU/s. However if you start with less, say 5K RU, then scale up it will create 1 partitions, then increase to 2 partitions. The reason for the difference is we try to reduce the initial number of partition splits as users tend to ingest data during initial provisioning, often accompanying an additional increase in throughput. To reduce the number of partition splits we provision a physical partition at approx 60% of 10K RU/s. However, we don't apply this 60% universally because it's wasteful. It's just an optimization we make during initial provisioning based upon observed user patterns. It's also one of many reasons why you should not care about physical partitions and instead focus on your logical partition key. The 60% here is an implementation detail and can change at any time.
Yes.
Not yet but is coming. No ETA. (Update: this is now in preview, can learn more here, Merge Preview
Throughput is always equally distributed so yes, 18K spread across 3 partitions, each would get 6K RU/s.