Help Center/ Document Database Service/ User Guide/ Data Backups/ Configuring an Automated Backup Policy
Updated on 2023-03-15 GMT+08:00

Configuring an Automated Backup Policy

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.

The default automated backup policy is as follows:

  • Retention period: 7 days
  • Time window: The default time window is a random time window within 24 hours, for example, 01:00-02:00. The backup time is in UTC format.
  • Backup cycle: Each day of the week.

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.
  • 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.

    Physical backup

    Full backup

Pricing

  • 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.

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)

    • Retention Period refers to the number of days that data is kept. You can increase the retention period if needed.
    • The backup retention period is from 1 to 732 days.
    • 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.

    Time Zone

    The default backup time zone is the UTC time.

    Time Window

    The backup interval is one hour. You are advised to set the backup window to an off-peak period.

    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.

  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.