More and more users choose to use Redis for persistent storage. Consequently, users raise higher requirements for data reliability. The data backup and restore solution provided by ApsaraDB for Redis has significantly improves data reliability.

Automatic backup by using backup policies

Background

An increasing number of applications use Redis for persistent storage. In this case, an automatic backup mechanism is required to back up data on a regular basis so that you can quickly restore data in the event of user errors. ApsaraDB for Redis uses RDB snapshots to back up data on replica nodes. The backup process has no negative impacts on the performance of your instance. You can customize a backup policy in the console.

Procedure

  1. Log on to the ApsaraDB for Redis console.
  2. On the top of the page, select the region where the instance is deployed.
  3. On the Instances page, click the instance ID or Manage in the Actions column for the instance that you want to manage.
  4. In the left-side navigation pane, click Backup and Recovery.
  5. Click the Backup Settings tab.
  6. Click Edit to customize the automatic backup cycle and backup time.
    Notice By default, backup data is retained for seven days. You cannot modify this configuration.
  7. Click OK.

Manual backup (instant backup)

In addition to automatic backup, you can also manually back up data at any time in the console.

  1. Log on to the ApsaraDB for Redis console.
  2. On the top of the page, select the region where the instance is deployed.
  3. On the Instances page, click the instance ID or Manage in the Actions column for the instance that you want to manage.
  4. In the left-side navigation pane, click Backup and Recovery.
  5. Click Create Backup in the upper-right corner.
  6. In the dialog box that appears, click OK to back up data for the instance.
    Notice On the Data Backup tab, you can select a time range to query historical backup data. By default, backup data is retained for seven days. You can query the historical backup data within the last seven days.

Backup archiving

Background

Due to industry regulations or corporate policy requirements, you may need to archive backup data for Redis periodically. ApsaraDB for Redis provides a backup archiving feature, which is free of charge. You can use this feature to store automatically and manually created backup files in Object Storage Service (OSS). You can store backup files in Alibaba Cloud OSS free of charge for up to seven days. After seven days, the backup files are automatically deleted.

To retain backup files for a longer time period, you can copy their URLs of the backup files from the console and download the backup files to a local host.

Procedure

  1. Log on to the ApsaraDB for Redis console.
  2. On the top of the page, select the region where the instance is deployed.
  3. On the Instances page, click the instance ID or Manage in the Actions column for the instance that you want to manage.
  4. In the left-side navigation pane, click Backup and Recovery.
  5. On the Data Backup tab, select the backup dataset to be archived and click Download Backups in the Actions column.

Data restore

ApsaraDB for Redis provides the data restore feature to minimize the possible loss caused by user errors. You can restore data from backup files in the console or use redis-shake on an Elastic Compute Service (ECS) instance to restore data from local backup files.

Restore data in the console
Notice You cannot restore data for cluster instances in the console. To restore data for cluster instances, use redis-shake.
  1. Log on to the ApsaraDB for Redis console.
  2. On the top of the page, select the region where the instance is deployed.
  3. On the Instances page, click the instance ID or Manage in the Actions column for the instance that you want to manage.
  4. In the left-side navigation pane, click Backup and Recovery.
  5. On the Backup and Recovery page, click the Data Backup tab.
  6. Select the time range of the data to be restored and click Search. Select the backup dataset that you want to restore and click Restore Data.
  7. In the Data Recovery dialog box, click OK to restore data to the instance. You can click Clone Instance to create an instance and restore the backup data to the created instance. Make sure that only the expected data is to be restored before you confirm the operation.
    Notice Proceed with caution when you restore data. We recommend that you clone an instance to restore data if time permits. This solution allows you to create a pay-as-you-go instance and restore data from a backup dataset to the created instance. Make sure that only the expected data is to be restored before you confirm the operation.

Restore data on an ECS instance

You can use redis-shake on an ECS instance to restore data from local backup files to an ApsaraDB for Redis instance. For more information, see Use the redis-shake tool to back up data.

Clone an instance

O&M administrators may need to deploy an application during their daily maintenance work. It is simple for O&M administrators to deploy an application in an ECS instance that is created based on an image file. Deploying a database is complex. O&M administrators must purchase or install a database, and then initialize relevant database scripts, for example, to create tables, triggers, and views. In this scenario, they must perform many trivial operations, which are more likely to involve user errors. In the gaming industry that requires efficient service deployment, administrators have to quickly deploy an application multiple times each day.

To resolve this issue, ApsaraDB for Redis develops an instance cloning feature. This feature enables you to create a subscription or pay-as-you-go instance based on backup files. You can develop and deploy a database on the web interface, which improves productivity. For more information, see Clone an instance.

Related API operations