...

Database Managment - Mongo DB

Back to Course

Lesson Description


Lession - #1429 MongoDB Sharding


MongoDB - Sharding

Sharding is the method involved with putting away information records across numerous machines and it is MongoDB's way to deal with fulfilling the needs of information development. As the size of the information expands, a solitary machine may not be adequate to store the information nor give an OK perused and compose throughput. Sharding takes care of the issue with even scaling. With sharding, you add more machines to help information development and the requests of perused and compose activities.

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

    Sharding in MongoDB

    The following diagram shows the Sharding in MongoDB using sharded cluster.



    In the accompanying outline, there are three primary parts −
    • Shards − Shards are utilized to store information. They give high accessibility and information consistency. Underway climate, every shard is a different imitation set.
    • Config Servers − Config servers store the group's metadata. This information contains a planning of the group's informational index to the shards. The inquiry switch utilizes this metadata to target tasks to explicit shards. Underway climate, sharded groups have precisely 3 config servers.
    • Query Routers − Query switches are essentially mongo examples, communicate with client applications and direct tasks to the fitting shard. The question switch cycles and focuses on the tasks to shards and afterward returns results to the clients. A sharded bunch can contain more than one question switch to partition the client demand load. A client sends solicitations to one question switch. By and large, a sharded group have many question switches.


    mongodb community editorial

    mongodb community editorial

    pymongo aggregate

    pymongo aggregate

    mongodb linux

    mongodb linux

    MongoDb docker image

    MongoDb docker image