Data is a core asset for enterprises. As business of enterprises grows, data increases exponentially. This requires business applications to be able to process data online and in real time. It becomes more challenging for database O&M personnel to protect the core data of their enterprises, because various factors, such as accidental data deletion, system vulnerabilities, ransomware, hardware failures, and natural disasters, may cause data losses. Therefore, data backup and restoration are important features of databases.
PolarDB for MySQL supports data backup and physical log backup. Backing up data is a process of creating a backup set (snapshot) of all data on a cluster at a specific point in time. Data backup is a full backup. Backing up logs is a process of recording the new data after a backup set is created. Log backup is an incremental backup. You can restore your PolarDB for MySQL cluster or a specific instance or table in your cluster to any point in time by using a full data backup set and the redo logs generated after the backup set is created.
Data backup
Data backup are categorized into level-1 backup and level-2 backup based on the storage location.
The location where backup sets are stored | Default configuration | Retention period | Benefit | How to view the size of a backup set |
Level-1 backup | Enabled | 3 to 14 days |
Note By default, the level-1 backup feature is enabled, and you cannot disable this feature. | The following figure shows the total physical storage of level-1 backup. Note
|
Level-2 backup | Disabled |
|
Note If a level-1 backup expires before the previous one is transferred to a level-2 backup, the level-1 backup is deleted and is not transferred to a level-2 backup. For example, a PolarDB for MySQL cluster creates level-1 backup at 01:00 every day and retains the backup for 24 hours. If the PolarDB for MySQL cluster creates Level-1 Backup A at 01:00 on January 1 and creates Level-1 Backup B at 01:00 on January 2. Level-1 Backup A expires at 01:00 on January 2 and starts to be transferred to a level-2 backup. However, Level-1 Backup A stores a large amount of data, and the transfer task is not completed by 01:00 on January 3. In this case, Level-1 Backup B is deleted after it expires at 01:00 on January 3 and is not transferred to a level-2 backup. | The following figure shows the total size of level-2 backup. The total size of level-2 backup is the sum of the data sizes of all level-2 backup. |
Physical log backup
Benefit
The log backup feature allows you to create backup by uploading real-time redo logs to Object Storage Service (OSS) in parallel. Log backup can be stored in the same region as the PolarDB cluster or in a different region. They are retained for 3 to 7,300 days. You can save the backup permanently by enabling the Retained Before Cluster Is Deleted feature.
NoteBy default, log backup is stored in the same region as the PolarDB cluster. This backup storage method cannot be disabled.
Log backup helps consistent point-in-time recovery. Based on a full backup set (snapshot) and the redo logs generated after the backup set is created, you can perform point-in-time recovery (PITR) for a PolarDB for MySQL cluster. Log backup can prevent data loss caused by user errors and ensure the security of data that is generated within a period of time. If you perform PITR, you must consider the amount of time that is required to query redo logs. Redo logs are queried at a rate of 1 GB every 20 seconds to 70 seconds. The total restoration duration is the sum of the time required to restore backup sets and the time required to query redo logs.
How to view the size of a backup set
The following figure shows that the total size of log backup is the sum of the size of each log backup file.
Single-region backup and cross-region backup
Differences
Backup storage method
Differences
Default configuration
Scenario
Benefit
Single-region backup
Back up files are stored in the same region as the PolarDB cluster but in a different zone.
Enabled
NoteThis storage method is enabled by default when you enable level-2 backup.
Long-term archiving
Allows you to reduce costs by dumping data at a low backup frequency.
Cross-region backup
Back up files are stored in a different region from the PolarDB cluster.
Disabled. Cross-region backup must be manually enabled.
Geo-redundancy and MLPS level 3
Allows you to reduce recovery point objective (RPO). This backup storage method is suitable for private network environments that are encrypted and highly secure. You can reduce costs by dumping data at a low backup frequency.
NoteLow-frequency level-2 backup: The backup frequency of level-2 backup is lower than that of level-1 backup.
Alibaba Cloud regions in which the cross-region backup feature is supported
Source region
Destination region
China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Shenzhen), and China (Hong Kong).
China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Shenzhen), and China (Hong Kong).
NoteCross-region backup files are replicated to a region that is different from the source region.
US (Silicon Valley)
US (Virginia)
US (Virginia)
US (Silicon Valley)
China East 1 Finance
China East 2 Finance and China South 1 Finance
China East 2 Finance
China East 1 Finance and China South 1 Finance
China South 1 Finance
China East 1 Finance and China East 2 Finance