Implementing Sharding

A serious problem that many large-scale applications encounter is that the data stored in the MongoDB is so enormous that it severely impacts performance. When a single collection of data becomes too large, indexing can cause a severe performance hit, the amount of data on disk can cause a system performance hit, and the number of requests from clients can quickly overwhelm the server. The application will get increasingly slower at reading from and writing to the database.

MongoDB solves this problem through sharding. Sharding is the process of storing documents across multiple MongoDB servers running on different machines. This allows the MongoDB database to scale horizontally. The more MongoDB servers you add, the larger the number of documents your application can support. Figure 17.3 illustrates the concept of sharding; from the application’s perspective, there is a single collection, but there are actually four MongoDB shard servers, and each contains a portion of the documents in the collections.

Image

Figure 17.3 From the application’s perspective, there is only a single collection to access. However, the documents for that collection are split across multiple MongoDB shard servers.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.146.237