MongoDB โ Sharding & Horizontal Scaling
Scale MongoDB horizontally using sharded clusters, mongos routers, config servers, and shard keys.
1Sharded Cluster Architecture
Sharding partitions large data across multiple machines. A sharded cluster consists of:
- Shards: Each shard holds a subset of the sharded data (each shard is a replica set).
- mongos Routers: Query routers that direct client requests to appropriate shards.
- Config Servers: Store metadata and cluster settings.