Database Backup (DBS) provides the emergency disaster recovery feature to automatically obtain backup sets and generate snapshots. You can use a snapshot that is generated to create a DBS sandbox instance in a quick manner.

Background information

DBS provides a sandbox solution for MySQL databases based on copy data management (CDM). You can use the sandbox feature of DBS to create a sandbox instance to restore data within a short period of time. Read and write operations that are performed in sandbox instances do not affect the source databases. You can perform various operations in sandbox instances, such as data restoration, restoration drills, development and testing, query analysis, and emergency disaster recovery. For more information, see Overview.

Pricing

  • ApsaraDB RDS generates physical backups for your ApsaraDB RDS instances and charges you for backups. For more information, see Backup storage pricing of an ApsaraDB RDS for MySQL instance.
  • After you enable the sandbox feature, DBS automatically synchronizes the data that are backed up to the sandbox storage and generates snapshots for the data. The snapshots are stored in the sandbox storage and can be used to create sandbox instances. DBS charges you for data storage based on the volume of the data that is stored in the sandbox storage. For more information, see Sandbox storage fees.
  • After you create a sandbox instance, DBS charges you for sandbox instance resources based on the specifications and duration of the sandbox instance. If you do not create sandbox instances, you are not charged for sandbox instance resources. For more information, see Sandbox instance fees.

Prerequisites

  • An ApsaraDB RDS for MySQL instance that uses local SSDs is created, and at least one physical backup is created in ApsaraDB RDS. For more information, see Enable the automatic backup feature for an ApsaraDB RDS for MySQL instance.
  • The ApsaraDB RDS for MySQL instance is deployed in China (Hangzhou), China (Shanghai), China (Shenzhen), China (Heyuan), China (Chengdu), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Hong Kong), Singapore (Singapore), Australia (Sydney), Malaysia (Kuala Lumpur), Indonesia (Jakarta), Japan (Tokyo), India (Mumbai), Germany (Frankfurt), US (Silicon Valley), US (Virginia), or China East 1 Finance.
  • Transparent data encryption (TDE) is disabled for the ApsaraDB RDS for MySQL instance. For more information about TDE, see Configure TDE for an ApsaraDB RDS for MySQL instance.

Enable the sandbox feature

After you enable the sandbox feature, DBS synchronizes data backups to the sandbox storage. Then, you can create a sandbox instance for emergency disaster recovery.

  1. Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
  2. In the left-side navigation pane, click Backup and Restoration.
  3. On the Backup and Restoration page, click the Crash Recovery tab.
    Crash Recovery
  4. Click Enable DBS Sandbox.
  5. In the Set Sandbox Policy dialog box, configure the following parameters:
    • Sandbox Feature: By default, the sandbox feature is enabled.
    • Storage Type: the storage type of the sandbox. You are charged only for capacity-type sandboxes. For more information, see DBS sandbox fees.
      Note
      • If you have high requirements for storage stability and performance of sandbox instances, we recommend that you use performance-type sandboxes.
      • If you want to use performance-type sandboxes, disable capacity-type sandboxes and then enable performance-type sandboxes.
    • Sandbox Data Retention Period: the number of days for which DBS retains backup data that can be used to create sandbox instances in the sandbox storage. Default value: 7. By default, DBS copies data that is stored in the previous seven days into the sandbox storage. You can create a sandbox instance to restore data to a point in time within the previous seven days.
  6. Click OK.
    The sandbox feature is enabled. The first time the sandbox feature is enabled, DBS stores the most recent full backup set of the ApsaraDB RDS for MySQL instance in the sandbox storage and generates snapshots that can be used to create sandbox instances. The system requires 5 to 20 minutes to complete the process. The length of the period of time is determined by the size of the backup data.

    After the available time range is displayed next to the Available Time Range to Recover parameter, you can create a sandbox instance.

Create a sandbox instance

  1. Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
  2. In the left-side navigation pane, click Backup and Restoration.
  3. On the Backup and Restoration page, click the Crash Recovery tab.
    Crash Recovery
  4. Click Recover Sandbox Instance.
  5. In the Recover Sandbox Instance dialog box, configure the parameters to create a sandbox instance.
    Configure a sandbox instance
    Section Parameter Description
    Sandbox Instance Point in Time Sandbox Data Time Range The time range in which you can restore the source database. The available time range is from the point in time at which the first snapshot was created in the sandbox storage to the current point in time. The actual available time range may be shorter. You can store data to a point in time that is in the time range from the point in time at which the first snapshot was created to the end time of the most recent binary log. You may fail to restore data to a point in time that is in the time range from the end time of the most recent binary log to the current point in time. To view the end time of the most recent binary log, you can choose Backup and Restoration > Log Backup on the instance details page.
    Recovery Method The method that is used to restore data. Valid values:
    • Recovery by Snapshot Point in Time: You can select only the point in time at which a snapshot was created. If you use this restoration method, the system requires less time to complete the restoration. We recommend that you use this method.
    • Recovery by Custom Point in Time: You can specify a point in time within the backup set retention period. If you use this method, the amount of time that is required to complete the restoration varies based on the size of the data.
    Sandbox Instance Configurations Specifications The specification of the sandbox instance that you want to create. The following specifications are supported:
    • 1 core and 1 GB memory
    • 1 core and 2 GB memory
    • 2 cores and 4 GB memory
    • 2 cores and 8 GB memory
    • 4 cores and 8 GB memory
    • 4 cores and 16 GB memory
    • 8 cores and 16 GB memory
    • 8 cores and 32 GB memory

    The restoration rate is not determined by the specifications of sandbox instances. Sandbox instances with higher specifications provide better performance. For more information, see Sandbox instance fees.

    Region The region where you want to deploy the sandbox instance.
    Peer VPC The virtual private cloud (VPC) in which you want to deploy the sandbox instance.

    If you want to connect to the sandbox instance by using your Elastic Compute Service (ECS) instances, you must set this parameter to the VPC in which the ECS instances reside. For information about how to create a VPC, see Default VPCs and default vSwitches.

    Peer vSwitch The vSwitch to which you want to connect the sandbox instance. The sandbox instance can be accessed from IP addresses in the CIDR block that is specified for the vSwitch.
    Database Account Type The following options are supported:
    • Use Original Database Account: The account of the source database is used as the account of the sandbox instance.
    • Create Privileged Account: You create a privileged account for the sandbox instance. The privileged account has permissions on all databases in the sandbox instance. You must specify a new database account and a password. The account of the source database is retained in the sandbox instance.
      Note A privileged account is created only in the current sandbox instance.

      If the username of the account of the source database is the same as the username of the privileged account, the account of the source database is overwritten by the privileged account in the sandbox instance.

  6. Click OK.
    DBS checks the configuration of the sandbox instance. If no issues found, DBS creates the sandbox instance. When the status of the sandbox instance changes to Running, you can connect to the sandbox instance.

    The database account, password, and other configurations of the sandbox instance are consistent with those of the source database. If you specify Create Privileged Account as the value of the Database Account Type parameter in Step 5, you can also use the privileged account that is created to connect to the sandbox instance.

    View the sandbox instance

What to do next

You can obtain the endpoint of the sandbox instance in the ApsaraDB RDS console and connect a client to the sandbox instance by using the endpoint of the sandbox instance. You can also use Data Management (DMS) or an ECS instance to connect to the sandbox instance. For more information, see Use DMS to access sandbox instances or Use ECS to access sandbox instances.

Note A client, such as a client that is deployed on an ECS instance, that you use to connect to the sandbox instance must be deployed in the same VPC as the sandbox instance.