To ensure data security, ApsaraDB for MongoDB provides the high-frequency backup feature. You can configure high-frequency backup at an interval of several minutes or hours based on your business requirements. This topic describes how to configure high-frequency backup.
Prerequisites
A replica set or sharded cluster instance is used.
The instance runs MongoDB 4.4 or later.
The instance uses enhanced SSDs (ESSDs).
Billing
ApsaraDB for MongoDB provides a certain amount of free backup storage capacity. The backup storage capacity of an instance that uses ESSDs is calculated based on the following formula: 200% × instance storage capacity.
After the free quota is reached, the excess backup storage capacity is billed on a daily basis based on the unit price of backup storage. For more information, go to the Pricing tab of the ApsaraDB for MongoDB product page.
Enable the high-frequency backup feature
Log on to the ApsaraDB for MongoDB console.
In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances.
Click the ID of the instance or click Manage in the Actions column.
In the left-side navigation pane of the instance details page, click Backup and Recovery.
(Optional) On the Full Backup tab, click Upgrade to Cluster Backup Mode.
NoteTo enable the high-frequency backup feature for sharded cluster instances that are created before October 19, 2023, you must switch the instances to the cluster backup mode. For replica set instances and sharded cluster instances that are created after October 19, 2023, skip this step.
Click the Backup Settings tab and configure the parameters described in the following table.
Parameter
Description
Backup Method
Select High-frequency Backup.
Full Backup Retention Period (Days)
The retention period of full backups. Valid values: 7 to 730. Default value: 30. Unit: day.
Backup Within Seconds
By default, backup within seconds is enabled when the high-frequency backup feature is enabled.
NoteThis parameter is valid only for replica set instances that run MongoDB 4.4 or later.
Snapshot Backup Frequency
The interval at which snapshot backups are performed.
NoteThe backup interval can be set to a period of 15 minutes to 12 hours for replica set instances.
The backup interval can be set to a period of 30 minutes to 12 hours for sharded cluster instances.
NoteFor more information about how to configure other parameters on the Backup Settings page, see Configure automatic backup for an ApsaraDB for MongoDB instance.
Backup retention policies
High-frequency backup uses the snapshot backup method. Snapshot retention policies vary based on snapshot backup frequency.
Snapshot backup frequency | Snapshot retention policy | Example |
Minutes | After the high-frequency backup feature is enabled, instance snapshots are retained based on the following policies:
| If you set the snapshot backup frequency to 30 minutes, the following snapshot retention policies apply:
As such, a maximum of 54 snapshots are retained within 30 days. The retained snapshots include 2 snapshots that are generated within the last 1 hour, 23 snapshots that are generated more than 1 hour ago but within the last 24 hours, and 29 snapshots that are generated more than 24 hours ago. |
Hours | After the high-frequency backup feature is enabled, instance snapshots are retained based on the following policies:
| If you set the snapshot backup frequency to 6 hours, the following snapshot retention rules apply:
As such, a maximum of 33 snapshots are retained within 30 days. The retained snapshots include 4 snapshots that are generated within the last 24 hours and 29 snapshots that are generated more than 24 hours ago but within the last week. |
Related API operations
Operation | Description |
Queries the backup policy of an ApsaraDB for MongoDB instance. | |
Modifies the backup policy of an ApsaraDB for MongoDB instance. |