Sharding हे MongoDB चे horizontal scaling चा एक पद्धति आहे — डेटा अनेक सर्व्हरवर (shards) वितरित करते जेणेकरून डेटाबेस एकाच सर्व्हरच्या क्षमतेपेक्षा मोठ्या डेटासेट आणि throughput हाताळू शकेल. हे डेटा shard key नुसार विभाजित करते, MongoDB queries योग्य shards पर्यंत पोहोचवते.
Shard का करायचे: एका सर्व्हरच्या पलीकडे स्केल करा
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
