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.2 or later.
The instance uses Enterprise SSDs (ESSDs).
Billing rules
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 high-frequency backup
Go to the Replica Set Instances or Sharded Cluster Instances page. In the top navigation bar, select the region in which an instance resides. Then, find the instance and click the ID of the instance.
In the left-side navigation pane of the instance details page, click Backup and Restoration.
(Optional) On the Full Backup tab, click Upgrade to Cluster Backup Mode.
NoteTo enable high-frequency backup 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.
On the Backup Settings tab, click Edit to go to the backup configuration panel. Then, configure the parameters described in the following table.
Parameter
Description
Backup Mode
The backup mode of the instance. Select High-frequency Backup.
Retention Period for High-frequency Backups (Days)
The retention period of high-frequency backups. Valid values: 1 to 7. Unit: day.
Hourly Sparse Backup
Specifies whether to enable hourly sparse backup. Once enabled, a snapshot is generated within minutes. Valid values:
Enable: If the backup frequency is at the minute level, snapshots generated within the last 1 hour are retained. For snapshots generated more than 1 hour ago but within a specified high-frequency backup retention period, only the first snapshot generated after 00:00 00 each day is retained.
Disable: Snapshots generated within a specified high-frequency backup retention period are retained.
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, the single-digit second backup feature is enabled when high-frequency backup is enabled.
NoteThis parameter is valid only for replica set instances that use cloud disks.
Snapshot Backup Frequency
The interval at which a snapshot backup is 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 instance.
Backup retention policies
High-frequency backup uses the snapshot backup method. The following table describes sample backup retention policies.
Snapshot backup frequency | Hourly sparse backup | Snapshot retention policy | Example |
Minutes | Enabled |
| If you set the snapshot backup frequency to 30 minutes, the high-frequency backup retention period to 2 days (48 hours), and the full backup retention period to 30 days, the following snapshot retention policies apply:
As such, a maximum of 77 snapshots are retained within 30 days. |
Disabled |
| If you set the snapshot backup frequency to 30 minutes, the high-frequency backup retention period to 2 days (48 hours), and the full backup retention period to 30 days, the following snapshot retention policies apply:
As such, a maximum of 124 snapshots are retained within 30 days. | |
Hours | N/A |
| If you set the snapshot backup frequency to 6 hours, the high-frequency backup retention to 2 days (48 hours), and the full backup retention period to 30 days, the following snapshot retention policies apply:
As such, a maximum of 36 snapshots are retained within 30 days. |
FAQ
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. |