I'm starting on mongodb, linux platform. I would like to know the best backup strategy since:
Date import and Export - are used for cvs or json outputs Mongodump and Mongorestore - are used for small bases.
Anyway, what's the best tool?
I'm starting on mongodb, linux platform. I would like to know the best backup strategy since:
Date import and Export - are used for cvs or json outputs Mongodump and Mongorestore - are used for small bases.
Anyway, what's the best tool?
The official documentation page mentions several ways. Disregarding the official maintenance tool, the Cloud Manager that is paid per server, you have two options (three depending on operating system / infrastructure):
Dump / restore works fine only on a small footprint because the complexity that is added when you have multiple shards, for example, makes integrity management / syncing of backups impractical.
If you are running a replication set (replica set), I see no problem backing up with dump / restore. Whereas you use the --oplog option so that changes that are being made during the dump are included, and then in restore use --oplogReplay.
Copying files manually involves stopping any writing on the server (s) because you are copying multiple files, and this is not an atomic operation.
In the case of snapshots you can use without problems since journaling is active (it is the default), without which there is no guarantee that your snapshot will be valid. If you use this option on a sharded cluster, you need to stop the balancer and snapshot all shards and configuration servers at the same time.