Partition rebalancing on data deletion in Cosmos DB

Vishal Garg 0 Reputation points Microsoft Employee
2024-03-06T08:41:45.03+00:00

We have a query regarding the partition rebalancing mechanism in Cosmos DB, particularly when a significant amount of data is deleted from the database.

 

In our use case scenario, we are interested in how Cosmos DB handles the redistribution of logical partitions over the existing physical partitions following such a substantial data deletion.

 

In our use case scenario, we anticipate deleting approximately 90% of our data. Our concern lies in how Cosmos DB handles the redistribution of logical partitions over the existing physical partitions following such a substantial data deletion.

 

Could you kindly provide us with insights into whether Cosmos DB automatically redistributes logical partitions over existing physical partitions in response to significant data deletions? Additionally, we are interested in understanding any potential impacts or considerations we should be aware of regarding performance and resource utilization during this process.

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,543 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Oury Ba-MSFT 18,021 Reputation points Microsoft Employee
    2024-03-11T20:25:27.87+00:00

    @Vishal Garg

    I was able to check this internally and seems like deletion does not result in immediate redistribution, as that would be very disruptive as tomorrow customers might increase the throughput/ingest more data.

    If you dropped massive data - 100 GB to TB and not planning to ingest - and all limitations work, you can explore https://learn.microsoft.com/en-us/azure/cosmos-db/merge?tabs=azure-powershell%2Cnosql 

    Hope this clarifies the ask.

    Regards,

    Oury