PolarDB-X supports automatic backup and manual backup. This helps you restore historical data from backups. This topic describes the features that are used to back up data.

Features

Backup type

PolarDB-X provides data backup and log backup.

  • Data backup: The system backs up data and creates a backup set. Physical backup is used for data backup.
  • Log backup: This feature is also known as incremental backup. This feature backs up binary logs that record data changes. After log backup is enabled, you can restore data to a specific point in time within the backup window. The data is restored based on data backup and log backup. The point in time that you specify to restore data is accurate to seconds. For example, if a data backup set is created for an instance at 00:00:01 on January 1, 2021 and log backup is enabled for the instance, you can restore data to a specific point in time elapsed from 00:00:01 on January 1, 2021. The point in time is accurate to seconds.
Backup mode

PolarDB-X supports automatic backup and manual backup.

  • Automatic backup: The system automatically triggers data backup at specific intervals.
    • By default, automatic backup is enabled. The system automatically enables data backup and log backup.
    • By default, data backup is performed once per day. Logs are continuously backed up. You do not need to configure the frequency for log backup. You can configure the backup window and backup interval for automatic backup. For more information, see Configure automatic backup.
  • Manual backup: You can trigger a data backup task in the console. For more information, see Manually create a backup. Manual backup is supported only for data backup. Logs are continuously backed up. You do not need to manually trigger a log backup task.
Note
  • To prevent data loss, we recommend that automatic backup is performed at least twice a week.
  • Before you start a manual backup task, make sure that the previous manual backup task is completed.
Storage location for backup files
  • Data backup: Data backup files are stored in the storage systems that are provided by Alibaba Cloud. Data backup files do not consume the storage of your database instance. By default, data backup files are retained for 30 days.
  • Log backup: Log backup files are temporarily stored in your database instance. After the log backup files are stored for a specific period of time or the storage usage of your database instance is equal to a specific percentage of the total storage, the log backup files are uploaded to the storage systems that are provided by Alibaba Cloud. By default, if the log backup files are stored in your database instance for 7 hours or the storage usage of your database instance is equal to 30 percent of the total storage, the log backup files are uploaded. This way, log backup files are retained for seven days in the storage systems provided by Alibaba Cloud.

    You can configure the retention policy for log backup files in local storage. This can help you reduce the storage usage of log backup files. For more information, see Configure log backup for local storage.

Note The storage system that is provided by Alibaba Cloud to store log backup files is deployed in the same region as your PolarDB-X instance. The storage system and the PolarDB-X instance can be deployed in different zones in the same region. Cross-region storage is not supported for data backup and log backup.
Impact

The tasks for data backup and log backup run on the secondary nodes of data nodes in PolarDB-X. PolarDB-X does not distribute business traffic to the secondary nodes. This way, data backup and log backup do not affect the instance performance.

Billing method

  • Data backup: You are not charged when you use this feature.
  • Log backup: You are charged only for the used storage of your database instance. The billing method and pricing of log backup are the same as the billing method and pricing of the storage usage in PolarDB-X.

Note

  • During the backup process, we recommend that you do not scale out, scale up, or scale down your PolarDB-X instance. This can help you prevent backup failures.
  • During the backup process, we recommend that you do not execute DDL statements. These statements can trigger locks on tables. The locks on tables may cause the backup task to fail.
  • You cannot download data backup files or log backup files.

Configure automatic backup

  1. Log on to the PolarDB-X console.
  2. In the top navigation bar, select the region where the target instance is located.
  3. On the Instance List page, click the PolarDB-X 2.0 tab.
  4. Find the target instance and click its ID.
  5. In the left-side navigation pane, choose Data recovery > Backup Recovery.
  6. Click Backup policy.
    456789
  7. On the Data Backup settings tab, configure the following parameters.
    Parameter Description
    Enable backup Enable or disable automatic backup.
    Note By default, automatic backup is enabled.
    Backup set retention period Configure the retention period for automatic backup. Valid values: 7 to 730. Unit: days.
    Note PolarDB-X deletes the backup files that are stored for a longer period of time than the specified retention period.
    Backup window Configure the backup window for automatic backup. You can select a time range from the drop-down list. We recommend that you select a time period that is within off-peak hours.
    Backup cycle Configure the frequency for automatic backup.
    Note To prevent data loss, we recommend that automatic backup is performed at least twice a week.
    Log backup retention period Configure the retention period of log backup files.
    • Valid values: 0 to 730. Unit: days.
    • If you set this parameter to 0, no log backup files are retained. The value 0 specifies that log backup is disabled.
  8. Click OK.
    Note
    • By default, automatic backup is enabled.
    • PolarDB-X deletes the backup files that are stored for a longer period of time than the specified retention period.
    • To prevent data loss, we recommend that automatic backup is performed at least twice a week.

Configure log backup for local storage

  1. Log on to the PolarDB-X console.
  2. In the top navigation bar, select the region where the target instance is located.
  3. On the Instance List page, click the PolarDB-X 2.0 tab.
  4. Find the target instance and click its ID.
  5. In the left-side navigation pane, choose Data recovery > Backup Recovery.
  6. Click Backup policy.
  7. On the Local log settings tab, configure the following parameters.
    Parameter Description
    Retention duration The retention period for log backup files in the PolarDB-X instance. Default value: 7. Unit: hours. The default value specifies that only the log backup files created within the most recent 7 hours are retained in local storage after log backup is enabled. The log backup files that are created before the most recent 7 hours are deleted. Valid values: 0 to 168.
    Space usage does not exceed The maximum storage that can be used by backup files of binary logs. Calculation formula: Local storage usage = Size of local binary log backups/Total storage of your PolarDB-X instance. By default, this parameter is set to 30. This value specifies that if the local backup files of binary logs consume more than 30 percent of the total storage, the system deletes the earliest backup files of binary logs. Valid values: 0 to 50.
    Free space protection Specifies whether to forcibly delete the earliest backup files of binary logs. This scenario occurs if the used storage of the instance exceeds 80 percent of the total storage or the available storage is less than 5 GB. By default, this feature is enabled. When the overall storage usage is less than 80 percent and the available storage exceeds 5 GB, the system stops deleting backup files of binary logs.

Manually create a backup

  1. Log on to the PolarDB-X console.
  2. In the top navigation bar, select the region where the target instance is located.
  3. On the Instance List page, click the PolarDB-X 2.0 tab.
  4. Find the target instance and click its ID.
  5. In the left-side navigation pane, choose Data recovery > Backup Recovery.
  6. Click Create backup.
  7. In the dialog box that appears, click OK.