Paste Batch into Sharding

What actually happens behind the scenes with a large InsertBatch if one writes to the cluster shard? Does MongoDb support bulk insertion, or does InserBatch actually insert one at a time at the server level? How does this work with what's happening? Is this means that the mongoes will look at every item in the party to find out which key is the fragment fragment of each element, and then the server will direct it to the right? This will break the bulk insert, if one exists, and does not seem to be effective. What is the mechanics of InsertBatch for a shattered solution? I am using version 2.0 and am ready to upgrade if that matters.

+2
source share
1 answer

Bulk inserts are an actual function of MongoDB and are (somewhat) more efficient than separate inserts for each document due to less rounding.

In a closed environment, if mongos receives a volume insert, it turns out how much of the volume should be sent to some splinter. There are no differences between 2.0 and 2.1, and this is the most effective way to mass insert data into a windowed database.

If you're curious how exactly mongos works, check out the source code here:

https://github.com/mongodb/mongo/tree/master/src/mongo/s

+3
source

Source: https://habr.com/ru/post/1525579/


All Articles