MongoDB Atlas Online Archive
Parent: MongoDB Atlas · Published reference · snapshot 2026-09-08 · skill mongodb-atlas-expert/references/mongodb-atlas-online-archive.md
↓ Facts as markdownall context files
Online Archive automatically moves documents matching an archival rule out of the live Atlas cluster into Atlas-managed object storage, while keeping those documents queryable through the cluster's FD
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
Overview
- Online Archive automatically moves documents matching an archival rule out of the live Atlas cluster into Atlas-managed object storage, while keeping those documents queryable through the cluster's FDI endpoint (transparent to the application). [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#overview]
Requirements
- Dedicated cluster M10+ (not available on M0/Flex/Serverless) [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#requirements]
- MongoDB 5.0+ on the source cluster [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#requirements]
DATE (most common)
- dateFormat options: "ISODATE" (default ISODate), "EPOCH_MILLISECONDS", "EPOCH_SECONDS" [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#date-most-common]
Partition Fields Strategy
- Partition fields organize archived data into S3 prefix paths for efficient filtering. Critical for query performance. Choose fields commonly used in query filters: [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#partition-fields-strategy]
- Maximum 2 partition fields per archive rule [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#partition-fields-strategy]
- First field MUST match the dateField (for DATE criteria) or be the most selective filter field (for CUSTOM criteria) [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#partition-fields-strategy]
- Order matters: highest-selectivity filter field should be first [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#partition-fields-strategy]
- Supported partition pruning operators: $eq, $gt, $lt, $gte, $lte, $ne, $in [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#partition-fields-strategy]
- Fields NOT in partitionFields trigger full archive scan when queried [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#partition-fields-strategy]
Archive Job Timing & Processing
- Runs every 5 minutes [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#archive-job-timing-processing]
- Max throughput: 2 GB per 5-minute interval [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#archive-job-timing-processing]
- Max file size: 100 MB per archive file [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#archive-job-timing-processing]
- Documents deleted from live cluster AFTER successful write to object storage [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#archive-job-timing-processing]
- Schedule window: Archive jobs can be limited to off-hours to reduce production impact [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#archive-job-timing-processing]
Query Routing
- When querying via the cluster's FDI endpoint: [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#query-routing]
- Recent data → live cluster (fast, indexed) [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#query-routing]
- Archived data → Online Archive object storage (slower, partition-based) [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#query-routing]
- Combined queries → both, results merged transparently [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#query-routing]
- Applications do not need to change query patterns after data is archived - same connection string, same MQL. [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#query-routing]
Cost Model
- $5/TB cost applies when QUERYING archived data. Storage itself is much cheaper than cluster storage (NVMe/GP3). [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#cost-model]
- Minimum: 10 MB per archive query (no benefit from very small queries). [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#cost-model]
Restore / Rehydration
- Archive data is immutable (append-only). To restore to the live cluster: [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#restore-rehydration]
Limitations
- No updates/deletes on archived data: Archive is immutable object storage; updateMany or deleteMany against archived documents will not affect them [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#limitations]
- No Atlas Search on archived data: Full-text $search doesn't work on archived data [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#limitations]
- No indexes on archived data: All archived queries use partition pruning only [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#limitations]
- $sample not random: Returns first N documents, not a statistical random sample [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#limitations]
- No transactions crossing live+archive: Cannot span a transaction across live and archived documents [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#limitations]
- Maximum query timeout: 6 hours (inherits from Data Federation limit) [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#limitations]
Archive Not Moving Data
- Check Atlas → Online Archive → [collection] → Activity tab for job status and errors [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#archive-not-moving-data]
- Verify dateField name is exact (case-sensitive) and matches documents [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#archive-not-moving-data]
- Confirm correct dateFormat - ISODATE requires actual ISODate values, not Unix epoch integers [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#archive-not-moving-data]
- Confirm cluster tier is M10+ and MongoDB version 5.0+ [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#archive-not-moving-data]
Archive Backlog Growing
- Archive jobs process 2 GB per 5-minute window [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#archive-backlog-growing]
- If data accumulates faster than 2 GB/5 minutes, backlog will grow [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#archive-backlog-growing]
- Mitigation: narrow the archive rule to reduce concurrent archiving volume, or contact MongoDB for higher throughput [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#archive-backlog-growing]
Slow Archive Queries
- Partition fields not aligned with query filter → full archive scan [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#slow-archive-queries]
- Check partitionFields match the most common query filter fields [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#slow-archive-queries]
- Run explain() on the FDI endpoint to check nPartitionsScanned [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#slow-archive-queries]
MACC / Cost Tracking
- Archive storage costs appear on the Atlas invoice under Tools & Services → Online Archive. Query processing costs under Data Federation. Monitor in Atlas Billing → Current Invoice. [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#macc-cost-tracking]
Anti-Patterns
- Choosing partition fields that don't match query patterns: Full archive scan on every query → high $5/TB cost [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#anti-patterns]
- Using CUSTOM criteria without an index on the filter field: Archive job itself will do slow scans to find matching documents - add an index on filter fields [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#anti-patterns]
- Querying archived data without partition-aligned filters: Always include a partition field in $match when querying archive [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#anti-patterns]
- Expecting consistency between live and archive: Documents are copied to archive and then deleted from live - there is no transactional guarantee between the two [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#anti-patterns]
- Using Online Archive as a backup system: Archive only stores the final document state at archival time - not a substitute for backup snapshots with PITR [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#anti-patterns]
References
- Online Archive Documentation [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#references]
- Configure an Online Archive [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#references]
- Query Archived Data [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#references]
- Online Archive Billing [archived source: https://llms-explorer.com/sources/mdb-context-hub/mongodb-atlas-online-archive/#references]
Where this helps
- Reducing live-cluster storage cost for time-based data, such as event logs or historical orders, that's rarely queried after a certain age, without changing application query patterns. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Meeting a data-retention requirement where old data must remain queryable but doesn't need to sit on expensive cluster storage. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Designing partition fields so archived-data queries stay fast instead of triggering a full archive scan. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Deciding Online Archive is the wrong tool because the use case actually needs a real backup with PITR, not an archive. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Project ideas
- Configure an Online Archive rule on a DATE field with well-chosen partition fields matching the most common query filter, then run explain() on the FDI endpoint to check nPartitionsScanned. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Build a query-routing test that confirms combined live+archive queries return merged results through the same connection string and MQL the application already uses. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Set up a CUSTOM-criteria archive rule with a supporting index on the filter field, and compare archive job throughput against a DATE-based rule. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Build a cost dashboard tracking the $5/TB archived-data query charge separately from Online Archive storage cost, using the Atlas Billing Dashboard. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Common mistakes
- Choosing partition fields that don't match actual query filters, forcing a full archive scan, and the associated $5/TB cost, on every query. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Using CUSTOM archive criteria without an index on the filter field, which makes the archive job itself do slow scans to find matching documents. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Assuming transactional consistency between live and archived data — documents are copied to archive storage and then deleted from the live cluster, with no transactional guarantee linking the two. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Treating Online Archive as a backup — it only stores the final document state at archival time, so it's not a substitute for PITR-backed snapshots. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Known issues
- Archived data is immutable — updateMany or deleteMany against archived documents has no effect, and there is no in-place update path. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- There is no Atlas Search or index support on archived data; all archived queries rely purely on partition pruning. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- $sample against archived data is not a true random sample — it returns the first N documents rather than a statistically random selection. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Archive job throughput is capped at 2 GB per 5-minute interval, so a source collection generating archival-eligible data faster than that will build a growing backlog. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Children
- Archive Rules
- Partition Fields (frontier, viability 3.98 / 5)
- Federated Query on Archive (frontier, viability 2.70 / 5, below research gate)
- Archive Restore (frontier, viability 3.63 / 5)
- Archive Monitoring (frontier, viability 3.25 / 5)
- Archive Anti-Patterns (frontier, viability 3.00 / 5, below research gate)
Frontier under this node: Archive Anti-Patterns (3.00), Archive Cost Model, Archive Monitoring (3.25), Archive Restore (3.63), Federated Query on Archive (2.70), Partition Fields (3.98)