Home > MongoDB > MongoDB Sharding, how to do sharding

MongoDB Sharding, how to do sharding

MongoDB Sharding systems give users the platform to partition an entire collection in a simple database form and distribute it to documents in the MongoDB instances or in simpler terms shards. This enables the writing capacity to increase and provides the ability to support the volumes of working set. This raises the limits of data size much higher beyond physical resources in a single node.

Features of sharding

Range-based data partitioning

MongoDB describes data in shards, according to the value of the shard key. Each represents a single block of documents that lie in a specific range. When the volume grows bigger, the MongoDB splits the shards into other smaller chinks known as splitting

Automatic data volume distribution

The system balances data automatically in all areas in the cluster and prevents intervention in the application layer. It does not need any additional features in modification or any developmental interventions.

Transparent Query routing

Transparency in sharding is because of connections in the cluster, which go through the MongoDB, and only requires basic configuration for the application to run smoothly.

A sharded cluster comprises of replica sets, which hold data, lightweight routing process and three configurations sever to store the data.

The process

This is the process of creating multiple shreds in order to facilitate storage of large data volumes. It is easy to multiply and backup data in several servers for easy retrieval and use.

  1. Start up the new machine in the process
  2. Install the MongoDB program, and start a new process which acts as the shard cluster for the storage of data
  3. Create another new process and this acts as the configuration which maintains and verifies the information given
  4. Start the process of sharding as directed by the program, and use mongo to find the current db,
  5. Enter the commands that enable sharding of collections and database you have.
  6. Modify all the applications to activate the MongoDB Sharding process and update the system.
  7. The configuration process is automatic and done through the IP

When to apply sharding

You do not need to apply sharding all the time and is usually applicable when you have a number numerous volumes of data. This a significant infrastructure development but you have the chance to deploy the operation when

–          Your data set exceed the limited capacity of your single node system

–          When you have volumes of writing activity in a single MongoDB and the process is slowing down and unable to meet your demands.

–          The current working set will not fit into your RAM system and you do not want to stop the process

When installing the MongoDB Sharding, you need to make sure that you follow the correct processes especially in configuration since this can delete all information in the indexes and servers when you do not use the correct handles. This is the reason why you need to customize your MongoDB and have numerous servers that will store extra memory details to prevent massive data loss. This process makes it easy to deal with massive production and you do not need to stop the working set in order to increase your memory space.

 

Categories: MongoDB Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.