This topic describes how to enable PolarDB-O to automatically create backups at specified intervals or manually create backups to prevent data loss in a timely manner. PolarDB-O also allows you to retain backups of a cluster when you delete the cluster.
Backup types
Backup type | Description |
---|---|
Level-1 backup (data backup) |
Level-1 backups are created based on Redirect-on-Write (ROW) snapshots. These snapshots are stored on a cluster that supports distributed storage. The system does not replicate data when it saves a data block to a snapshot. When a data block is modified, the system saves one of the previous versions of the data block to a snapshot and creates a new data block that is redirected by the original data block. Therefore, you can create backups within a few seconds regardless of the size of your database storage. Compared with level-2 backups, it takes less time to create and restore level-1 backups. However, level-1 backups take up more storage space. PolarDB clusters are backed up and restored by using multi-threaded parallel processing. This improves efficiency. A level-1 backup (snapshot) can be restored or cloned at a rate of 1 TB every 40 minutes. Level-1 backups can be retained for 7 to 14 days. By default, the level-2 backup feature is enabled to ensure the data security. The following figure shows the total physical storage of level-1 backups. ![]() Warning To disable the backup feature, submit a ticket. After you disable this feature, you must bear the risks that may arise. For example,
data loss may occur due to user errors.
|
Level-2 backup (data backup) | Level-2 backups are level-1 backups that are compressed and then stored in on-premises
storage media. Level-2 backups are slower to restore than level-1 backups. However,
the costs incurred for level-2 backups are lower than that of level-1 backups.
Level-2 backups can be retained for 30 to 7,300 days. You can also enable the Retained Before Cluster Is Deleted feature. By default, the level-2 backup feature is disabled If you enable this feature, expired level-1 backups are transferred to on-premises storage media and stored as level-2 backups. The level-1 backups are transferred to level-2 backups at a rate of approximately 150 MB/s. Note If a level-1 backup expires before the task of transferring the previous level-1 backup
to a level-2 backup is completed, the level-1 backup is deleted and is not transferred
to a level-2 backup. For example, the system creates level-1 backups at 01:00 (UTC+8)
every day for PolarDB clusters, and retains the level-1 backups for 24 hours. The
system creates Level-1 Backup A at 01:00 (UTC+8) on January 1, and creates Level-1
Backup B at 01:00 (UTC+8) on January 2. Level-1 Backup A expires at 01:00 (UTC+8)
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 (UTC+8)
on January 3. Therefore, after Level-1 Backup B expires at 01:00 (UTC+8) on January
3, Level-1 Backup B is deleted and is not transferred to a level-2 backup.
|
Log backup |
The log backup feature creates backups by updating redo logs to Object Storage Service (OSS) in parallel. Based on a full backup (snapshot) and redo logs, you can perform point-in-time recovery (PITR) for a PolarDB cluster. Log backups can avoid data loss caused by user errors. Log backups can be retained for 7 to 7,300 days. You can also enable the Retained Before Cluster Is Deleted feature to store data permanently. Note If you want to restore data to a specific time point, you must include the time required
to replay the redo log files. It takes about 20 to 70 seconds to replay 1 GB of redo
log data. The total restoration time is the sum of the time required to restore data
based on backup sets and the time required to replay the redo log files.
|
Pricing
The backup and restoration features of PolarDB are free of charge. Only storage fees are charged. Fees are calculated based on the storage space that is consumed by backup files and the amount of time for retaining the backup files. Backup files consist of data files and log files.
Region | Level-1 backup | Level-2 backup | Log backup |
---|---|---|---|
Regions in mainland China | USD 0.000464/GB/hour | USD 0.0000325/GB/hour | USD 0.0000325/GB/hour |
Hong Kong (China) and regions outside China | USD 0.000650/GB/hour | USD 0.0000455/GB/hour | USD 0.0000455/GB/hour |
Billing methods
Backup type | Free quota | Billing method |
---|---|---|
Level-1 backup | Database storage usage × 50%
You can view the database storage usage of a cluster on the Overview page of the cluster in the PolarDB console. |
Storage fee per hour = (Total physical storage of level-1 backups - Free quota) ×
Unit price per hour
For example, if the total physical storage of level-1 backups is 700 GB and the database storage usage is 1,000 GB, the storage fee per hour is USD 0.0928. The fee is calculated based on the following formula: [700 GB - (1,000 GB × 50%)] × USD 0.000464 = USD 0.0928. |
Level-2 backup | None | Storage fee per hour = Total physical storage of level-2 backups × Unit price per
hour
For example, if the total physical storage of level-2 backups is 1,000 GB, the storage fee per hour is USD 0.0325. The fee is calculated based on the following formula: 1,000 GB × USD 0.0000325 = USD 0.0325. |
Log backup | 100GB | Storage fee per hour = (Total physical storage of log backups - 100 GB) × Unit price
per hour
For example, if the total physical storage of log backups is 1,000 GB, the storage fee per hour is USD 0.02925. The fee is calculated based on the following formula: (1,000 GB - 100 GB) × USD 0.0000325 = USD 0.02925. |
Backup methods
Backup method | Description |
---|---|
Automatic system backup |
Note To prevent data loss, automatic backups must be performed at least twice a week.
|
Manual backup |
|
Configure the automatic backup feature
Manually create a backup
Restore data
For more information, see Restore data.
FAQ
- Is the total physical storage space of level-1 backups equal to the size of all the
snapshot backups?
No, the total physical storage space of level-1 backups is not equal to the size of all the snapshot backups. The total physical storage space of level-1 backups is displayed in the ① section, as shown in the following figure.
- Why is the total physical storage space of level-1 backups smaller than the size of
a single backup?
The storage space of level-1 backups in PolarDB is measured by using two methods: logical storage space of each backup and physical storage space of all the backups. PolarDB uses snapshot chains to store level-1 backups. The same data blocks are replicated only once. Therefore, the physical storage space of all the level-1 backups is smaller than the logical storage space of all the level-1 backups. In some cases, the physical storage space of all the level-1 backups is even smaller than the logical storage space of a single backup.
- How are you billed for backups in PolarDB ?
You are billed for the storage space of level-1 backups, level-2 backups, and log backups. By default, the level-1 backup and log backup features are enabled and the level-2 backup feature is disabled. Alibaba Cloud offers some storage space for free to store backup files.
- What is the billing method of level-1 backups?
Storage fee per hour = (Total physical storage space of level-1 backups - Database storage usage × 50%) × Unit price per hour. For example, the total physical storage space of level-1 backups of a PolarDB database is 700 GB and the database storage usage is 1,000 GB. Then, the storage fee per hour is calculated based on the following formula: (700 GB - 500 GB) × USD 0.000464/GB = USD 0.0928.
- Can I use a storage package to deduct the storage fees of backup data?
No, a storage package can be used to deduct only the storage fees of business data instead of backup data.
API reference
API | Description |
---|---|
CreateBackup | Creates a full snapshot backup for a specified PolarDB cluster. |
DescribeBackups | Queries the backup information of a specified PolarDB cluster. |
DeleteBackup | Deletes the backups of a PolarDB cluster. |
DescribeBackupPolicy | Queries the automatic backup policy of a specified PolarDB cluster. |
ModifyBackupPolicy | Modifies the automatic backup policy of a specified PolarDB cluster. |