Syncing a mongodb database over dropbox

ⅰ亾dé卋堺 提交于 2019-11-30 20:26:42

Unfortunately this sounds like a horrible idea. What if Mongo is running on two machines at the same time? Most likely both databases will be corrupted. A better way would be to write a script that used mongodump and mongorestore to dump the database to Dropbox and restore it from the dump. You would have to run these manually though.

The reason you don't see any changes to the database files is probably because Mongo preallocates its database files, so their size never changes, just the contents inside. It may be that Dropbox doesn't discover this. Mongo also does not write to disk at once. Rather, it uses memory mapped files which may be flushed later (it should be a matter of seconds though so it shouldn't be the cause).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!