Backups in Managed Service for MongoDB
Managed Service for MongoDB supports automatic and manual database backups.
Managed Service for MongoDB allows you to restore your cluster to any state (Point-in-Time-Recovery, PITR) in the time interval between the oldest backup and the archiving of the most recent oplog
When creating backups and restoring data from them to a given point in time, keep the following in mind:
-
The oplog is archived in a running cluster a few times a minute, and then uploaded to object storage.
-
It takes some time to create and upload an oplog archive to object storage. This is why the cluster state stored in the object storage may differ from the actual one.
To use PITR, you must disable the sharding mechanism in the cluster: PITR works only for a cluster with a single replica set.
To restore a cluster from a backup, follow this guide.
Creating backups
You can create backups either automatically or manually; in both cases, you get a full backup of all databases.
All cluster data is automatically backed up every day. You cannot disable automatic backups. However, when creating or editing a cluster, you can set the following parameters for automatic backups:
- Retention time.
- Time interval during which the backup starts. Default time:
22:00 - 23:00
UTC (Coordinated Universal Time).
After a backup is created, it is compressed for storage. To find out its exact size, request a list of backups.
Backups are only created on running clusters. If not using your Managed Service for MongoDB cluster 24/7, look up the settings to make sure the backup is taking place when the cluster is running.
For more information about creating a backup manually, see Managing backups.
Storing backups
Storing backups in Managed Service for MongoDB:
-
Backups are stored in Yandex internal storage as logical dumps and are encrypted using GPG
. Each cluster has its own encryption keys. -
The retention time for backups of an existing cluster depends on the method used to create such backups:
-
After you delete a cluster, all its backups are kept for seven days.
-
Backup storage is not subject to quotas
or limits for cluster storage space. -
Backups are stored in object storage and do not take up space in cluster storage. If there are N free GB of space in the cluster, the storage of the first N GB of backups is free of charge.
For more information, see Pricing policy.
Checking backup recovery
To test how backup works, restore a cluster from a backup and check the integrity of your data.