Backup and recovery for PolarDB distributed edition

Updated at:
Copy as MD

Learn about backup and recovery features and billing for PolarDB-X.

Backup features

Backup types

PolarDB-X backups consist of data backups and log backups.

  • Data backup: Creates a backup set through physical backup. You can restore data to the point in time when the backup set was created.

  • Log backup: Also called incremental backup. Backs up binary logs (Binlog) that record data changes.

    With log backup enabled, you can restore data to any second within the retention period by combining data backups and log backups. For example, if a data backup was created at 00:00:01 on January 1, 2021, with subsequent log backups available, you can restore to any point from that time onward.

Backup methods

PolarDB-X supports automatic and manual backups.

  • Automatic backup: Periodic data backups triggered automatically.

    • The automatic backup policy is enabled by default and cannot be disabled. It includes both data and log backups.

    • By default, data backups run twice weekly on Mondays and Thursdays. Log backups run continuously. You can set the time window and frequency for automatic backups.

  • Manual backup: You can trigger a manual data backup only from the console.

Note
  • The minimum frequency for automatic backups is once per week.

  • Wait for the current manual backup to complete before starting another.

Backup storage location

  • Data backup: Stored in Alibaba Cloud backup storage. Does not consume instance storage. Retained for 30 days by default.

  • Log backup: Temporarily stored in instance storage. After 7 hours (default) or when logs reach 30% of instance storage, they are uploaded to Alibaba Cloud backup storage and retained for 7 days by default.

    Configure a local log retention policy to manage storage consumption. Backup operations.

Backup impact

PolarDB-X runs backups on secondary nodes of storage nodes (DNs). Because secondary nodes do not handle service traffic, backups consume no primary-node CPU and do not affect instance performance.

Note

In the rare case that secondary nodes are unavailable, backups run on the primary nodes.

Recovery features

Recovery methods

PolarDB-X supports two data recovery methods: recovery by backup set and point-in-time restore.

  • Recovery by backup set: Restores data from a data backup to the exact point in time when the backup set was created.

  • Point-in-time restore: Combines a data backup with log backups to restore data to any point in time (accurate to the second) within the retention period. For example, if a data backup was created at 00:00:01 on January 1, 2021, with subsequent log backups, you can restore to any point from that time onward.

Recovery destination

PolarDB-X restores data only to a new instance. After recovery, use a tool such as DTS to migrate data back to the original instance.

  • The new instance inherits the whitelist, backup, and parameter settings from the original instance.

  • The data in the new instance matches the data in the backup file or at the specified recovery point in time.

  • The new instance includes the account information that existed at the time of the backup or recovery point.

  • The new instance has the same topology as the original instance, meaning it has the same number of nodes.

Global consistency

PolarDB-X is a distributed database with data stored across multiple storage nodes (DNs). During restoration, the system must ensure data consistency across all nodes despite concurrent distributed transactions. The following diagram illustrates global consistency with a fund transfer example:

image

PolarDB-X stores a user account balance table distributed across two storage nodes, with a total balance of USD 200. Distributed transactions continuously transfer funds between accounts.

At 16:14:20 on July 25, 2021, account B transferred USD 30 to account A, and account D transferred USD 20 to account C. Global consistency requires the restored data to reflect either the state before or after both transfers complete. The total balance must remain USD 200 (Restore 2). An intermediate state where the total is USD 250 (Restore 1) indicates global inconsistency.