Indexing Design Fundamentals
Learn how to design efficient indexes to speed up queries, and reduce resource consumption in MongoDB.
|
Upon completion of the Indexing Design Fundamentals skill and assessment, you will earn a Credly Badge that you are able to share with your network. |
Learning Objectives

Apply Indexing Best Strategies
Apply best practices including identifying the most frequent queries, creating the minimal number of indexes needed to support those frequent queries and understanding how to build efficient compound indexes.

Optimize Indexes for Performance
Be able to apply strategies such as ESR (equality, sort, range) when appropriate and know how to create indexes for a specific strategy.

Measure Index Performance
Use and interpret the outputs of the tooling such as explain() with your queries to determine if queries are using indexes.
Who is this Course Good for?
This skill is designed for developers who want to improve MongoDB performance by designing indexes that are intentional, efficient, and aligned with real application workloads. If you are building or maintaining applications where query speed matters, such as messaging platforms, financial systems, or high-traffic services, this Indexing Design Fundamentals Skill Badge will help you understand how MongoDB indexes work and how to use them effectively. It is especially useful if you are comfortable writing MongoDB queries but are less confident about when to create new indexes, which index types to choose, or how to weigh the trade-offs between faster reads and slower writes. By focusing on practical indexing strategies, this skill helps you move beyond trial-and-error tuning and towards data-driven decisions that improve performance and scalability.
What to Expect in this Course
In this skill badge, you will learn what indexes are in MongoDB and why they are critical for query performance. The skill begins by discussing how indexes allow the database to avoid scanning every document and instead use an optimized B+ tree structure to locate results more quickly. At the same time, you learn why indexes are not “free”: they improve read performance at the cost of additional write overhead and storage, which is why thoughtful index design is essential for long-term performance.
From there, the skill introduces you to different index types and the core concepts behind an indexing strategy. Using a messaging application for a financial institution as a running example, you learn how to identify and analyze key queries, recognize common patterns, and determine the minimum set of MongoDB indexes needed to support critical workloads. You are introduced to compound indexes and explore how structuring them according to the Equality Sort Range (ESR) guideline — placing equality fields, then sort fields, then range fields — can significantly improve performance for real query patterns.
You then examine how to optimize index size and storage. The skill explains how prefix compression works in MongoDB indexes and how strategically ordering equality fields by cardinality can help you take advantage of it. You also learn how partial indexes can reduce storage and maintenance overhead by indexing only the subset of documents that are relevant to specific queries. Finally, you explore index management as an ongoing process that involves planning, monitoring, and maintaining indexes as your data and access patterns evolve. You see what tools and methods MongoDB provides to help you understand index usage, detect ineffective or redundant indexes, and safely adjust your indexing strategy over time. Hands-on labs give you practice applying these concepts so that you can confidently design and manage MongoDB indexes for better application performance.
Summary of the Course
- Understand what indexes are in MongoDB and how they support faster query performance using B+ tree structures.
- Explain the trade-offs between improved read performance and the additional write and storage overhead introduced by indexes.
- Analyze key application queries and identify common patterns to determine the minimum set of indexes required.
- Design and structure compound indexes using the Equality Sort Range (ESR) guideline for optimal performance.
- Optimize index size by leveraging prefix compression and ordering equality fields from lowest to highest cardinality.
- Implement partial indexes to reduce storage and maintenance costs while still supporting critical queries.
- Plan, monitor, and maintain MongoDB indexes as data and workloads evolve, using available tools and best practices.
- Apply indexing design fundamentals to real-world scenarios so your MongoDB applications remain responsive and scalable as they grow.
Sarah Evans | Senior Curriculum Engineer
Sarah is a Senior Curriculum Engineer on the Curriculum team at MongoDB. Prior to MongoDB, she taught and developed curricula for developer bootcamps. Sarah has a MAT degree from Columbia University Teachers College and studied Software Engineering at Flatiron School in Chicago, IL.
Manuel Fontan Garcia | Senior Technologist, Education
Manuel is a Senior Technologist on the Curriculum team at MongoDB. Previously he was a Senior Technical Services Engineer in the Core team at MongoDB. In between Manuel worked as a database reliability engineer at Slack for a little over 2 years and then for Cognite until he re-joined MongoDB. With over 15 years experience in software development and distributed systems, he is naturally curious and holds a Telecommunications Engineering MSc from Vigo University (Spain) and a Free and Open Source Software MSc from Rey Juan Carlos University (Spain).
Daniel Curran | Senior Software Engineer
Daniel is a Senior Software Engineer at MongoDB. Before joining MongoDB, he worked as an Instructional Designer and Content Developer specialising in technical content for a host of international clients. Daniel's goal is to remove obstacles so learners can feel confident on their journey to become masters of MongoDB.
John McCambridge | Curriculum Engineer
John is a Curriculum Engineer on the University team at MongoDB. Before his work as a Curriculum Engineer, he was an instructor and teaching assistant for coding boot camps at UT (Austin), and UCLA. Additionally, he worked as a QA engineer for a startup called Coder and spent five years at Apple Inc. John is a passionate software engineer and educator who enjoys taking complex topics and making them digestible for the community.
