What is the principle of mongodb distributed storage?

  mongodb, question

I just started to learn mongodb these two days and tried to build distributed storage.

Don’t understand what is his basic principle?

My test database:
clipboard.png
There is 0.156G data in weibo document

Four shard nodes are established and the data of each node is found to be average. how is this distributed?

Then I emptied the whole weibo and the file storage size remained unchanged. Why?

Ask the superior to answer.

First, you need to look at MongoDB’s basic principle of fragmentation. Here is a translated document by Xiao Bei Bei:http://docs.mongoing.com/manual-zh/core/sharding-introduction.html

Regarding point 2, MongoDB will not reclaim space in the file system after you delete records. Unless you delete the database. However, space is not wasted and will be used to store the new document inserted below. Please refer to my blog for specific information on space usage:http://mongoing.com/blog/file-storage