ApsaraDB for MongoDB supports advanced backup (sparse backup) in addition to standard backup. You can configure more flexible backup schedules and retention periods to retain only necessary backup sets, reducing backup storage costs while ensuring recoverability at critical time points.
Feature overview
In standard backup mode, backup sets are generated at fixed intervals and retained for a uniform period. Over time, the number of backup sets grows, resulting in high storage costs. Advanced backup allows you to combine weekly, monthly, yearly, and fixed-interval policies, and set independent retention periods for each policy. This achieves a sparse retention pattern where recent backups are retained densely and older backups are retained sparsely.
Differences between standard backup and advanced backup
Item | Standard backup | Advanced backup (sparse backup) |
Backup schedule | Fixed weekly backup | Flexible combination of weekly, monthly, yearly, and fixed-interval (high-frequency) schedules |
Retention policy | Uniform retention period | Independent retention period for each policy, with support for long-term retention |
Storage cost | More backup sets, higher cost | On-demand sparse retention, lower cost |
Prerequisites
The instance is a cloud disk-based replica set or sharded cluster instance.
Local disk instances and standalone instances are not supported.
Limits
Irreversible activation: After you enable advanced backup, you can no longer use the
ModifyBackupPolicyandDescribeBackupPolicyoperations for standard backup, and you cannot switch back to standard backup.Default weekly backup cannot be deleted: If no high-frequency backup is configured, at least one weekly backup policy must be retained, with a minimum frequency of twice per week.
Retention period range:
Standard backup: 7 to 7,300 days.
High-frequency backup: 1 to 7,300 days.
Cross-region backup: 3 to 1,825 days.
Policy merging: If multiple policies apply to the same day, the system generates only one backup set and retains it based on the longest retention period among the matching policies.
Example 1: A weekly backup policy with a 30-day retention and a high-frequency backup policy with a 1-day retention both apply to the same backup set. The backup set is retained for 30 days.
Example 2: A weekly policy retains backups for Monday, Tuesday, and Wednesday for 8 days, and another weekly policy retains backups for Wednesday and Thursday for 9 days. Backups generated on Monday and Tuesday are retained for 8 days, and backups generated on Wednesday and Thursday are retained for 9 days.
High-frequency backup uniqueness: Only one high-frequency backup policy can be configured.
Cross-region backup uniqueness: Only one cross-region backup policy is allowed, and it supports only weekly scheduling.
Second-level backup requirement: If a policy includes high-frequency backup, the backup type must be second-level backup.
Log backup: For sharded cluster instances, log backup must be enabled. If cross-region backup exists, cross-region log backup must also be enabled, and same-region log backup must be enabled first.
Encrypted cloud disk instances: To enable remote backup, make sure that the service key exists in the destination region.
Billing
Backup storage within the free quota is not charged.
Usage beyond the free quota is billed based on backup storage consumption. For pricing details, see Billable items.
Procedure
Step 1: Enable advanced backup
Log on to the ApsaraDB for MongoDB console and go to the target instance.
In the left-side navigation pane, choose Backup and Restoration > Backup Settings.
Click Switch Advanced Backup Settings and confirm the activation.
This operation is irreversible. Proceed with caution. You can also call the ModifyAdvancedBackupStatus operation to enable advanced backup and the DescribeAdvancedBackupStatus operation to query the activation status.
Step 2: Configure advanced backup policies
On the Advanced Backup Settings page, click the node-to-node chain button to add or modify policies with the following parameters:
Parameter | Description |
Backup Schedule | Supports weekly, monthly, yearly, and fixed-interval (high-frequency backup, such as every 30, 60, or 120 minutes) schedules. |
Retention Period | You can specify a fixed number of days or long-term retention. |
Hourly Sparse | Applicable only to high-frequency backups. When enabled, all snapshots within the last hour are retained. For snapshots from 1 to 24 hours ago, only the first snapshot after each hour mark is retained. |
Snapshot backup start time | For non-high-frequency backups, specify a backup time window in the |
Configuration examples
Scenario | Schedule | Retention |
Daily backup |
| 7 days |
Weekly backup on Monday |
| 30 days |
First and last days of each month |
| 365 days |
January 1 every year |
| Long-term retention |
What to do next
View backup policies: On the Advanced Backup Settings page, move the pointer over the circled numbers to view the configured backup policies. The circled numbers indicate the number of configured policies. The backup policy details panel includes the backup schedule, retention period, backup start time, log backup switch, and log backup retention days.
Delete a backup policy: On the Level-1 Backup page, click the delete button to remove an added backup policy.
NoteTo ensure data security, if high-frequency backup is not enabled, at least one weekly backup policy must be configured with a minimum frequency of 2 days per week. This policy cannot be deleted.
Related API operations
Operation | Description |
Enable advanced backup | |
Query whether advanced backup is enabled | |
Modify advanced backup policies | |
Query advanced backup policies |