Sharding MongoDB की horizontal scaling की विधि है — कई servers (shards) में data वितरित करना ताकि database उन datasets और throughput को संभाल सके जो एक single server की क्षमता से परे हैं। यह data को एक shard key द्वारा विभाजित करता है, जिसमें MongoDB queries को सही shards तक route करता है।
Shard क्यों करें: एक server से परे scale करें
A single server has limits (storage, RAM, write throughput). When data/load exceeds
what one server (even a powerful one) can handle, SHARDING distributes it:
→ data is split across multiple SHARDS (each a replica set)
→ each shard holds a SUBSET of the data → combined capacity scales horizontally
→ handles huge datasets and high write throughput
