Understanding indexing in Cosmos DB

The default configuration for indexing in Cosmos DB makes indexing happen automatically. Hence, whenever we create or update a document in a document collection, all the keys included in the document are indexed. This might sound counter-intuitive, but it is how the system is designed to work. No need for index management, unless you want to optimize your costs better or you require specific queries.

Keep in mind that every index you have in your dataset will have its toll on request units consumed and storage space used. Hence, if you are indexing keys that you are never going to use in search criteria, you are wasting resource units in every write operation.

In contrast, sometimes removing an index can ...

Get Guide to NoSQL with Azure Cosmos DB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.