Mongodb data files become smaller after migration
问题 On my first server I get: root@prod ~ # du -hs /var/lib/mongodb/ 909G /var/lib/mongodb/ After migration this database with mongodump/mongorestore On my second server I get: root@prod ~ # du -hs /var/lib/mongodb/ 30G /var/lib/mongodb/ After I waited a few hours, mongo finished indexing I got: root@prod ~ # du -hs /var/lib/mongodb/ 54G /var/lib/mongodb/ I tested database and there's no corrupted or missed data. Why there's so big difference in size before and after migration? 回答1: MongoDB does