* 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)pull/3534/head^2
parent
0ec50a1ee4
commit
a1ced7573b
1 changed files with 24 additions and 0 deletions
@ -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. |
Loading…
Reference in new issue