Help Center> Document Database Service> User Guide> Data Backups> Configuring an Automated Backup Policy
Updated on 2023-12-13 GMT+08:00

Configuring an Automated Backup Policy

Scenario

DDS backs up data automatically based on the automated backup policy you set. You are advised to regularly back up data in your database. If the database becomes faulty or data is damaged, you can restore it with the backup.

The automated backup policy for DDS is enabled by default. After an instance is created, you can modify or disable the automated backup policy as required.

Once the automated backup policy is enabled, a full backup is triggered immediately. After that, full backups will be created based on the backup window and backup cycle you specify. When an instance is being backed up, data is copied and then compressed and uploaded to OBS. The length of time the backup data is kept for depends on the backup retention period you configure. The backup duration depends on the amount of data, and the average backup speed is 60 MB/s. After the automated backup policy is enabled, an incremental backup is automatically performed every 5 minutes for replica set instances to ensure data reliability. If the incremental backup function is required for cluster instances, you need to manually enable it.

Automated Backup Description

  • Backup type
    • Full backup: All data is backed up even if no data is updated since the last backup.
    • Incremental backup: Incremental backup is used to back up the data newly added or modified since the last full or incremental backup. DDS automatically backs up the updated data every 5-60 minutes since the last automated or incremental backup was made.
  • Backup mode
    • Physical: Data is copied from physical disks.
    • Snapshot: The data status at a particular point in time is retained. Compared with physical backup, snapshot backup is faster. After snapshot backup is enabled, CBR will be charged separately.
    • Logical: A tool is used to read data and logically export the data.
  • Table 1 lists the automated backup methods supported by DDS.
    Table 1 Backup methods

    Instance Type

    Backup Mode

    Backup Type

    Cluster

    Physical backup

    • Full backup
    • Incremental backup

    Replica set

    Physical backup

    • Full backup
    • Incremental backup

    Single node

    NOTE:

    Single node instances apply to only a few scenarios. You are advised to use a single node instance only for learning.

    Logical backup/Snapshot backup

    NOTE:

    For details about how to set Backup Method to Snapshot, see Setting Backup Method for a Single Node Instance.

    Full backup

Pricing

  • After you purchase an instance, DDS will provide additional backup storage of the same size as you purchased. For example, if you purchase 100 GB of instance storage space, you will obtain 100 GB of backup storage space. If the size of backup data does not exceed 100 GB, the backup data is stored on OBS free of charge. If the size of the backup data exceeds 100 GB, you will be charged based on the OBS billing rules.
  • You can check your expenditure records for DDS backup fees by going to Billing Center > Bills.

Precautions

  • The backup process does not affect services.
  • DDS checks existing automated backup files. If the retention period of a file exceeds the backup retention period you set, DDS will delete the file.
  • After the backup policy is modified, an automated backup will be triggered based on the new backup policy. The retention period of the previously generated automated backups remains unchanged.
  • Single node instances do not support incremental backup.
  • By default, the name of an automated backup ends with the UTC time. To change the display time in the automated backup name to the local time, contact Huawei O&M personnel.

Enabling or Modifying an Automated Backup Policy

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Document Database Service.
  4. On the Instances page, click the instance name.
  5. In the navigation pane on the left, choose Backups & Restorations.
  6. On the Backups & Restorations page, click Set Backup Policy. If you want to enable the automated backup policy, click . Once enabled, the backup policy can be modified as shown in Figure 1.

    Figure 1 Set Backup Policy
    Table 2 Parameter description

    Parameter

    Description

    Retention Period (days)

    Number of days that your automated backups can be retained. The retention period is from 1 to 732 days and the default value is 7.

    • Extending the retention period improves data reliability. You can configure the retention period if needed.
    • If you shorten the retention period, the new backup policy takes effect for existing backups. Any automated backups (including full and incremental backups) that have expired will be automatically deleted. Manual backups will not be automatically deleted but you can delete them manually.

    Time Zone

    The default backup time zone is the UTC time.

    Time Window

    A one-hour period the backup will be scheduled within 24 hours, such as 01:00-02:00. The backup time is in UTC format.

    Backup Cycle

    • If you set the retention period to 1 to 6 days, data is automatically backed up each day of the week and the backup cycle cannot be changed.
    • If you set the retention period to 7 to 732 days, you must select at least one day of the week for the backup cycle.

    Backup Method

    • Physical: Data is copied from physical disks.
    • Snapshot: The data status at a particular point in time is retained. Compared with physical backup, snapshot backup is faster.
    • Logical: A tool is used to read data and logically export the data.

    Policy for automatically deleting full backups:

    To ensure data integrity, even after the retention period expires, the most recent backup will be retained.

    If Backup Cycle was set to Monday and Tuesday and the Retention Period was set to 2:

    • The full backup generated on Monday will be automatically deleted on Thursday. The reasons are as follows:

      The backup generated on Monday expires on Wednesday, but it is the last backup, so it will be retained until a new backup expires. The next backup will be generated on Tuesday and will expire on Thursday. So the full backup generated on Monday will not be automatically deleted until Thursday.

    • The full backup generated on Tuesday will be automatically deleted on the following Wednesday. The reasons are as follows:

      The backup generated on Tuesday will expire on Thursday, but as it is the last backup, so it will be retained until a new backup expires. The next backup will be generated on the following Monday and will expire on the following Wednesday. So the full backup generated on Tuesday will not be automatically deleted until the following Wednesday.

  7. Click OK to save the changes.
  8. View the results.

    • During the creation of an automated backup, you can query the backup status on the Backups page or the Backups & Restorations tab. The backup status is Backing up.
    • In the upper right corner of the backup list, click to refresh the list. The backup status changes to Complete. The backup type is Automated and the backup method is Physical.

Disabling an Automated Backup Policy

When disabling the automated backup policy:

  • Your data cannot be backed up.
  • Your replica set instances cannot be restored to a specified point in time.
  • If you choose to delete all the existing automated backup when disabling the automated backup policy, related restoration or download operations will fail.
  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Document Database Service.
  4. On the Instances page, click the instance name.
  5. In the navigation pane on the left, choose Backups & Restorations.
  6. On the Backups & Restorations page, click Set Backup Policy. On the displayed page, click to disable the automated backup policy. Figure 2 shows the dialog box for modifying the backup policy.

    Figure 2 Set Backup Policy

    You can determine whether to delete all automated backup files:

    • If you do not select Delete automated backups, all backup files within the retention period will be retained, but you can still delete them manually. For details, see section Deleting an Automated Backup.
    • If you select Delete automated backups, all backup files within the retention period will be deleted.

    If you shorten the retention period, the new backup policy takes effect for all backup files. Any backup files that have expired, based on a newly configured retention period, will be deleted, but the latest expired backup file will be retained.

  7. Click OK.

    • If automated backups are disabled, any automated backups in progress stop immediately.
    • After automated backups are disabled, incremental backups are disabled by default.
    • If you need to enable the automated backup policy again, see Enabling or Modifying an Automated Backup Policy.