Does the azure cosmos db for mongo db RU consumption depend on collection size?

459 views Asked by At

I am using Azure cosmos db for MongoDB. A collection in the DB has 5 million+ documents. Can this cause in increased Request Units consumption? Will the cost decrease if I remove unwanted documents from the collection. I am doing read and write queries on this collection.

Please suggest.

1

There are 1 answers

0
Martin Smith On

The main immediate cost benefit of removing unwanted documents is that you pay less for elements of the bill directly related to storage size.

Ideally you want to be using a TTL index to age out unwanted documents so it can use "spare" RU to do this automatically.

I saw good drops in continuous backup and data storage costs after recently doing a bit of a purge of these myself.

The effects on RU consumption are more limited. If currently you are already at the minimum level the system allows you to scale to and the limiting factor for you is the Current storage in GB * 10 RU/s then reducing storage size may allow you to scale down.

Apart from that if these documents are just sitting in the collection and never returned by any queries and you aren't performing operations that aggregate over all items in the collection or running queries that do not have supporting indexes then their existence won't really be impacting your RU consumption.