© Manish Sharma 2018
Manish SharmaCosmos DB for MongoDB Developershttps://doi.org/10.1007/978-1-4842-3682-6_4

4. Indexing

Manish Sharma1 
(1)
Faridabad, Haryana, India
 

Indexing is an inherent part of any database, so it is with MongoDB. Indexing data is necessary to help reduce the scan overhead when finding the values, for which there is a proverbial, “needle in a haystack.” In this chapter, I will discuss how indexing works, indexing policies, possibilities of customization, and indexing optimization.

Indexing in MongoDB

In MongoDB, users must define which path is to be indexed, and how. This decision defines the performance of the query. However, indexes have their own overhead. This creates a separate parallel tree structure that consumes RAM, storage, ...

Get Cosmos DB for MongoDB Developers: Migrating to Azure Cosmos DB and Using the MongoDB API 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.