All Products
Search
Document Center

Backup and recovery

Last Updated: Aug 14, 2020

Overview

Distributed Relational Database Service (DRDS) supports instance- and database-level backup and restoration. DRDS instances support fast backup and consistent backup in automatic and manual modes. Instance-level restoration refers to restoring data to new DRDS and ApsaraDB for RDS (RDS) instances based on existing data backup sets.

Backup methods

DRDS provides fast backup and consistent backup. These methods help you restore data based on your business scenarios. The following table compares the two backup methods.


Fast backup

Consistent backup

Scenarios

Applicable to backup and restoration for routine business.

Applicable to backup and restoration for the financial industry and core online transactions that require high data consistency.

Advantages

  1. Provides fast backup and restoration.
  2. Supports restoration based on backup sets and restoration to a specified time point.
  3. Supports all instance versions.
  1. Ensures global data consistency in sharding scenarios.

Disadvantages

  1. Ensures data consistency only within a single RDS instance in sharding scenarios, but does not ensure global data consistency.
  1. Features slow backup and restoration.
  2. Supports only restoration based on backup sets, but does not support restoration to a specified time point.
  3. Supports only 5.3.8 and later versions.
  4. Locks distributed transactions on DRDS instances for seconds during backup. During the locking process, the response time (RT) for executing SQL statements includes sub-second jitters. We recommend that you perform consistent backup during off-peak hours.


Limits and notes

  • The automatic backup policy of DRDS is disabled by default. You must enable it manually. For more information about how to enable it, see Set an automatic backup policy.
  • The log backup feature of DRDS depends on underlying RDS instances. The log backup policy configured in the DRDS console is automatically synchronized to all the underlying RDS instances. Do not modify the configured policy in the RDS console so that the backup sets keep effective.
  • The backup and restoration feature of DRDS depends on log backup. We recommend that you enable the log backup policy by default so that the backup sets keep effective.
  • Do not perform Data Definition Language (DDL) operations during backup, which may lead to instance-level backup and restoration failure.
  • Make sure the RDS instances mounted to a DRDS instance are normal during backup so that the backup can succeed.
  • Consistent backup and restoration are only supported on instances of 5.3.8 and later versions.
  • Make sure all tables have primary keys to keep data accuracy during consistent backup and restoration.
  • During consistent backup, distributed transactions on DRDS instances are locked for seconds. During the locking period, the execution of non-transactional SQL statements and single-instance transactions is not affected, and the commitment of distributed transactions is blocked. The RT for executing SQL statements may include millisecond-level jitters. We recommend that you perform consistent backup during off-peak hours.
  • Affected by the changes to the DRDS and RDS inventory, DRDS automatically adjusts the instance type and zone during instance-level restoration. You can confirm and change the instance type and zone after the restoration is completed to avoid affecting your business.
  • Instance-level restoration is billed based on the actual billing method and instance type. For more information about the billing method, see DRDS specifications and pricing and ApsaraDB for RDS specifications and pricing.

Procedure

Set an automatic backup policy

  1. Log on to the DRDS console and select a region.
  2. Click Instances in the left-side navigation pane and click an instance name on the page that appears.
  3. In the left-side navigation pane, choose Data Recovery > Backup and Recovery.
  4. Click the Backup Policy Tab to view the current automatic backup policy. The backup policy of DRDS is disabled by default. If this is the first time you access this page, the backup policy takes effect after you set it, as shown in the following figure.
    1
  5. Click Edit to set the automatic backup policy, as shown in the preceding figure. If you select Database for Backup Level, you must select a database to be backed up.
    2
  6. Set the parameters for the automatic backup policy, and then click OK.

Note: A DRDS instance does not support log backup, and the configured log backup policy will be applied to all underlying RDS instances.

Configure local logs

  1. Log on to the DRDS console and select a region.
  2. Click Instances in the left-side navigation pane and click an instance name on the page that appears.
  3. In the left-side navigation pane, choose Data Recovery > Backup and Recovery.
  4. Click the Local Log Settings tab.
    3
  5. Click Edit. In the Local Binlog Settings dialog box, modify the local log settings.
    4
  6. After you complete the setting, click OK.

    Note: The local log settings will be applied to all underlying RDS instances.

Proactive backup

  1. Log on to the DRDS console and select a region.

  2. Click Instances in the left-side navigation pane and click an instance name on the page that appears.

  3. In the left-side navigation pane, choose Data Recovery > Backup and Recovery.

  4. Click Data Backup, as shown in the following figure.
    5

  5. Set Backup Method and Backup Level. You can select Consistent Backup or Fast Backup for Backup Method. For more information about the differences between the two backup methods, see Backup methods.
    6

  6. Click OK to submit the backup task.

  7. Click the Data Backup Set tab to view the available backup sets, as shown in the following figure. You can view the data backup progress in the Task Progress list in the upper-right corner of the page.
    7

Restore data

  1. Log on to the DRDS console and select a region.
  2. Click Instances in the left-side navigation pane and click an instance name on the page that appears.
  3. In the left-side navigation pane, choose Data Recovery > Backup and Recovery.
  4. In the upper right corner, click Data Recovery(Original Clone Instance).
    1
  5. In the dialog box that pops up, select the recovery method and configure other recovery parameters.

    • If you want to restore data by backup set, choose the method as By Backup Set and select a valid backup set in the backup set list.
    • if you want to restore data to a specified time point, choose the method as By Time and select a specified time and recovery level.
  6. Click Precheck to check whether a valid backup set is available for data restoration. If the precheck fails, the data cannot be restored.
    1

  7. When the precheck success, in the Verification for Recovery page, click Enable
    1
  8. After you confirm the order and terms of DRDS and RDS, click Enable to start data restoration.
    2
  9. You can view the restoration progress in the Task Progress list in the upper-right corner of the page. After the data is restored, you can view the restored instance on the DRDS Instance Management page.