From a1ced7573bb9f25fc50351378997c81476669da4 Mon Sep 17 00:00:00 2001 From: Deepak Mardi Date: Sat, 11 May 2024 06:10:00 +0530 Subject: [PATCH] Add content for mongo performance optimization #4538 (#5465) * Updating the link for DevOps Roadmap to correct URL (https://roadmap.sh/docker) previously set to (https://roadmap.sh/best-practices) * update * update * Updated text content in "Performance Optimization" topic (MongoDB Roadmap) --- .../105-performance-optimization/index.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/data/roadmaps/mongodb/content/105-performance-optimization/index.md b/src/data/roadmaps/mongodb/content/105-performance-optimization/index.md index e69de29bb..402d57107 100644 --- a/src/data/roadmaps/mongodb/content/105-performance-optimization/index.md +++ b/src/data/roadmaps/mongodb/content/105-performance-optimization/index.md @@ -0,0 +1,24 @@ +# MongoDB Performance Optimization +Optimizing the performance of your MongoDB deployment is crucial for ensuring efficient data retrieval and maintaining high application responsiveness. In this article, we'll explore various techniques and strategies to enhance MongoDB's performance, focusing on indexing and query optimization. + +## Creating Indexes +Indexes are a powerful feature in MongoDB that help improve the performance of read operations (queries) in your database. They work similarly to the indexes found in a book, where you can quickly locate specific information rather than scanning through the entire content. + +### Types of Indexes + +There are several types of indexes in MongoDB, including: + +- **Single Field Index:** Index based on a single field in the documents. +- **Compound Index:** Index based on multiple fields in the documents. +- **Multikey Index:** Index used when the indexed field contains an array of values. +- **Text Index:** Index used to support text search queries on string content. +- **2dsphere Index:** Index used to support geospatial queries on spherical data. +- **2d Index:** Index used to support geospatial queries on planar data. + +Basically, an index in MongoDB is a data structure that holds a smaller version of the data in our documents, along with a reference to the original document. This smaller version is stored in an efficient manner, making it easier and faster to locate specific documents based on the indexed field(s). + +## Atlas Search indexes +Atlas Search Indexes are a powerful feature of MongoDB Atlas that allows you to create indexes on your dataset for advanced text searching and filtering functionalities. These indexes are built using the open-source search engine “Apache Lucene” to provide robust search capabilities directly within your MongoDB environment, enabling you to perform full-text search, filter, and scoring operations. + +## Query Optimization +In MongoDB, query optimization is a crucial aspect to ensure efficient and fast retrieval of data. The query optimizer helps in the selection of the appropriate query plan, enabling MongoDB to execute queries efficiently. The query optimizer’s primary goal is to minimize the number of documents to be read or scanned, consequently reducing the overall execution time. \ No newline at end of file