· 8 min read

By Argon Labs · Updated

MongoDB Time Travel vs Point-in-Time Recovery

Compare MongoDB point-in-time recovery with Argon historical reads and branches: recovery scope, retained history, and when to use each workflow.

MongoDBTime TravelBackup

Current capability notes: checkout materializes a physical database; native actor attribution is per branch/run; undo needs complete images and retained history. CLI sandboxes require watch and scheduled sweep. Read the capability matrix.

MongoDB time travel and point-in-time recovery (PITR) both let you go back to an earlier state of your data through different workflows. PITR reconstructs backed-up data at a selected time into a restore target. Argon time travel is a read and branch operation: it lets you query or fork a retained past state while the present keeps running, untouched. This guide explains the difference, how each works under the hood, and when to reach for which.

The short version

Point-in-time recovery (PITR)Time travel (Argon)
PurposeDisaster recoveryDebugging, audit, recovery, experiments
GranularityCluster or selected databases/collections, where supportedPer branch, supported retained history
Effect on live dataDepends on restore target and overwrite modeNon-destructive — present untouched
SpeedDepends on backup, data volume and restore modeDepends on history, query and checkout size
Access patternRestore, then useQuery at a point, or branch from it
Typical toolsAtlas backup, Ops Manager, PBM, oplog + snapshotsArgon

What point-in-time recovery is

PITR is the backup-and-restore feature you turn to when something has gone catastrophically wrong — a bad migration, a dropped collection in production, ransomware. It reconstructs backed-up data at a chosen timestamp. A common approach takes periodic snapshots and continuously captures the oplog (the replica set’s operation log); to restore to time T, it loads the nearest snapshot before T and replays the oplog up to T. MongoDB Atlas offers Continuous Cloud Backup restores on eligible dedicated clusters; self-managed setups use Ops Manager, Percona Backup for MongoDB, or hand-rolled snapshot-plus-oplog replay.

Restoring to a separate target can leave the source running. A cluster-level Atlas restore replaces data on its target. Atlas also supports selected database and collection restores from supported backups, with create-as-new or overwrite behavior. Restrictions apply, including no individual time-series collection restores and no collection-level restores on NVMe clusters. Selective restoration is not a guarantee of a shorter recovery time.

What time travel is

MongoDB itself supports snapshot reads with atClusterTime. From MongoDB 5.0, supported reads such as find and aggregate can use this outside transactions. The requested timestamp must remain in the storage engine's snapshot-history window. This is useful for recent consistent reads; it does not create a writable branch or keep an arbitrary old state indefinitely.

Argon treats captured history as something you can read and branch. Instead of rewinding the live database, you ask: “what did this data look like at time T?” — and get an answer without changing anything that’s running now. You can query a past state in place, or branch from it to get an isolated, writable copy rooted at that moment.

Because it is non-destructive, you use it constantly rather than only in emergencies: reproduce a bug on last Tuesday’s data, audit what a record used to say, inspect retained document states, or compare past changes. Unsupported collection drops and renames mark capture incomplete; use your backup recovery procedure for those cases.

Under the hood: oplog replay vs a write-ahead log

PITR reconstructs a past state by replaying the oplog on top of a snapshot, producing restored data in the selected target. Argon’s time travel comes from modeling the database as a write-ahead log where supported captured operations carry log sequence numbers. A retained state is just “replay the log up to that position,” and a branch is a pointer into shared history plus later writes. Reading the past costs a query, not a full-cluster restore; its cost depends on the retained history. Branch metadata is lightweight, while checking it out copies the materialized dataset into MongoDB. History becomes a first-class, queryable dimension rather than a backup you have to rebuild.

They’re complementary — use both

Keep independent backups or PITR and a tested recovery procedure for data loss. Time travel is not a backup. Use Argon to inspect or branch supported captured document states for debugging, audits, or experiments while the required history remains available. Recovery through undo also requires complete images and a supported write range; it can refuse incomplete or conflicting history. Use your backup recovery procedure for unsupported operations such as collection drops or renames.

How to time-travel a MongoDB database with Argon

First complete the local setup and use a project named docs-review with healthy capture and retained history. Before the experiment, save its current LSN with the first command. After the experiment, preview that state and fork a new branch without resetting the source:

# Save a baseline before the experiment (Python 3 is used to parse JSON)
export BASELINE_LSN="$(argon time-travel info -p docs-review -b main --output json | python3 -c 'import json,sys; print(json.load(sys.stdin)["latest_lsn"])')"

# After the experiment, preview and fork the retained baseline
argon restore preview -p docs-review -b main --lsn "$BASELINE_LSN"
argon restore branch -p docs-review -b main --lsn "$BASELINE_LSN" --as recovered

# Materialize recovered into MongoDB; this prints its connection string
argon checkout -p docs-review -b recovered

See the documentation for selecting a retained point with --lsn or --time. Keep a separate argon watch -p docs-review -b recoveredprocess running if you write to the recovered database. See the features overview for how time travel fits with branching and merge.

Frequently asked questions

Does MongoDB have built-in time travel?
MongoDB supports recent snapshot reads: from MongoDB 5.0, certain reads outside transactions can use read concern snapshot with atClusterTime, within the retained snapshot-history window. Backup/PITR can restore older states when covered by backups. Argon provides a separate captured-history workflow with named branches, diffs, and reviewed merges.
Is point-in-time recovery the same as time travel?
PITR reconstructs backed-up data at a selected time into a restore target, which can be separate from the source. Scope and overwrite behavior depend on the backup product and restore mode. Argon reads or branches supported states from its retained captured history. Both can preserve the current source when used with a separate target.
Can I recover one dropped collection without restoring the whole database?
Use your backup or PITR procedure for a dropped collection. Argon capture marks unsupported drop/rename operations incomplete and refuses unsafe restoration; it must not be presented as a guaranteed recovery path for those operations.
Does time travel replace backups?
No. Keep independent backups and a tested recovery procedure for data loss, including hardware failure and ransomware. Argon can inspect or branch supported captured document states while the required history remains available. It does not cover every operation or replace backup recovery.
How far back can Argon time-travel?
Time travel is available within retained history. Pins protect the data they reference while the pin exists; keep backups and choose retention for your workload. A healthy capture process records document changes. Undo requires complete images and retained history. Missing images or unsupported drop/rename operations mark history incomplete and prevent unsafe restoration.