Backups in Managed Service for ClickHouse®
Managed Service for ClickHouse® supports automatic and manual database backups.
A backup is automatically created every day. You cannot disable automatic backups or change the retention period.
To restore a cluster from a backup, follow this guide.
Creating backups
You can create both automatic and manual backups. In both cases, the incremental method is used:
- When creating a new backup, data chunks
are checked for uniqueness. - If identical data chunks
are already present in one of the existing backups and they are not older than 30 days, they are not duplicated. For cold data in hybrid storage, this period is 7 days.
Backups are created separately for each individual cluster shard. They are also restored by individual shard. You can restore:
- One or more shard backups in an individual cluster.
- The entire cluster by specifying backups of all cluster shards.
Backup data is only stored for the MergeTree
engine family. For other engines, backups only store table schemas. Learn more about engines in the ClickHouse® documentation
Backups are created based on a random replica host. This is why, if there is no cluster host data consistency, restoring clusters from backups does not guarantee complete data recovery. For example, this may occur in the following cases:
- The tables are not replicated on all shard hosts.
- The tables are not replicated and are only hosted on some of the shard hosts.
When creating or updating a cluster, you can set the time interval during which the backup will start. Default time: 22:00 - 23:00
UTC (Coordinated Universal Time).
Backups are only created on running clusters. If you are not using your Managed Service for ClickHouse® cluster 24/7, check the settings of backup start time.
For more information about creating a backup manually, see Managing backups.
Storing backups
-
Backups of local and network storage devices are stored in a separate Object Storage bucket and take up no space in the cluster storage. If there are N GB of free space in the cluster, the first N GB of backups are stored free of charge.
-
Backups of cold data from hybrid storage are stored in the same Object Storage bucket as the regular data. The cost of using Object Storage considers both the space used by the backups and the space used by the data itself.
For more information, see Pricing policy.
-
Backups of cold data from hybrid storage contain only the increment, i.e., the history of changes to data chunks for the last 7 days. Backups of data that has not been modified are provided by Object Storage.
-
Backups are stored as binary files and 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 7 days.
-
Backup storage is not subject to quotas
or limits for cluster storage space.
Checking backup recovery
To test how backup works, restore a cluster from a backup and check the integrity of your data.
ClickHouse® is a registered trademark of ClickHouse, Inc