All Products
Search
Document Center

ApsaraDB RDS:Use the automatic backup feature

最終更新日:Oct 30, 2023

Automatic backup and manual backup are supported for ApsaraDB RDS for MySQL instances and serverless ApsaraDB RDS for MySQL instances.

For more information about how to use the automatic backup feature for an RDS instance that runs a different database engine, see the following topics:

Note

The automatic backup feature that is provided by ApsaraDB RDS stores backup files in the same region as your RDS instance. If you want to store backup files to a region that is different from the region of your RDS instance, follow the instructions provided in Use the cross-region backup feature of an ApsaraDB RDS for MySQL instance.

Introduction to backups

You can back up your RDS instance by using one of the following methods:

  • ApsaraDB RDS: The system provides a default backup feature that supports full data backups and incremental log backups.

  • DBS: Database Backup (DBS) provides the logical backup feature. The logical backup supports advanced capabilities such as cross-account backup and quick query.

For more information about the differences between the default backup feature of ApsaraDB RDS and the logical backup feature of DBS, see Differences between default RDS backups and advanced DBS backups.

Use ApsaraDB RDS to perform automatic backups

ApsaraDB RDS supports automatic data backups and automatic log backups. Data backups cannot be disabled. However, you can change the data backup frequency based on your business requirements.

Instance category

Minimum frequency

Maximum frequency

  • RDS instances that run RDS High-availability Edition or RDS Enterprise Edition with local disks

  • RDS instances that run RDS Basic Edition with cloud disks

Twice every week

Once every day.

RDS instances that run RDS High-availability Edition or RDS Cluster Edition with cloud disks

Once every 15 minutes. You must enable the Increase Snapshot Frequency feature.

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?

Usage notes

Procedure

  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. In the Basic Backup section of the tab that appears, click Edit.

  4. Configure the following parameters and click OK.

    Note

    If your RDS instance uses cloud disks, the system creates snapshots to back up the data of the RDS instance.

    Table 1. Data backup settings

    Instance category

    Parameter

    Description

    All RDS instances

    Backup retention in days

    The number of days for which backup files are retained. Default value: 7. Valid values:

    • For RDS instances that use cloud disks: 7 to 730.

      Note
      • If your RDS instance runs MySQL 5.7 on RDS Basic Edition, the value is fixed as 7.

      • If you enable the single-digit second backup feature, the value of this parameter ranges from 7 to 730.

    • For RDS instances that use local disks: 7 or more. The value must be less than 2 to the power of 31.

      • Data backup files that are retained for 730 days or less are considered regular backup files.

      • Data backup files that are retained for more than 730 days are converted into archived backup files. The cost of archived backup files is less than the cost of regular backup files. For more information, see Backup storage pricing of an ApsaraDB RDS for MySQL instance.

      Note

      If you set this parameter to a value greater than 730 or select Long-term Retention, you must specify the number of archived backup files to retain. For example, if you select Monthly and enter 2 in the unit field, the system retains the first two archived backup files that are generated each month.

    Full Backup Cycle

    The cycle based on which data backups are created. You must select at least two days of the week.

    Start At

    The time at which a data backup starts. For example, you can select 08:00. We recommend that you select an off-peak hour.

    RDS instances that use local disks

    Database/Table Restoration

    Specifies whether to enable the restoration feature for individual databases and tables. For more information, see Restore individual databases and tables of an ApsaraDB RDS for MySQL instance The restoration feature for individual databases and tables is automatically enabled and cannot be disabled.

    Note

    Fast Restoration

    Specifies whether to enable the fast restoration feature for individual databases and tables. If you enable the fast restoration feature for individual databases and tables, the data is restored at a fast speed. If you disable the fast restoration feature, the data is restored at a standard speed. For more information, see Restore individual databases and tables of an ApsaraDB RDS for MySQL instance.

    • Standard: Data is restored at a standard speed.

    • Fast: Data is restored at a speed that is 50% to 95% faster than standard restoration.

    Note
    • If you enable the fast restoration feature for individual databases and tables, you must also configure the CDM Billing Method and CDM Retention Period parameters.

    • The fast restoration feature for individual databases and tables is not supported in some Alibaba Cloud regions.

    Retain Backup Files after Instance Release

    Specifies whether to retain backup files after the RDS instance is released.

    Note
    • This parameter is displayed and can be configured only when your RDS instance uses local disks and was created at least seven days ago.

    • We recommend that you select Latest or All. After your RDS instance is released, you can go to the Backup for Deleted Instances tab to download the backup files of your RDS instance. Then, you can use the backup files to restore the data of your RDS instance. For more information, see Configure the backup retention policy after the instance is released.

    RDS instances that use cloud disks

    Backup within Seconds

    Specifies whether to enable the single-digit second backup feature. If the feature is enabled, a snapshot backup can be completed within a few seconds.

    Note

    This feature is supported for RDS instances that run RDS High-availability Edition with enhanced SSDs (ESSDs) or run RDS Cluster Edition.

    Increase Snapshot Frequency

    The frequency at which snapshot backups are created. You can configure a shorter interval to create snapshots by using the single-digit second backup feature, which increases the frequency of the snapshots. You can increase the frequency to up to once every 15 minutes. For more information, see Use the high-frequency snapshot backup feature for an ApsaraDB RDS for MySQL instance.

    Note
    • This feature is supported for RDS instances that run RDS High-availability Edition with cloud disks or run RDS Cluster Edition.

    • Before you can use this feature, you must enable the single-digit second backup feature. If the single-digit second backup feature is disabled, ApsaraDB RDS automatically enables the single-digit second backup feature when you enable the high-frequency snapshot backup feature.

    Fast Database/Table Restoration

    Specifies whether to enable the fast restoration feature for individual databases and tables. Fast restoration provides a restoration speed that is 50% to 95% faster than standard restoration. For more information, see Restore individual databases and tables of an ApsaraDB RDS for MySQL instance.

    Note

    The fast restoration feature for individual databases and tables is not supported in some Alibaba Cloud regions.

    Table 2. Log backup settings

    Parameter

    Description

    Log Backup

    Specifies whether to enable the log backup feature. After the feature is enabled, you can restore the data of your RDS instance to a point in time. This feature is enabled by default.

    Log Backup Retention Period (Days)

    • Valid values: 7 to 730. Default value: 7.

    • The log backup retention period must be less than or equal to the data backup retention period.

    Note

    If your RDS instance runs MySQL 5.7 on RDS Basic Edition, the value is fixed as 7.

