MongoDB is one of several database types to arise in mid 2000’s under the banner of NoSQL. Rather than using the rows and columns as in the relational databases, MongoDB is built over architecture of collections and documents. Documents contain sets of Key-Value pairs and are the basic unit of data in mongoDB. Collections contain sets of documents and functions as the equivalent of the relational database tables.
Database systems with huge amount of the data sets and high throughput applications normally are a threat to the single server. They can exceed the storage capacity of a single machine or the high query rates can add on more loads to the CPU capacity of the server leading to exhaust. To overcome these issues, there are two basic approaches: Vertical Scaling and Horizontal Scaling.
Vertical Scaling is adding upon more CPU and storage resources to increase the capacity. But this vertical concept also gives up some limitations like, more expensive to achieve high performance systems, and cloud-based providers allow users to provision only smaller instances. Whereas Horizontal Scaling by contrast, divides the huge data sets and distributes over multiple machines. Each individual server is a shard or an independent database and collectively the shards make up a single database.