Lesson 3: Back Up an Atlas Dedicated Tier / Learn

Video Transcript (English)

Welcome! In this video, you’ll learn how to back up a dedicated M10 or higher cluster by using Cloud Backup.

We will also cover the Cloud Backup features exclusive to this cluster tier and above, including Continuous Cloud Backups and on-demand snapshots.

With MongoDB Atlas Cloud Backups, snapshots of your cluster are created automatically. You can use default settings, or configure your own backup and retention policies, which means that snapshots will be automatically taken and stored according to your preferred schedule.

Atlas Cloud Backups provide localized backup storage by using the native snapshot functionality of the cluster’s cloud service provider—AWS, Azure, or Google Cloud.

Fully automated backups in Atlas remove the complexity of scripting backups or doing them manually. They also guarantee consistency, which is especially important for sharded clusters.

When you specify a backup policy, you are setting a time to take a snapshot of your data. That snapshot is your data as it is exactly at that moment.

You can enable cloud backup during the cluster creation or during the modification of an existing cluster.

The cloud backup feature is available only on dedicated clusters.

Let’s start by looking at the initial state for an M10 cluster that we just created. The first thing we notice is that backups are active.

Next, we’ll check the cluster settings by navigating to Configuration and then to Additional Settings. Both Cloud Backup and Continuous Cloud Backup are turned on, which we’ll leave as is.

Next, let’s view the backup configuration for this cluster by navigating to the Backups tab. Because our cluster is new, there are no snapshots yet. We’ll go to the policy tab where we can review and update the rules that control our snapshots.

Let’s go through this process step by step. The main thing we do here is decide the frequency and retention of snapshots.

Frequency means how often snapshots are taken, and retention refers to how long the snapshots are stored.

Let’s look at frequency first. By default, snapshots are scheduled to be taken every 6 hours.

You may choose to take snapshots less frequently due to the associated cost. Or, you might want to increase the frequency based on the rate at which your data changes.

First, we set the time when snapshots are taken in UTC. All snapshot frequencies are derived from this value.

Next is a table where each row represents a frequency unit, with an option to add custom rows.

The hourly snapshot refers to the hourly interval at which snapshots are taken.

For example, if the backup time were set to 15:25, and the hourly snapshots were scheduled for every six hours, backups would be taken at 15:25, 21:25, 3:35, and 9:25.

The daily snapshot is taken once a day at the specified time.

The weekly snapshot is taken on the specified day of the week.

The monthly snapshot is taken on the specified day of the month.

In these four rows, we also specify the retention period of the snapshots. We don't want to hold on to the copies of the data forever, especially if we're taking new snapshots.

If you delete an existing backup frequency unit, the snapshots associated with that frequency unit remain intact until they expire or you explicitly delete them. However no new snapshots for this unit will be taken.

Atlas requires that the retention time for snapshots that are less frequent be equal to or larger than the retention time for snapshots that are more frequent.

For example, if the retention time for an hourly snapshot is two days or more, the retention time for the weekly snapshot must be two days or more.

Finally, if overlapping policy items generate the same snapshot, Atlas associates the snapshot with the policy item that has the longest retention time.

The next section is the Point in Time Restore Policy. “Point in time” means that we can restore the cluster to exactly what it looked like at a specific time.

You may have already guessed that if we're taking snapshots only at the specified intervals, then our only option is to restore to the snapshot timestamp. This is where the continuous backup option that we saw in our cluster configuration is important.

If the continuous backup option is enabled, we are capturing database operations as they happen in real time. Atlas does this by capturing the oplog as well as the snapshots. With this option enabled, we can restore the cluster to any time within the restore window specified here.

Continuous cloud backups should not be confused with scheduled snapshots. We wouldn't want snapshots taken and stored in real time because that would take up a lot of space. Instead, continuous cloud backup tracks the changes in the oplog. Continuous Cloud Backup, which is enabled by default, allows you to meet Recovery Point Objectives, or RPOs, as low as one minute by configuring a point-in-time restore window.

Next, let’s take a look at the advanced options.

You may choose to enable backups to be copied to other regions offered by your cloud provider for redundancy and high availability. Keep in mind that these come at an extra cost and should be factored into your disaster recovery plans.

With cloud backups enabled, we can also take on-demand snapshots. On-demand snapshots may be taken in addition to scheduled ones.

In the Snapshots tab, select the option to take a snapshot now. This creates a copy of the data as it is at that moment. If there is already an on-demand snapshot with a status of “queued” or “inProgress”, you must wait until Atlas has completed the on-demand snapshot before taking another.

These on-demand snapshots are no different from the scheduled snapshots.

Let’s take an on-demand snapshot by clicking here.

In the pop-up that appears, we give the snapshot a description of “test” and set the retention time to three days. This means our on-demand snapshot will be stored for three days. Then we click here.

The Backup tab will show our snapshot being created.

When this process is complete, the snapshot will be listed in the Backup tab. It has a retention time of three days and a frequency of “On-Demand”.

The Snapshots tab under Backup displays all of our snapshots.

There are three options for viewing snapshots: “All” shows all available snapshots. “On-Demand” shows all of our on-demand snapshots. And “Policy” shows all scheduled snapshots taken using the Cloud Backup policy.

We have successfully set up and enabled Continuous Cloud Backup.

Note that if you disable Cloud Backup for a cluster, or terminate a cluster that had snapshots enabled, Atlas immediately deletes the snapshots for that cluster unless you enable the option to keep existing snapshots after termination.

Congratulations! In this video, we explored how to use Atlas Cloud Backups. You learned how to create a policy for taking and retaining scheduled snapshots. You also learned how to take and retain on-demand snapshots. Finally, you learned how to enable Continuous Cloud Backup to keep track of the oplog and configure point-in-time restores.