Archive Cluster Data¶
Atlas offers a feature that moves infrequently accessed data from your Atlas cluster to a MongoDB-managed read-only Data Lake on a cloud object storage without user action. Once Atlas archives the data, you have a unified view of your Atlas and Online Archive data using a read-only Data Lake.
Atlas archives data based on the criteria you specify in an archiving rule. The criteria can be one of the following:
- A combination of a date and number of days. Atlas archives data when the current date exceeds the date plus the number of days specified in the archiving rule.
- A custom query. Atlas runs the query specified in the archiving rule to select the documents to archive.
Cluster Requirements for Online Archive¶
Atlas offers this Online Archive feature only on
greater clusters that run MongoDB 3.6 or later.
How Atlas Archives Data¶
To archive data:
- Atlas runs a query every five minutes to determine the documents that match the criteria for archiving. Atlas refers to this query as a job.
For documents that match the archival criteria, Atlas:
- Writes to up to a maximum of 10,000 partitions per archival job.
- Writes up to 2GB of document data to partitions on the cloud object storage for each unique combination of query field values except dates, which are grouped during each run to reduce the number of partitions.
- Writes each subsequent quantity of document data (up to 2 GB) with each query run.
Atlas provides a unified endpoint through which you can query both your live cluster and archived data using the same database and collection name you use in your Atlas cluster. You can't use the unified endpoint over a private connection such as Peering or AWS PrivateLink. You must use a standard internet connection over TLS.
If you activate Online Archive for an AWS cluster, the cloud object storage exists in the same region in AWS as your cluster. If you activate Online Archive for a GCP or Azure cluster, Online Archive creates the archive in the AWS region closest to your cluster's primary based on a calculation of distance between the cluster and cloud object storage.
Atlas encrypts your archived data using Amazon's server-side encryption S3-managed keys (SSE-S3) for archived data. It can't use any encryption-at-rest encryption keys you might have used on your cluster data.
When you archive data, Atlas first copies the data to the cloud object storage and then deletes the data from your Atlas cluster. WiredTiger does not release the storage blocks of the deleted data back to the OS for performance reasons. However, Atlas eventually automatically reuses these storage blocks for new data. This helps the Atlas cluster to avoid fragmentation. To learn more about reclaiming the disk space, see How do I reclaim disk space in WiredTiger?.
Data Lake for Online Archive¶
When you configure your
M10 or greater Atlas cluster for
Online Archive, Atlas creates a read-only Data Lake,
one per cluster, on a cloud object storage for your archived data.
Viewing the Online Archive¶
To view your Data Lake for the Online Archive:
- Navigate to the Data Lake page in the Atlas console.
- Click Data Lake from the left navigation in your Project page.
Querying the Online Archive¶
To query your Online Archive data, use the connection string through the Data Lake Connect button to connect to the cloud object storage.
You can also query your Online Archive data with SQL. For more information, see Querying with SQL.
Deleting Online Archives¶
If you delete all the Online Archives, Atlas deletes the Data Lake. After deleting all the Online Archives, if you create an Online Archive with the same settings as a deleted Online Archive, Atlas creates a new Data Lake for the new Online Archive.
Online Archive Costs¶
Online Archive stores infrequently accessed data to lower the data storage costs on your Atlas cluster. You incur costs for storage on the cloud object storage and queries on archived data.
To learn more about the storage and query costs, see Atlas pricing page.
Manage Your Online Archive¶
You can configure an Online Archive for a collection on your
cluster through your Atlas UI and API. Once you create an
Online Archive, you can view the list of archives, edit an
archiving rule, pause archiving, and delete your Online Archive at
any time. If you need to move archived data back to your cluster, you
mongoexport. The following pages describe how