Important
Feature unavailable in Flex Clusters
Flex clusters don't support this feature at this time. To learn more, see Atlas Flex Limitations.
Overview
You can configure data in a collection to be archived by specifying an archiving rule. The procedure differs by collection type:
For a standard collection, the archiving rule uses a date field and a retention period in days, or a custom query that selects documents to archive.
For a time series collection, the archiving rule uses the collection's
timeFieldand a retention period in days.
Select the guide for your collection type:
When you configure an Online Archive on your cluster, Atlas creates 2 federated database instances on your cluster for your archive only and for your cluster and archive.
Limitations
You can create up to 50 online archives per cluster and up to 20 can be active per cluster. The following limitations apply:
You can configure multiple online archives in the same namespace, but only one can be active at any given time.
You can't create multiple online archives on the same fields in the same collection.
You can't access your online archive during the following scenarios:
A full outage of the primary region of your cluster.
An outage of AWS S3 where your archived data is stored.
You can't use an archiving rule for more than one collection.
Note
If your goal is to archive data from several collections, you must create an archiving rule for each collection.
To prevent resource strain, archival tasks run every five minutes. Documents meeting the archiving criteria are archived into files, limited to 100 MB per file and a total of 2 GB per five-minute cycle.
You can't archive data below the size of 5 MiB after 7 days. For 7 days immediately after Atlas creates an archive, Atlas archives all data. After 7 days, Atlas archives data only when your data size reaches 5 MiB.
Avoid updating or inserting documents that meet the archival condition when Atlas is archiving data. Otherwise, Atlas might capture an inconsistent snapshot of the data during the archival run. If updates occur, the version of the document that gets archived is uncertain.
Important
By default, MongoDB waits 5 minutes after completing an archival job to start another run.