You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1103,8 +1103,34 @@ When running a 32-bit system build of MongoDB, the total storage size for the se
1103
1103
<b><a href="#">↥ back to top</a></b>
1104
1104
</div>
1105
1105
1106
-
#### Q. ***Why are MongoDB data files large in size?***
1107
-
#### Q. ***What is Sharding in MongoDB?***
1106
+
## Q. ***What is Sharding in MongoDB?***
1107
+
1108
+
**Sharding** is a method for distributing data across multiple machines. MongoDB uses sharding to support deployments with very large data sets and high throughput operations.
1109
+
1110
+
Database systems with large data sets or high throughput applications can challenge the capacity of a single server. There are two methods for addressing system growth: vertical and horizontal scaling.
1111
+
1112
+
**1. Vertical Scaling**
1113
+
1114
+
Vertical Scaling involves increasing the capacity of a single server, such as using a more powerful CPU, adding more RAM, or increasing the amount of storage space.
1115
+
1116
+
**2. Horizontal Scaling**
1117
+
1118
+
Horizontal Scaling involves dividing the system dataset and load over multiple servers, adding additional servers to increase capacity as required. While the overall speed or capacity of a single machine may not be high, each machine handles a subset of the overall workload, potentially providing better efficiency than a single high-speed high-capacity server.
MongoDB supports horizontal scaling through `sharding`. A MongoDB sharded cluster consists of the following components:
1125
+
1126
+
* **Shards**: Each shard contains a subset of the sharded data. Each shard can be deployed as a replica set.
1127
+
* **Mongos**: The mongos acts as a query router, providing an interface between client applications and the sharded cluster. Starting in MongoDB 4.4, mongos can support hedged reads to minimize latencies.
1128
+
* **Config Servers**: Config servers store metadata and configuration settings for the cluster.
1129
+
1130
+
<div align="right">
1131
+
<b><a href="#">↥ back to top</a></b>
1132
+
</div>
1133
+
1108
1134
#### Q. ***What is Aggregation in MongoDB?***
1109
1135
#### Q. ***How can you isolate your cursors from intervening with the write operations?***
1110
1136
#### Q. ***At what interval does MongoDB write updates to the disk?***
0 commit comments