Backup and Restore in MOngoDB 4.2 Sharded Cluster

Hello,

I would like to confirm the statement below:

mongodump and mongorestore cannot be part of a backup strategy for 4.2+ sharded clusters that have sharded transactions in progress, as backups created with mongodump do not maintain the atomicity guarantees of transactions across shards.

Are we not allowed to use mongodump and restore on a running mongodb database in a production environment?

Hi @Ralph_Anthony_Plante

You definitely can use mongodump & mongorestore in production. The statement was saying that if there are sharded transaction in progress, then the backup will contain things that are in flight inside the transaction, and thus the backup do not provide a consistent view of the database.

Having said that, it’s best if you stop all writes while mongodump is in progress anyway, just to be sure that you’re not backing up an inconsistent view of database.

Best regards
Kevin

1 Like

Can we know what is the strategy which ops manager and cloud manager is using in this case

i guess it’s using some internal clock time and has to also coordinate with transaction mechanism.

@Balram_Parmar in both Ops Manager and Cloud Manager, we do not use mongodump to backup the database. We developed a backup system specifically for Ops Manager and Cloud Manager that is designed to ensure consistency and correctness for both replica sets and sharded clusters, while the database is still fully operational. This ability is unique to Ops Manager and Cloud Manager due to the capabilities of the agent and other features designed specifically to ensure accurate backups for all deployment types.

If you are interested, you can learn more here Backup Process — MongoDB Ops Manager 6.0 .

Best Regards,
Evin