skip to content

Your self-managed three-member MongoDB replica set holds 2 TB and has a one-hour recovery objective, yet backups are a nightly mongodump; how do you decide what replaces it and prove it restores?

level: principalimportance: should knowfreq 35%

answer

  1. time the restore, not the backup
  2. index builds at 2 TB
  3. recovery time and recovery point move apart
  4. what snapshots can't do for one collection
  5. a drill on separate hardware

basics

~20 s

A nightly mongodump at 2 TB is unlikely to restore within an hour, because every document is inserted and every index rebuilt. I'd move whole-set recovery to snapshots or a coordinated service, and judge it by timed restores to a test deployment.

solid answer

~50 s

I start by measuring: a timed restore of the real dump on separate hardware. `mongorestore` inserts every document and rebuilds every index, and the manual itself pitches the tools at small deployments and rates their recovery time as high, so at 2 TB I expect to miss an hour. Filesystem snapshots cut recovery time, but the manual still rates their recovery point high, since data since the last snapshot is lost. If that's unacceptable, Cloud Manager, Ops Manager or a captured oplog comes into it. I'd keep dumps for one-collection restores, which snapshots can't scope. Proof is a scheduled restore drill to a test deployment that matches the version, times the whole path to adding members, and checks the summary line, counts, indexes and an application read. Dumps stop being acceptable when the measured restore passes the objective, `--oplog` overflows, or the dump hurts production.

go deeper

for a junior

Recall that replication isn't a backup, since a bad write replicates too, and that a backup counts only once it has been restored somewhere.

for a middle

Explain why dump restores take long: inserts plus index rebuilds. Tell recovery time from recovery point, and say which one a snapshot improves according to the manual's table.

for a senior

Run the drill: production-sized target, matching versions, timed path, summary line and counts rather than exit status. Point out the operations and collections that a dump cannot handle.

for a principal

Own the standing decision and its written trigger: what the main recovery path is, what stays as a supplement, what edition or staffing constraint applies, and who runs the drill that keeps the claim honest.

## What the backup is for A three-member replica set already survives losing a node, so a backup covers what replication can't: a bad write or dropped collection that replicates at once, corruption, or losing the site. Two separate numbers matter, and it's worth asking which one the 'one hour' means: - **Recovery time**: how long until the application is back. - **Recovery point**: how much recent data can be lost. A nightly job leaves a recovery point of up to about a day however the restore goes. If the hour is meant as data loss, a nightly dump fails before anyone runs a restore. ## What the manual's comparison says | Consideration | `mongodump`/`mongorestore` | Filesystem snapshot | Cloud Manager/Ops Manager | |---|---|---|---| | Recovery time | High | Low | Low, depends on snapshot store | | Recovery point | High | High | Low | | Continual point-in-time | No | No | Yes | | Incremental | No | Depends on storage and tool | Yes | | Scope a backup to namespaces | Yes | No | Yes, with filtering | | Restore complexity | Low | High for a sharded cluster | Low under automation | The last two rows are why this isn't a simple replacement. The manual also says Cloud Manager backup needs Enterprise Server and Ops Manager comes with Enterprise Advanced, so that column carries an edition constraint to weigh, alongside what the team can run. ## Why a dump strains at 2 TB - **Restore is rebuilding.** Every document is inserted through the server, under `majority` write concern by default, and every index is rebuilt afterwards. - **The size isn't the on-disk size.** With WiredTiger, `mongodump` outputs uncompressed data, so the data to move can be well beyond compressed disk usage. - **The source pays.** The tools read all the data through memory and evict what the workload needs. If data exceeds memory, `mongodump` pushes the working set out, which is the reason to read from a hidden secondary. - **Long runs fail late.** `--oplog` fails if the oplog rolls past the start or a rename occurs, and it finds out after the collections are dumped. These are reasons to measure rather than verdicts. A collection with few indexes restores very differently from one with many, so a small sample doesn't predict the whole. ## When dumps stop being acceptable I'd write the trigger down so nobody debates it during an incident. Any one of these ends the dump's role as the main recovery path: - The measured full restore exceeds the objective. - `--oplog` overflows, or repeatedly fails on renames, on a normal night. - The dump's effect on the working set shows up in production latency, even from a secondary, or the secondary lags too far. - The deployment is sharded, where the dump requires a write stop for its whole length. A dump stays useful beside the main path. The docs describe it for partial backups, syncing production to staging or development, and changing a standalone's storage engine, and it can restore one collection, which a snapshot can't scope. ## Proving it restores The tools guidance is one line: verify your backups by restoring them to a test deployment. A successful backup job proves only that a file was written. A useful drill has these parts: 1. **Schedule it,** with an owner and an alert when it goes stale. 2. **Use real conditions:** the same major version or FCV, the same tools version, and a production-sized host. 3. **Time the whole path,** from fetching the backup off site to an application read, including members being added, because the objective is about service, not one node. 4. **Check the result.** In Database Tools 100.20.1 duplicate key and validation failures don't change the exit status, so read the summary line, then compare counts and index lists, run `validate` on key collections and confirm users and roles. 5. **Rehearse the failure cases:** one collection, and the bad-write case. Don't let `--oplogReplay` first run during an incident, because it needs a special role. Also check what can't be dumped at all. The docs rule out collections using Queryable Encryption or CSFLE, so if those exist a dump alone doesn't cover them, whatever the timing says. Dumping time series collections from a 9.0 deployment also needs Database Tools 100.16.0 or later, which a drill on an old tools version would catch.

  • Does moving mongodump to a hidden secondary make a nightly dump acceptable at 2 TB?
    It solves one problem, the production working set being evicted, and leaves the larger one. The recovery objective is decided at restore time, and restore still means inserting every document and building every index. The dump also still risks overflow on a slow run. A secondary improves how the backup is taken, not how fast it returns.
  • If snapshots become the main path, why keep any logical dump at all?
    Snapshots can't be scoped to a namespace, so getting one collection back means standing up a whole copy and extracting from it. A dump restores a namespace directly with `--nsInclude`. The manual's table marks namespace scope as a dump strength. Whether that is worth the nightly load depends on how often single-collection restores really happen.

  • A three-member replica set means the team doesn't need separate backups.
  • A green nightly backup job proves the data can be restored within the objective.
  • Moving to filesystem snapshots fixes recovery point as well as recovery time.
  • Once snapshots exist, a logical dump has no remaining use in the plan.
  • A restore timed on a small sample tells you how long 2 TB will take.

Assumes MongoDB 9.0 and Database Tools 100.20.1: the exit-status behaviour was read at that tools version, and dumping time series collections from a 9.0 deployment needs 100.16.0 or later.