Backups in Yandex StoreDoc
Yandex StoreDoc supports automatic and manual database backups.
Yandex StoreDoc 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.
For sharded clusters, two backups are created: a sharded one and a non-sharded one. The sharded backup displays a larger size which includes:
- Backup size for
mongoinfra
ormongocfg
type hosts. - Total size of all non-sharded backups. This total is counted towards the overall size of a sharded backup, but technically non-sharded backups do not take up extra storage space as part of a sharded backup.
You can restore only a non-sharded cluster from a non-sharded backup. From a sharded backup, you can restore a cluster with standard or advanced sharding, no matter what sharding type was used in the original cluster. The restored cluster's shards must match the original cluster's shards at the time of creating the backup.
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 Yandex StoreDoc 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 Yandex StoreDoc:
-
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.