Incremental backup mongodb using rsync

backupmongodbrsync

I want to store small files (60 kb, couple of millions) into MongoDB, I was thinking using GridFS, but it seems BSON will do. Anyway, I want to make rsync to backup the mongodb chunk files, so question is, if I will only do INSERT (no update, no delete), chunks on disc will be same, just last chunk will be different, is that right ? So in this case, rsync will backup only last chunk, because others are same (of course mongodb will be properly shutted down, when doing this operation).

So lets say total size of chunks is 100GB, chunk size is 1GB, in worst scenarion in incremental backup will be rsynced just 1 GB.

Best Answer

This sounds right. As long as you don't change the structure of the database, or run optimization against it.

But if bandwidth is a worry, you should analyze the rsync performance in a testing environment before moving this into production.

Related Topic