MongoDB & NoSQL (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
MongoDB Sharding Architecture: `mongos`, Config Servers, and Chunks.
senior LevelSystem DesignDatabases & SQL
In Simple Words: Sharding distributes data horizontally across a cluster of Replica Sets:
mongos(Query Router): Lightweight stateless proxy that routes client requests to the correct shard.- Config Database: Replicated cluster storing cluster metadata and shard key routing ranges.
- Chunks: Data ranges of a collection (default 64MB). When chunks grow too large, the balancer automatically splits and migrates them across shards.