Breaking

Thursday, October 4, 2018

Sharding in MongoDB


Sharding In MongoDB


Sharding is the process of storing data records across multiple machines and it is MongoDB's approach to meeting the demands of data growth. As the size of the data increases, a single machine may not be sufficient to store the data nor provide an acceptable read and write throughput. Sharding solves the problem with horizontal scaling. With sharding, you add more machines to support data growth and the demands of read and write operations.

Why Sharding?

In replication, all writes go to master node

Latency sensitive queries still go to master

Single replica set has limitation of 12 nodes

Memory can't be large enough when active dataset is big

Local disk is not big enough

Vertical scaling is too expensive

Sharding in MongoDB

The following diagram shows the sharding in MongoDB using sharded cluster.
In the following diagram, there are three main components -

Shards - Shards are used to store data. They provide high availability and data consistency. In production environment, each shard is a separate replica set.

Config Servers - Config servers store the cluster's metadata. This data contains a mapping of the cluster's data set to the shards. The query router uses this metadata to target operations to specific shards. In production environment, sharded clusters have exactly 3 config servers.

Query Routers - Query routers are basically mongo instances, interface with client applications and direct operations to the appropriate shard. The query router processes and targets the operations to shards and then returns results to the clients. A sharded cluster can contain more than one query router to divide the client request load. A client sends requests to one query router. Generally, a sharded cluster have many query routers.

8 comments:

  1. Informative post indeed, I’ve being in and out reading posts regularly and I see alot of engaging people sharing things and majority of the shared information is very valuable and so, here’s my fine read.
    click here en fr
    click here to e-pay tax
    click here to enter text
    click here to enter text word
    click here to enable adobe flash player

    ReplyDelete
  2. Subscription boxes are a type of boxes which are delivered to the regular customers in order to build goodwill of the brand. They are also a part of the product distribution strategy. As a woman, you should subscribe to these boxes to bless yourself with a new and astonishing box of happiness each month. visit mysubscriptionsboxes

    ReplyDelete
  3. let’s download the latest version of monster legends mod apk V9.2.2 for Android with offers unlimited coins, gems & everything. What do you think first when you hear about ‘monsters?’ Deadly devils that are thirsty for blood and ugly creatures full of strength and cruelty. But these terms alone do not define monsters as a whole. Monsters are also known for their thrill and mysterious nature.
    visit monster-legends-mod-apk

    ReplyDelete
  4. This will be the proper weblog for anybody who hopes to find out about this topic. You recognize a great deal its nearly challenging to argue with you (not too I just would want…HaHa). You certainly put a fresh spin using a topic thats been revealed for a long time. Wonderful stuff, just wonderful! web designer la

    ReplyDelete
  5. the shoulder bags that my girlfriend uses are always made up from natural leather` web designer los angeles

    ReplyDelete
  6. I have to convey my respect for your kindness for all those that require guidance on this one field. Your special commitment to passing the solution up and down has been incredibly functional and has continually empowered most people just like me to achieve their dreams. Your amazing insightful information entails much to me and especially to my peers. Thanks a ton; from all of us. converting websites

    ReplyDelete

Post Top Ad

Your Ad Spot

Pages