Sharding adalah metode MongoDB untuk horizontal scaling — mendistribusikan data ke beberapa server (shards) sehingga database dapat menangani dataset dan throughput di luar kemampuan satu server. Sharding mempartisi data berdasarkan shard key, dengan MongoDB merutekan kueri ke shards yang tepat.
Mengapa ini penting
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
