MongoDB Atlas Online Archive
Parent: MongoDB Atlas · researched 2026-05-28T18:33:37.810Z· 13 sources · 10 concepts · skill mongodb-atlas-online-archive
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
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). [source]
Requirements
DATE (most common)
- dateFormat options: "ISODATE" (default ISODate), "EPOCH_MILLISECONDS", "EPOCH_SECONDS" [source]
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: [source]
- Maximum 2 partition fields per archive rule [source]
- First field MUST match the dateField (for DATE criteria) or be the most selective filter field (for CUSTOM criteria) [source]
- Order matters: highest-selectivity filter field should be first [source]
- Supported partition pruning operators: $eq, $gt, $lt, $gte, $lte, $ne, $in [source]
- Fields NOT in partitionFields trigger full archive scan when queried [source]
Archive Job Timing & Processing
- Runs every 5 minutes [source]
- Max throughput: 2 GB per 5-minute interval [source]
- Max file size: 100 MB per archive file [source]
- Documents deleted from live cluster AFTER successful write to object storage [source]
- Schedule window: Archive jobs can be limited to off-hours to reduce production impact [source]
Query Routing
- When querying via the cluster's FDI endpoint: [source]
- Recent data → live cluster (fast, indexed) [source]
- Archived data → Online Archive object storage (slower, partition-based) [source]
- Combined queries → both, results merged transparently [source]
- Applications do not need to change query patterns after data is archived - same connection string, same MQL. [source]
Cost Model
Restore / Rehydration
- Archive data is immutable (append-only). To restore to the live cluster: [source]
Limitations
- No updates/deletes on archived data: Archive is immutable object storage; updateMany or deleteMany against archived documents will not affect them [source]
- No Atlas Search on archived data: Full-text $search doesn't work on archived data [source]
- No indexes on archived data: All archived queries use partition pruning only [source]
- $sample not random: Returns first N documents, not a statistical random sample [source]
- No transactions crossing live+archive: Cannot span a transaction across live and archived documents [source]
- Maximum query timeout: 6 hours (inherits from Data Federation limit) [source]
Archive Not Moving Data
- Check Atlas → Online Archive → [collection] → Activity tab for job status and errors [source]
- Verify dateField name is exact (case-sensitive) and matches documents [source]
- Confirm correct dateFormat - ISODATE requires actual ISODate values, not Unix epoch integers [source]
- Confirm cluster tier is M10+ and MongoDB version 5.0+ [source]
Archive Backlog Growing
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. [source]
Anti-Patterns
- Choosing partition fields that don't match query patterns: Full archive scan on every query → high $5/TB cost [source]
- 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 [source]
- Querying archived data without partition-aligned filters: Always include a partition field in $match when querying archive [source]
- Expecting consistency between live and archive: Documents are copied to archive and then deleted from live - there is no transactional guarantee between the two [source]
- 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 [source]
References
Children
- Archive Rules (frontier)
- Partition Fields (frontier)
- Federated Query on Archive (frontier)
- Archive Cost Model (frontier)
- Archive Restore (frontier)
- Archive Monitoring (frontier)
- Archive Anti-Patterns (frontier)
Frontier under this node: Archive Anti-Patterns, Archive Cost Model, Archive Monitoring, Archive Restore, Archive Rules, Federated Query on Archive, Partition Fields