To ensure data security, ApsaraDB for MongoDB provides the high-frequency backup feature, allowing you to create backups at minute or hour intervals. This topic describes how to configure this feature.
Prerequisites
-
The instance is a replica set or a sharded cluster.
-
The instance runs MongoDB 4.2 or later.
-
The instance uses ESSDs.
Billing
ApsaraDB for MongoDB provides a free backup storage quota. For an instance that uses ESSDs, the free quota is 200% of the instance's storage capacity.
If you exceed the free quota, the excess storage is billed daily based on its unit price. For more information, see the ApsaraDB for MongoDB pricing page.
Enable high-frequency backup
-
Go to the Replica Set Instances or Sharded Cluster Instances page. In the top navigation bar, select a resource group and region, and then click the ID of the target instance.
-
In the left-side navigation pane, click Backup and Restoration.
-
(Optional) On the Full Backup tab, click Upgrade to Cluster Backup Mode on the right.
NoteFor sharded cluster instances that run MongoDB 4.4 and were created before October 19, 2023, you must switch to cluster backup mode to enable high-frequency backup. You can skip this step for replica set instances and for sharded cluster instances created on or after October 19, 2023.
-
Click the Backup Settings tab.
-
On the Backup Settings tab, click Edit and configure the following parameters.
Parameter
Description
Backup Method
Select High-frequency Backup.
Retention Period for High-frequency Backups (Days)
The number of days to retain high-frequency backups. Valid values: 1 to 7.
Hour Sparse Backup
Specifies whether to enable hourly sparse backup when the snapshot backup frequency is set to minutes:
-
Enable: When the backup frequency is set to minutes, all snapshots from the last hour are retained. For snapshots older than one hour but within the Retention Period for High-frequency Backups (Days), only the first snapshot of each hour is retained.
-
Disable: All snapshots within the Retention Period for High-frequency Backups (Days) are retained.
Full Backup Retention Period (Days)
The number of days to retain full backup data. Valid values: 7 to 730. The default value is 30.
Backup Within Seconds
The second-level backup feature is enabled by default when you enable high-frequency backup.
NoteThis parameter is available only for replica set instances that use ESSDs.
Snapshot Backup Frequency
The frequency of backups.
Note-
For replica set instances, the backup frequency can be set to intervals from 15 minutes to 12 hours.
-
For sharded cluster instances, the backup frequency can be set to intervals from 30 minutes to 12 hours.
NoteFor information about other parameters on the Backup Settings page, see Configure automatic backup for an instance.
-
Backup retention policy
The Backup Method used for high-frequency backup is Snapshot Backup. The backup retention policy and examples are as follows.
|
Snapshot frequency |
Hourly sparse backup |
Retention policy |
Example |
|
Minute-level frequency |
Enabled |
|
Assume the snapshot frequency is 30 minutes, the high-frequency backup retention period is 2 days, and the full backup retention period is 30 days:
In total, a maximum of 77 snapshots are stored within 30 days (2 snapshots from the last hour + 47 snapshots from the rest of the 2-day period + 28 snapshots from the remaining days). |
|
Disabled |
|
Assume the snapshot frequency is 30 minutes, the high-frequency backup retention period is 2 days, and the full backup retention period is 30 days:
In total, a maximum of 124 snapshots are stored within 30 days (96 snapshots from the last 2 days + 28 snapshots from the remaining days). |
|
|
Hour-level frequency |
Not applicable |
|
Assume the snapshot frequency is every 6 hours, the high-frequency backup retention period is 2 days, and the full backup retention period is 30 days:
In total, if the snapshot frequency is set to every 6 hours, a maximum of 36 snapshots are stored within 30 days (8 snapshots from the last 2 days + 28 snapshots from the remaining days). |
FAQ
API reference
|
API |
Description |
|
Queries the backup policy of an ApsaraDB for MongoDB instance. |
|
|
Modifies the backup policy of an ApsaraDB for MongoDB instance. |