How can we improve Azure Cosmos DB?

[Cosmosdb]-[nice to have] truncate functionality on collection

Currently there is no truncate functionality available on a collection. The current option is to delete the collection and recreate it from scratch in order to wipe all data.This affects the DDL(schema) and manual is error prone. It would be nice if collection supports truncate operation.

1 vote
Vote
Sign in
(thinking…)
Sign in with: oidc
Signed in as (Sign out)
You have left! (?) (thinking…)
Tarini Dash shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

Hello and thank you for your suggestion.

Horizontally partitioned databases do not work like a relational database. There is no schema so there is nothing that could be error prone to deleting the container. In addition, deleting and recreating the container frees up physical partitions that may have been created to support the storage of the previous container.

Additionally, doing a truncate or delete on every item in a container would incur RU charges, whereas just deleting and recreating the container would not.

For these reasons we recommend customers use this method.

Thanks again for your suggestion.

0 comments

Sign in
(thinking…)
Sign in with: oidc
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base