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 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. 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. 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.
When creating or updating a cluster, you can set the time interval during which the backup will start. The default time is 22:00 - 23:00
UTC (Coordinated Universal 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 from local and network storage devices 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 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 only contain increments, i.e., the history of changes to data parts 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. -
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.
ClickHouse® is a registered trademark of ClickHouse, Inc