Sharding este metoda MongoDB pentru scalare orizontală — distribuirea datelor pe mai multe servere (shard-uri) astfel încât baza de date să poată gestiona seturi de date și throughput depășind ceea ce poate face un singur server. Datele sunt partiționare după o shard key, MongoDB rutând query-urile către shard-urile corecte.
De ce să faci sharding: scalare dincolo de un singur server
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
