Developing a disaster recovery plan for MongoDB.

Instruction: Craft a comprehensive disaster recovery plan for a MongoDB deployment, considering various failure scenarios.

Context: This question evaluates the candidate's ability to plan for and mitigate the effects of catastrophic failures, ensuring the resilience and recoverability of MongoDB data.

Updated

Official answer

Define recovery objectives and scenarios separately: node failure, regional loss, accidental deletion, corruption and compromised credentials. Identify the owner, escalation path and authority for failover or restore.

Use a supported backup method for the actual topology and size. A plain mongodump during writes is not automatically a consistent point-in-time snapshot across a sharded cluster. Follow a coordinated sharded-backup procedure or managed backup service with the required retained recovery history. Do not assume an old third-party script is supported merely because its name suggests consistency.

Protect backups in a separate failure domain with encryption, restricted access, retention and usable recovery keys. Replica sets support availability but can propagate logical mistakes. Document source identity, backup scope and the recoverable timestamp for every artifact.

Restore into an isolated target during drills. Validate indexes, counts, representative queries and application invariants, then measure actual recovery time/data loss against the objectives. Include credentials, networking, client routing and reconciliation of ambiguous writes in the runbook.

Before reopening service, verify the chosen recovery point and acceptance criteria. Preserve evidence and the old state where needed. Review the plan after topology, schema or backup changes; a backup-success alert alone does not prove disaster recovery readiness.

MongoDB sharded backup/restore, mongodump restrictions

Related Questions