sharding คือวิธีการ horizontal scaling ของ MongoDB — กระจายข้อมูลไปยังหลายเซิร์ฟเวอร์ (shard) เพื่อให้ฐานข้อมูลสามารถจัดการชุดข้อมูลและ throughput ที่เกินกว่าเซิร์ฟเวอร์เดี่ยวจะรับไหว มันแบ่งข้อมูลด้วย shard key โดย MongoDB จะ route query ไปยัง shard ที่ถูกต้อง
ทำไมต้อง shard: 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
