Backups
Database backups provide a safety net by ensuring that if data is lost for any unforeseen reason, the service can be restored to a previous state from the last successful backup. This minimizes downtime and prevents business critical data from being permanently lost.
Backups
How backups work in ClickHouse Cloud
ClickHouse Cloud backups are a combination of "full" and "incremental" backups that constitute a backup chain. The chain starts with a full backup, and incremental backups are then taken over the next several scheduled time periods to create a sequence of backups. Once a backup chain reaches a certain length, a new chain is started. This entire chain of backups can then be utilized to restore data to a new service if needed. Once all backups included in a specific chain are past the retention time frame set for the service (more on retention below), the chain is discarded.
In the screenshot below, the solid line squares show full backups and the dotted line squares show incremental backups. The solid line rectangle around the squares denotes the retention period and the backups that are visible to the end user, which can be used for a backup restore. In the scenario below, backups are being taken every 24 hours and are retained for 2 days.
On Day 1, a full backup is taken to start the backup chain. On Day 2, an incremental backup is taken, and we now have a full and incremental backup available to restore from. By Day 7, we have one full backup and six incremental backups in the chain, with the most recent two incremental backups visible to the user. On Day 8, we take a new full backup, and on Day 9, once we have two backups in the new chain, the previous chain is discarded.
Default backup policy
In the Basic, Scale, and Enterprise tiers, backups are metered and billed separately from storage. All services will default to one daily backup with the ability to configure more, starting with the Scale tier, via the Settings tab of the Cloud console. Each backup will be retained for at least 24 hours.
See "Review and restore backups" for further details.
Configurable backups
Configurable Backups are available in the Scale and Enterprise plans. To upgrade, visit the plans page in the cloud console.
ClickHouse Cloud allows you to configure the schedule for your backups for Scale and Enterprise tier services. Backups can be configured along the following dimensions based on your business needs.
- Retention: The duration of days, for which each backup will be retained. Retention can be specified as low as 1 day, and as high as 30 days with several values to pick in between.
 - Frequency: The frequency allows you to specify the time duration between subsequent backups. For instance, a frequency of "every 12 hours" means that backups will be spaced 12 hours apart. Frequency can range from "every 6 hours" to "every 48 hours" in the following hourly increments: 
6,8,12,16,20,24,36,48. - Start Time: The start time for when you want to schedule backups each day. Specifying a start time implies that the backup "Frequency" will default to once every 24 hours. Clickhouse Cloud will start the backup within an hour of the specified start time.
 
The custom schedule will override the default backup policy in ClickHouse Cloud for your given service.
In some rare scenarios, the backup scheduler will not respect the Start Time specified for backups. Specifically, this happens if there was a successful backup triggered < 24 hours from the time of the currently scheduled backup. This could happen due to a retry mechanism we have in place for backups. In such instances, the scheduler will skip over the backup for the current day, and will retry the backup the next day at the scheduled time.
See "Configure backup schedules" for steps to configure your backups.
Bring Your Own Bucket (BYOB) Backups
This feature is available in the Enterprise plan. To upgrade, visit the plans page in the cloud console.
ClickHouse Cloud allows exporting backups to your own cloud service provider (CSP) account storage (AWS S3, Google Cloud Storage, or Azure Blob Storage). If you configure backups to your own bucket, ClickHouse Cloud will still take daily backups to its own bucket. This is to ensure that we have at least one copy of the data to restore from in case the backups in your bucket get corrupted. For details of how ClickHouse Cloud backups work, see the backups docs.
In this guide, we walk through how you can export backups to your AWS, GCP, Azure object storage, as well as how to restore these backups in your account to a new ClickHouse Cloud service. We also share backup / restore commands that allow you to export backups to your bucket and restore them.
Users should be aware that any usage where backups are being exported to a different region in the same cloud provider will incur data transfer charges.
Currently, we do not support cross-cloud backups, nor backup / restore for services utilizing Transparent Data Encryption (TDE) or for regulated services.
See "Export backups to your own Cloud account" for examples of how to take full and incremental backups to AWS, GCP, Azure object storage as well as how to restore from the backups.
Backup options
To export backups to your own cloud account, you have two options:
Via Cloud Console UI
External backups can be configured in the UI. By default, backups will then be taken daily (as specified in the default backup policy). However, we also support configurable backups to your own cloud account, which allows for setting a custom schedule. It is important to note that all backups to your bucket are full backups with no relationship to other previous or future backups.
Using SQL commands
You can use SQL commands to export backups to your bucket.
ClickHouse Cloud will not manage the lifecycle of backups in customer buckets. Customers are responsible for ensuring that backups in their bucket are managed appropriately for adhering to compliance standards as well as managing cost. If the backups are corrupted, they will not be able to be restored.