ApsaraDB RDS for MySQL supports automatic and manual backups. If the data of your RDS instance is lost or corrupted, you can restore the instance from available backup files. If your RDS instance uses local SSDs, you can retain the backup files for a specific period of time after the instance is released.
For more information about how to back up an RDS instance that runs another database engine, see the following topics:
- Back up an ApsaraDB RDS for SQL Server instance
- Back up an ApsaraDB RDS for PostgreSQL instance
- Back up an ApsaraDB RDS for PPAS instance
- Automatically back up the data of an RDS MariaDB instance
Functionality
- If your RDS instance uses local SSDs, you can retain the backup files for a long period of time. In addition, you can specify a policy that is used to retain the backup files. The specified policy is triggered after your RDS instance is released. This prevents data losses that are caused by unintentional operations. For more information, see Modify the backup settings of an RDS instance that uses local SSDs.
- If your RDS instance uses standard or enhanced SSDs, you can create snapshot backups in minutes. For more information, see Modify the backup settings of an RDS instance that uses standard or enhanced SSDs.
Billing
Each RDS instance is allocated a free quota for backup storage. If your backup storage usage exceeds the free quota, you are charged extra fees. We recommend that you specify a proper backup cycle based on your business requirements to maximize the usage of the free backup storage. For more information about the free quota for backup storage, see View the free quota for backup storage of an ApsaraDB RDS for MySQL instance.
After the free quota is exhausted, your backup storage usage is charged based on the specified retention period. For more information about the pricing of regular backup files that are retained for 730 days or less, visit the ApsaraDB RDS pricing page. For more information about the pricing of archived backup files that are retained for more than 730 days, see Pricing of Long-Term Backup Files on Alibaba Cloud International Site.
Precautions
- Your RDS instance supports archived backup files only when the instance uses local SSDs.
- You can specify the backup settings of your RDS instances only when the instance is a primary instance. Read-only RDS instances do not support backup settings.
- When a backup is in progress, you must not execute data definition language (DDL) statements. These statements trigger locks on tables, and the backup may fail as a result of the locks.
- We recommend that you back up your RDS instance during off-peak hours.
- If your RDS instance has a large amount of data, a backup may require a long period of time.
- Backup files are retained based on the specified retention period. Before the retention period elapses, we recommend that you download the required backup files to your computer.
- If the number of tables that are created on your RDS instance exceeds 50,000, you cannot restore individual databases or tables. For more information, see Restore individual databases and tables of an ApsaraDB RDS for MySQL instance. If the number of tables exceeds 600,000, you cannot back up your RDS instance. In these cases, we recommend that you shard the databases on your RDS instance.
Overview of data and log backups
- Data backup
Data backups are copies of the data in the databases on your RDS instance. These backups include physical, logical, and snapshot backups. You can use these backups to restore the data of your RDS instance. For more information, see Restore the data of an ApsaraDB RDS for MySQL instance. Your RDS instance automatically creates physical or snapshot backups based on the type of storage media that you use. For more information, see Storage types.
- Local SSDs (High-availability or Enterprise Edition)
- Your RDS instance supports full physical backups in automatic backup mode.
- Your RDS instance supports full physical backups, full logical backups, and single-database logical backups in manual backup mode.
- Standard or enhanced SSDs (Basic or High-availability Edition)
Your RDS instance supports only snapshot backups. You can use snapshot backup files to restore data to a new RDS instance. You cannot download snapshot backup files.
- Local SSDs (High-availability or Enterprise Edition)
- Log backup
Log backups are copies of the binary logs that are generated on your RDS instance. You can use log backup files to restore the data of your RDS instance to a specific point in time. For more information, see Restore the data of an ApsaraDB RDS for MySQL instance. Your RDS instance automatically backs up the binary logs of your RDS instance.
- Log backup files occupy the storage space of your RDS instance.
- If the size of a log backup file reaches 500 MB or the duration of write operations
to the file reaches 6 hours, your RDS instance starts to write data to a new log backup
file. The old log backup file is then asynchronously uploaded to an Object Storage
Service (OSS) bucket.
Note You cannot access the OSS bucket that stores log backup files.
- You can specify the rules that are used to upload backup log files. These rules ensure
that your RDS instance uploads the backup log files to the specified OSS bucket at
fast speeds. For more information, see Configure policies to delete binary log files from an ApsaraDB RDS for MySQL instance.
Note The Basic Edition does not support the upload of log backup files to an OSS bucket.
Modify the backup settings of an RDS instance that uses local SSDs
Your RDS instance automatically performs backups based on the specified backup policy.
Modify the backup settings of an RDS instance that uses standard or enhanced SSDs
Your RDS instance automatically performs backups based on the specified backup policy.
Back up an RDS instance
In this example, your RDS instance runs MySQL 5.7 on RDS High-availability Edition with local SSDs.
FAQ
- When a backup is in progress, does the performance of my RDS instance decrease?
- If your RDS instance runs the High-availability or Enterprise Edition, it has a secondary RDS instance as a standby. All backups are performed on the secondary RDS instance. In this case, the performance of your RDS instance does not decrease during a backup.
- If your RDS instance runs the Basic Edition, it stands alone without a standby. All backups are performed on your RDS instance. In this case, the performance of your RDS instance decreases during a backup.
- How do I query data from backup files at fast speeds?
If you have full logical backup files, you can use Database Backup (DBS) to query data from these files. This way, you do not need to restore the data of these files. This accelerates queries. For more information, see Overview.
- Can I disable the data backup feature of my RDS instance?
No, you cannot disable the data backup feature of your RDS instance. However, you can reduce the backup frequency to at least twice a week. The data backup retention period must span at least seven days.
- Can I disable the log backup feature of my RDS instance?
Yes, you can disable the log backup feature of your RDS instance. This applies if you are not using the Basic Edition.
- Why did my backup task fail?
You may have executed DDL statement when the backup task was in progress. DDL statements trigger locks on tables. Your backup task may have failed as a result of the locks.
- My RDS instance has a small amount of data. However, the size of the generated snapshot
is large. Why?
When ApsaraDB RDS takes a snapshot of your RDS instance, it eliminates empty blocks. This allows the size of the snapshot to be smaller than the required disk space. Each block is 2 MB in size. However, if write operations are scattered, a large number of blocks are not full. For example, if 3 MB of data is written across two, three, or four blocks, none of these blocks is full. When ApsaraDB RDS calculates the size of the snapshot, it counts in all the non-empty blocks to which data is written. As a result, the disk space that is occupied by the snapshot is greater than the actual size of the snapshot.
- After I release my RDS instance, how do I restore data by using a retained backup
file?
Log on to the ApsaraDB RDS console and go to the Backup for Deleted Instances page. Then, download the required backup file and restore data to an on-premises database.
References
Related API operations
Operation | Description |
---|---|
Create backup set | Creates a backup for an ApsaraDB RDS instance. |
Query backup sets | Queries the backup files of an ApsaraDB RDS instance. |
Query backup settings | Queries the backup settings of an ApsaraDB RDS instance. |
Modify backup settings | Modifies the backup settings of an ApsaraDB RDS instance. |
Delete backup sets | Deletes the data backup files of an ApsaraDB RDS instance. |
Query backup tasks | Queries the backup tasks of an ApsaraDB RDS instance. |
Query log backup files | Queries the log backup files of an ApsaraDB RDS instance. |