All Products
Search
Document Center

PolarDB:Backup mechanism

Last Updated:Aug 20, 2025

A data backup of a PolarDB cluster backs up the full data of the cluster at a specific point in time and generates a backup set (snapshot). The backup process uses the Redirect-on-Write (ROW) snapshot mechanism and directly stores the backup sets on the distributed storage system of the PolarDB cluster. When a backup set is created, the system does not duplicate all data but references the current live data blocks. When a data block is modified, the system preserves the old version of the data block as part of the backup set and creates a new data block to store the modified data. The system updates the reference from the original data block to the new data block. The backup set continues to reference the original data block. This topic describes how data blocks change when backup sets are created, backup sets are deleted, and data is deleted from the cluster.

Create level-1 backup sets

When you create a level-1 backup set, the backup set only references the data blocks in the PolarDB cluster and does not occupy storage space. However, when you modify a data block, the original version of the data block is transferred to the backup set.

Example

A PolarDB cluster creates a data backup set at 09:00, 10:00, and 11:00. After each backup is created, data additions and modifications are performed for the cluster. The following table describes the data backup mechanism.

Time

Action

Description

09:00

Create backup set 1

The cluster has three data blocks: A, B, and C. When backup set 1 is created, the backup set references data blocks A, B, and C in the cluster and does not occupy storage space.

09:00 to 10:00

  • Change data block A to A1

  • Change data block B to B1

  • Add data block D

During the addition and modification operations, the cluster allocates new data blocks to store data blocks A1, B1, and D. The original data blocks A and B are transferred to backup set 1.

10:00

Create backup set 2

The cluster has four data blocks: A1, B1, C, and D. When backup set 2 is created, the backup set references data blocks A1, B1, C, and D in the cluster and does not occupy storage space.

10:00 to 11:00

  • Change data block C to C1

  • Add data block E

During the addition and modification operations, the cluster allocates new data blocks to store data blocks C1 and E. The original data block C is transferred to backup set 2.

11:00

Create backup set 3

The cluster has five data blocks: A1, B1, C1, D, and E. When backup set 3 is created, the backup set references data blocks A1, B1, C1, D, and E in the cluster and does not occupy storage space.

11:00 to the time when the next data backup is created

  • Change data block A1 to A2

  • Change data block E to E1

During the modification operations, the cluster allocates new data blocks to store data blocks A2 and E1. The original data blocks A1 and E are transferred to backup set 3.

The same mechanism applies to the subsequent backup process.

image

Delete level-1 backup sets

When you delete a backup set, a data block that is still referenced by another backup set is transferred to the other backup set. Unused data blocks are directly released.

Example

A PolarDB cluster has three backup sets: backup set 1, backup set 2, and backup set 3. The backup sets contain the following data blocks:

  • Backup set 1: Data blocks A, B, and C.

    • Stores data blocks A and B.

    • References data block C stored in backup set 2.

  • Backup 2: Data blocks A1, B1, C, and D

    • Stores data block C.

    • References data block A1 stored in backup set 3.

    • References data block B1 and D in the primary version.

  • Backup set 3: Data blocks A1, B1, C1, D, and E.

    • Stores data blocks A1 and E.

    • References data blocks B1, C1, and D from the primary version.

Note
  • In this example, the data is based on the example in the "Create level-1 backup sets" section of this topic.

  • The primary version is the current data version of the PolarDB cluster and contains the current version of all data blocks in the cluster.

The following section describes how data blocks are processed based on the backup set deletion mechanism when backup sets are deleted:

  1. When backup set 1 is deleted, data blocks A and B are directly released.

  2. When backup set 3 is deleted, data block A1 required by backup set 2 is transferred to backup set 2, and data block E is directly released.

  3. When backup set 2 is deleted, data blocks A1 and C are directly released.

image

Delete data in a cluster

When you delete a data table from a PolarDB cluster, the primary version releases the data blocks in the table and transfers the data blocks to the backup set.

Note

The primary version is the current version of the PolarDB cluster and contains the current version of all data blocks.

Example

A PolarDB cluster has backup set 1 that references data blocks A, B, C, D, and E from the primary version.

At a specific point in time, the PolarDB cluster releases data blocks B, C, D, and E. In this case, data blocks B, C, D, and E are transferred to backup set 1. The storage size may increase after the data is released from the primary version.

Data blocks B, C, D, and E are released only after backup 1 expires. In this case, the storage space is reduced.

image