Note: Sharding is built on replica sets. So before starting the following lessons, make sure you have completed all the replica set lessons.
Until now, we have been hosting the entire data set on one mongod process which means the entire data set is stored in one server. This also means all user requests are directed to this server.
If we are dealing with a very large data set and a very high throughput, then our server may struggle to meet demands. It may even collapse due to excessive workload.
We have two solutions. The first one is vertical scaling. We increase the capacity of a signal machine. We give it a more powerful CPU, a bigger RAM and more hard disk space.
But there is always a technological ceiling on vertical scaling. Besides, an extremely powerful machine is often extremely expensive.
The second solution is horizontal scaling which is less prone to the technological ceiling. We pool together several machines to provide more computing and storage capacity.