All Products
Search
Document Center

ApsaraDB RDS:Use the sparse backup feature

Last Updated:Apr 26, 2024

In addition to regular backups, ApsaraDB RDS for MySQL supports sparse backups. The sparse backup feature allows you to configure backup policies in a more flexible manner and retain the minimum number of backup sets. This reduces the period of time that is required to restore data from backup sets and reduces the storage costs of backup sets. This topic describes how to use the sparse backup feature.

Differences between regular backup and sparse backup

Item

Regular backup

Sparse backup

Retention policy

Backup sets are retained based on the retention period that you specify, and at least two and up to seven backup sets must be retained every week.

For example, a backup set is retained every Monday and Sunday for 365 days.

You can configure backup policies in a more flexible manner and retain the minimum number of backup sets.

For example, a backup set is retained every Monday and Sunday for seven days, and a backup set is retained on the last day of each month for a long period of time.

Storage cost

A large number of regular backup sets are generated, which increases storage costs.

The backup policies can be configured in a more flexible manner. The minimum number of backup sets is retained, which lowers storage costs.

Prerequisites

  • If this is the first time you use the backup feature of ApsaraDB RDS, you must attach the AliyunServiceRoleForDBS policy by using your Alibaba Cloud account. For more information, see How do I create a service-linked role for DBS?

  • The advanced backup settings are enabled. For more information, see Switch to the advanced backup settings.

    Note

    To use the sparse backup feature, you must switch to the advanced backup settings and configure backup policies. For more information, see Procedure.

Usage notes

  • After you configure a sparse backup policy, the configuration takes effect within approximately 10 to 15 minutes.

  • The backup policy in the first row is fixed and cannot be deleted. For the first backup policy, you must set the Backup Policy parameter to Every Week. After you select Every Week, you must also specify at least two days of a week.

  • If you configure more than one sparse backup policies to back up data on the same day, only one backup set is generated on the day and is retained based on the longest retention period among the policies.

  • If you delete a backup policy, the generated backup sets are still retained for the retention period for the policy. For more information, see Delete a backup policy.

  • After you configure sparse backup policies, if no backup set is created or dumped within the backup window on the day that you specify, the backup set on that day is skipped and no backup set is retained. This issue may occur due to various reasons, such as backup failure, the instance being locked, or the failure to dump the level-1 backup set within its validity period.

    For example, you configure a backup policy to perform a backup on the first day of every month and retain the backup set for 30 days. If the backup fails on December 1, no backup set will be retained for that day.

Billing rules

A free quota on backup storage is provided for your RDS instance. If the total size of the backup files of your RDS instance does not exceed the free quota, no backup fees are generated. If the total size exceeds the free quota, you are charged for the excess backup storage that you use. For more information about the free quota and billing rules, see Backup storage fees.

Procedure

You must manually configure backup policies to retain the minimum number of backup sets.

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane, click Backup and Restoration.

  3. On the Backup and Restoration page, click the Backup Strategy tab. On the tab that appears, click the circled number between MySQL and Level-1 Backup to view the backup policies that you configured.

    image.png

  4. In the dialog box that appears, click Add Backup Policy, configure sparse backup policies, and click OK.

    Backup cycle

    Backup time

    Retention period

    Every Week

    You can select one or more days of the week.

    You can configure a retention period for each backup policy. The retention period ranges from 7 to 7,300 days.

    Note

    You can also select Long-term Retention to the right of a backup policy to retain backup sets for a long period of time.

    Every Month

    You can select one or more days of the month or Last Day of Each Month.

    Every Year

    You can select a day of the year. For example, you can select January 1 of each year.

    Note
    • You can enable and configure the high-frequency physical backup feature for an RDS instance that runs MySQL 5.6 or MySQL 5.7 on RDS High-availability Edition with local disks. After you enable and configure the feature, a full backup is performed only at the specified point in time, and incremental physical backups are performed based on the backup frequency that you specify. For more information, see Use the high-frequency physical backup feature.

      • The retention period of incremental backup files generated by the high-frequency physical backup feature ranges from 7 to 30 days. The retention period of the incremental backup files must be less than or equal to the retention period of the backup policy that you specify.

      • A full backup set is not deleted after the expiration date because the incremental backup sets that depend on the full backup set do not expire. When all incremental backup files that depend on the full backup file expire, the full and incremental backup files are deleted.

    • The backup policy in the first row is fixed and cannot be deleted. For the first backup policy, you must set the Backup Policy parameter to Every Week. After you select Every Week, you must also specify at least two days of a week.

    • For more information about other parameters, see Use the automatic backup feature and Use the backup encryption feature.

  5. Click Save in the lower-left corner of the Backup Strategy tab.

Examples

image.png

The preceding figure is used as an example to describe different backup policies.

  • 1: Data is backed up every day of a week, and each backup set is retained for seven days.

  • 2: Data is backed up every Monday, and the backup set is retained for 30 days.

  • 3: Data is backed up on the first day and last day of each month, and the backup set is retained for 365 days.

  • 4: Data is backed up once every year on January 1, and the backup set can be retained for a long period of time.

What to do next

Query backup policies

On the Backup Strategy tab, move the pointer over the circled number to view the backup policies that you configured.

Note

The number in the circle indicates the number of backup policies that you configured.

image

Delete a backup policy

On the Level -1 Backup page, you can click the 删除 icon to delete a backup policy.

Note

The backup policy in the first row is fixed and cannot be deleted. For the first backup policy, you must set the Backup Policy parameter to Every Week. After you select Every Week, you must also specify at least two days of a week.

image

Switch to the advanced backup settings

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane, click Backup and Restoration.

  3. On the Backup and Restoration page, click the Backup Strategy tab and click Switch to Advanced Backup Policy.

    image

    Important

    If Switch to Advanced Backup Policy is not displayed on the tab, submit an application. After your application is approved, refresh the page.

  4. In the dialog box that appears, select Understood and click OK.

    Important

    After you switch to the advanced backup settings, you cannot switch back to the previous backup settings.

    If the information similar to the following figure is displayed, the advanced backup settings are enabled. Then, you can configure a sparse backup policy. For more information, see Procedure. image