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 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 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
Storage types include Enterprise Edition or Standard Edition PolarStore Level 4 (PSL4) or PSL5. Data backup are categorized into level-1 backup and level-2 backup based on the storage location.
Storage location | Default configuration | Retention period | Benefit | How to view the size of a backup set |
Level-1 backup | Enabled | 3 to 14 days |
Note
| 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 cluster creates level-1 backup at 01:00 every day and retains the backup for 24 hours. If the PolarDB 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
Benefits
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 Permanently Retain Backups before Cluster Deletion 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 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 type
Description
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
Regions in the Chinese mainland: China (Hangzhou), China (Beijing), China (Shanghai), China (Shenzhen), China (Qingdao), China (Zhangjiakou), China (Chengdu),China (Hohhot) and China (Guangzhou)
Regions in the Chinese mainland: China (Hangzhou), China (Beijing), China (Shanghai), China (Shenzhen), China (Qingdao), China (Zhangjiakou), China (Chengdu), and China (Hohhot)
US (Silicon Valley) and US (Virginia)
China (Hong Kong), Singapore, Indonesia (Jakarta), Japan (Tokyo), and Malaysia (Kuala Lumpur)
Germany (Frankfurt)
China (Hong Kong)
US (Silicon Valley) and US (Virginia)
Japan (Tokyo), Singapore, Malaysia (Kuala Lumpur), and Indonesia (Jakarta)
Germany (Frankfurt)
Regions in the Chinese mainland: China (Hangzhou), China (Beijing), China (Shanghai), China (Shenzhen), China (Qingdao), China (Zhangjiakou), China (Chengdu), and China (Hohhot)
Billing
You can use the backup and restoration feature free of charge. However, backup files consume storage space. For more information, see Billing rules for backup storage that exceeds the free quota.