Use DBS to perform automatic backups

  1. Create a backup schedule. Make sure that you select the logical backup method.

  2. Configure the backup schedule that you created.

For more information, see Back up an ApsaraDB RDS for MySQL or self-managed MySQL instance by using logical backup.

FAQ

  1. When a backup is in progress, does the performance of my RDS instance decrease?

    RDS edition

    Impact

    RDS High-availability Edition, RDS Cluster Edition, or RDS Enterprise Edition

    Backup operations are performed on the secondary RDS instance. In this case, the operations do not occupy the CPU resources or affect the performance of the primary RDS instance.

    Note

    In rare cases when the secondary instance is unavailable, backups are performed on the primary instance.

    RDS Basic Edition

    If an RDS instance runs RDS Basic Edition, the instance stands alone. All backup operations are performed on the RDS instance. In this case, the performance of the RDS instance decreases during a backup.

  2. How do I query data from backup files at fast speeds?

    If you have full logical backup files, you can use DBS to query data from these files. This way, you do not need to restore the data of these files. For more information, see Overview.

  3. Can I disable the data backup feature for my RDS instance?

    No, you cannot disable the data backup feature for your RDS instance. However, you can reduce the data backup frequency to as low as twice a week. The data backup retention period must span at least seven days.

  4. Can I disable the log backup feature for my RDS instance?

    Yes, you can be disabled the log backup feature for your RDS instance. You can disable the log backup feature for your RDS instance in the ApsaraDB RDS console.

  5. Why does my backup task fail?

    A possible cause is that you executed time-consuming DDL statements or UPDATE statements when your backup task was in progress. These statements triggered locks on tables, and your backup task failed as a result of the locks.

  6. Why is the size of a snapshot backup file significantly larger than the amount of data on my RDS instance?

    The size of backup files may not equal the amount of data on your RDS instance. If your RDS instance uses cloud disks, the system creates snapshots to back up your RDS instance. The size of a snapshot backup file may be significantly larger than the amount of data. The free quota on backup storage for an RDS instance that uses cloud disks is 200% of the storage capacity of the RDS instance. The free quota on backup storage for an RDS instance that uses local disks is 50% of the storage capacity of the RDS instance.

    Note

    When the system calculates the size of a snapshot backup file, the system counts in all the non-empty blocks to which data is written. If the write operations are scattered among blocks, none of the blocks is empty. For example, if 3 MB of data is written across two, three, or four blocks, none of these blocks is empty. In this case, the system counts in all these blocks to calculate the total size. As a result, the size of the snapshot backup file is larger than the actual amount of data.

References

Related operations

Category

Operation

Description

ApsaraDB RDS

ModifyBackupPolicy

Modifies the backup settings of an instance.

DescribeBackupPolicy

Queries the backup settings of an instance.

DescribeBackups

Queries the backup sets of an instance.

DescribeBackupTasks

Queries the backup tasks of an instance.

DBS

CreateBackupPlan

Creates a backup plan.

ConfigureBackupPlan

Configures a backup plan.