Sharding MongoDB ਦਾ ਹਰਿਜੋਗੀ ਸਕੇਲਿੰਗ ਦਾ ਢੰਗ ਹੈ — ਡੇਟਾ ਨੂੰ ਕਈ ਸਰਵਰਾਂ (shards) ਵਿੱਚ ਵਿਤਰਿਤ ਕਰਨਾ ਤਾਂ ਜੋ ਡੇਟਾਬੇਸ ਉਹਨਾਂ ਡੇਟਾਸੇਟਾਂ ਅਤੇ ਥ੍ਰੁਪੁਟ ਨੂੰ ਸੰਭਾਲ ਸਕੇ ਜੋ ਇੱਕ ਸਿੰਗਲ ਸਰਵਰ ਨਹੀਂ ਸੰਭਾਲ ਸਕਦਾ। ਇਹ ਡੇਟਾ ਨੂੰ shard key ਦੁਆਰਾ ਵਿਭਾਜਿਤ ਕਰਦਾ ਹੈ, MongoDB ਕਿਊਰੀਜ਼ ਨੂੰ ਸਹੀ shards ਤੱਕ ਰੂਟ ਕਰਦਾ ਹੈ।
ਸ਼ਾਰਡ ਕਿਉਂ ਕਰਨਾ: ਇੱਕ ਸਰਵਰ ਤੋਂ ਪਰਾ ਸਕੇਲ ਕਰਨਾ
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
