Backups in Managed Service for ClickHouse
Managed Service for ClickHouse provides 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 parts
are checked for uniqueness. - If there are identical data parts
in one of the existing backups and they are no older than 30 days, they are not duplicated.
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. You can 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.
You can set the backup start time when creating or updating a cluster. By default, the backup process starts at 10 p.m. UTC. The backup will start within 30 minutes of the specified time.
Backups are only created on running clusters. If you do not use a Managed Service for ClickHouse cluster 24/7, check the backup start time settings.
For more information about creating a backup manually, see Managing backups.
Storing backups
-
Backups of the data are stored in a separate Object Storage bucket and do not take up any 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 are stored as binary files and encrypted using GPG
. Each cluster has its own encryption keys. -
Automatically created backups of an existing cluster are kept for seven days, whereas those created manually are stored indefinitely. 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.