Sharding in MongoDB is the process in which the data is stored across various machines. It is an approach to meet data growth demands. Due to the increase in the size of the data, one machine might not be sufficient in order to store the necessary data or provide a good environment and throughput to read and write the data. It solves the issues of horizontal scaling. With the help of sharding, you can increase the number of machines and support the growth of data.
Sharding consists of 3 components:
- Shards: They are used to store necessary data by providing data consistency and high availability
- Config Servers: They help in storing the metadata of the cluster that consists of a mapping of the data set in the cluster to the shards
- Query Routers: They are instances of Mongo that interface with the applications of the client and also direct the operations to the respective shard
If you wish to learn more about the process of Sharding in MongoDB then you should enroll in Intellipaat’s MongoDB Training. In this course, you will also learn about other MongoDB concepts such as CRUD operations, stack functions, data management, and data modeling.
MongoDB is an important part of full-stack development. Enroll in this Full Stack Developer Training to start your journey in this field.
You should also watch this video on MongoDB: