Backups using mongodump

mongodump is a command-line tool that can take out a backup of the data in our MongoDB cluster. As such, the downside is that on restore, all indexes need to be recreated which may be a time consuming operation.

The major downside the mongodump tool has is that to write data to disk it needs to bring data from internal MongoDB storage to memory first. This means that in the case of production clusters running under strain, mongodump will invalidate data residing in memory from the working set with data that would not be residing in memory under regular operations, degrading the performance of our cluster.

On the plus side, when we use mongodump we can continue taking writes in our cluster and if we have a replica set we can use the --oplog option to include in its output oplog entries that occur during the mongodump operation.

If we go with that option we need to use --oplogReplay when we use the mongorestore tool to restore our data back in the MongoDB cluster.

mongodump is a great tool for single server deployments but once we get to larger deployments we should consider using different and better planned approaches to back up our data.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.27.58