Rens Groenveld
Rens Groenveld

Reputation: 982

Azure CosmosDB view partition data

Does anyone know how to check what kind of data is on a certain partition in Azure Cosmos/MongoDB ?

I have one partition exceeding the storage limit, but I can't figure out why. I have one collection, with around 70 partitions. All of the partitions are 3.5GB or less, but one partition is 10GB, causing problems as it exceeds the maximum amount of data.

Yesterday, I removed for about 15% of the data for that partition, but it still claims to be on 10GB.

enter image description here

How can I check which documents are residents of the particular partition?

Upvotes: 3

Views: 2326

Answers (1)

Jay Gong
Jay Gong

Reputation: 23792

Rens Groenveld,firstly,I'd say sorry for the misunderstanding in my comment. After observing your screenshot, combining this blog, the partition key(in 2nd pic) is for logical partition and the partition name(in 3rd pic) is for physical partition.

You specify the partition key to create a logicalpartition that guarantees to keep items with the same hash of the key together. Cosmos DB manages the physical partitions based on needs. In the portal, you can see that although we have a few dozen partition keys, there are only a handful of partitions.

You could know the differences between logical partition and physical partition from this official document.

Unlike logical partitions, physical partitions are an internal implementation of the system. You can't control their size, placement, the count, or the mapping between the logical partitions and the physical partitions. However, you can control the number of logical partitions and the distribution of data and throughput by choosing the right partition key.

Back to your issue, your logical partitioned data is keep together logically, cosmos db would balance them physically which we can't get involved. Data for the same logical partition maybe not reside on the same physical partition. I assumed that's the reason you remove the data does't save the size. I suggest you getting touch with Azure Cosmos DB Team to see what they can do with your physical partition.

Upvotes: 1

Related Questions