SlideShare a Scribd company logo
1 of 34
#MongoDBDays




Backup, Restore, and
Disaster Recovery
James Kerr
Senior Solutions Architect, 10gen
Agenda
• DR Overview
• Backup
• Restore
• Replication
• Know your options
DR Overview
Disasters do happen
Sometimes they are our fault
DR vs. HA
• Don’t confuse the two
• Distinctly different business requirements
• Technical solutions may converge
Recovery Point Objective
How much data can you afford to lose?
Recovery Time Objective
How long can you afford to be off-line?
DR Solution Tradeoffs
• Complexity increases as RPO approaches zero
• Complexity increases as RTO approaches zero
Backup
What’s the most important
thing about making backups?
Restoring them
If you don't ensure that
your backups can be
restored, there's no
point in doing backups
Backup Options
• mongodump
• Copy files
• Snapshot disk
mongodump
$ mongodump --help
Export MongoDB data to BSON files.

options:
 --help              produce help message
 -v [ --verbose ]       be more verbose (include multiple times for more
                                                              verbosity e.g. -vvvvv)
 --version            print the program's version and exit
 -h [ --host ] arg      mongo host to connect to ( /s1,s2 for
 --port arg           server port. Can also use --host hostname
 -u [ --username ] arg username
 -p [ --password ] arg password
 --dbpath arg           directly access mongod database files in
                  path, instead of connecting to a mongod
                  needs to lock the data directory, so can
                  if a mongod is currently accessing the s
 -d [ --db ] arg       database to use
 -c [ --collection ] arg collection to use (some commands)
 -o [ --out ] arg (=dump)output directory or "-" for stdout
 -q [ --query ] arg     json query
 --oplog              Use oplog for point-in-time snapshotting
mongodump
• Dumps collections to *.bson files
• Mirrors your structure
• --db to dump a specific database
• --collection to dump a specific collection
• --oplog to record oplog while backing up
• --query/filter selective dump
File System Backups
• Must use journaling
• Copy /data/db files
• Snapshot
• Seriously, always use journaling
Ensure Consistency
• fsyncLock - flush and stop accepting writes
• Don't forget to fsyncUnlock
File System Backups - Pros and
Cons
• Entire database
• Backup files will be large
• Fastest way to create a backup
• Fastest way to restore a backup
Restore
mongorestore
• mongorestore
• --oplogReplay replay oplog to point-in-time
File System Restores
• Restore all databases
• Restore selected databases
Example
Backup Example: Sharded
Cluster
1. Stop Balancer (and wait)
2. or no balancing window
3. Stop one config server (data R/O)
4. Backup Data (shards, config)
5. Restart config server
6. Resume Balancer
Tips and Tricks
• bsondump
   – inspect data at console
• lvm snapshot time/space trade-off
   – Multi volume backup
   – clean up snapshots
Replication
Replica Sets
Disaster Avoidance
Avoid single point of failure
Replica Set Configuration
 > rs.conf() {
"_id" : "replSetName",
"version" : 3,
"members" : [
  {
    "_id" : 0,
    "host" : "myhost1.dnsname.com:27017"
  },
  {
    "_id" : 1,
    "host" : "myhost2.dnsname.com:27017"
  },
  {
    "_id" : 2,
    "host" : "myhost3.dnsname.com:27017"
  }
]}
Avoid single point of failure in
replica sets
Deploy a Resilient Topology
• Redundancy
• Multiple Datacenters
• Multiple Regions
• Delayed Replication
• Can support HA and DR requirements
   – HA by providing intra and inter datacenter failover
   – DR by creating geographically dispersed copies of data
   – DR by configuring a delay between the primary and one
     or more secondaries
Summary
Choose the Right Tool
• RPO on the order of seconds or minutes?
  – Use Replication

• RPO on the order of hours?
  – Maybe backups will suffice

• RTO on the order of seconds or minutes?
  – Use Replication

• RTO on the order of hours or days?
  – Use backups with warm/cold standby

• Need HA and DR?
Use Replica Sets
Design a topology to
support both HA and DR
#MongoDBDays




Thank You
James Kerr
Senior Solutions Architect, 10gen

More Related Content

What's hot

Examining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesExamining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesBobby Curtis
 
Basic oracle-database-administration
Basic oracle-database-administrationBasic oracle-database-administration
Basic oracle-database-administrationsreehari orienit
 
GIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control SystemGIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control SystemTommaso Visconti
 
Understanding oracle rac internals part 1 - slides
Understanding oracle rac internals   part 1 - slidesUnderstanding oracle rac internals   part 1 - slides
Understanding oracle rac internals part 1 - slidesMohamed Farouk
 
The Evolution of the Hadoop Ecosystem
The Evolution of the Hadoop EcosystemThe Evolution of the Hadoop Ecosystem
The Evolution of the Hadoop EcosystemCloudera, Inc.
 
Architecture for building scalable and highly available Postgres Cluster
Architecture for building scalable and highly available Postgres ClusterArchitecture for building scalable and highly available Postgres Cluster
Architecture for building scalable and highly available Postgres ClusterAshnikbiz
 
MongoDB Administration 101
MongoDB Administration 101MongoDB Administration 101
MongoDB Administration 101MongoDB
 
What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19cMaria Colgan
 
Backups And Recovery
Backups And RecoveryBackups And Recovery
Backups And Recoveryasifmalik110
 
Cassandra serving netflix @ scale
Cassandra serving netflix @ scaleCassandra serving netflix @ scale
Cassandra serving netflix @ scaleVinay Kumar Chella
 
Communication Patterns Using Data-Centric Publish/Subscribe
Communication Patterns Using Data-Centric Publish/SubscribeCommunication Patterns Using Data-Centric Publish/Subscribe
Communication Patterns Using Data-Centric Publish/SubscribeSumant Tambe
 
Object Storage 1: The Fundamentals of Objects and Object Storage
Object Storage 1: The Fundamentals of Objects and Object StorageObject Storage 1: The Fundamentals of Objects and Object Storage
Object Storage 1: The Fundamentals of Objects and Object StorageHitachi Vantara
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HAharoonm
 
Spectrum Scale Best Practices by Olaf Weiser
Spectrum Scale Best Practices by Olaf WeiserSpectrum Scale Best Practices by Olaf Weiser
Spectrum Scale Best Practices by Olaf WeiserSandeep Patil
 
MariaDB Performance Tuning and Optimization
MariaDB Performance Tuning and OptimizationMariaDB Performance Tuning and Optimization
MariaDB Performance Tuning and OptimizationMariaDB plc
 
How netflix manages petabyte scale apache cassandra in the cloud
How netflix manages petabyte scale apache cassandra in the cloudHow netflix manages petabyte scale apache cassandra in the cloud
How netflix manages petabyte scale apache cassandra in the cloudVinay Kumar Chella
 

What's hot (20)

Examining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesExamining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail Files
 
Basic oracle-database-administration
Basic oracle-database-administrationBasic oracle-database-administration
Basic oracle-database-administration
 
PostgreSQL and RAM usage
PostgreSQL and RAM usagePostgreSQL and RAM usage
PostgreSQL and RAM usage
 
GIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control SystemGIT: Content-addressable filesystem and Version Control System
GIT: Content-addressable filesystem and Version Control System
 
SQL Tuning 101
SQL Tuning 101SQL Tuning 101
SQL Tuning 101
 
Understanding oracle rac internals part 1 - slides
Understanding oracle rac internals   part 1 - slidesUnderstanding oracle rac internals   part 1 - slides
Understanding oracle rac internals part 1 - slides
 
The Evolution of the Hadoop Ecosystem
The Evolution of the Hadoop EcosystemThe Evolution of the Hadoop Ecosystem
The Evolution of the Hadoop Ecosystem
 
Architecture for building scalable and highly available Postgres Cluster
Architecture for building scalable and highly available Postgres ClusterArchitecture for building scalable and highly available Postgres Cluster
Architecture for building scalable and highly available Postgres Cluster
 
MongoDB Administration 101
MongoDB Administration 101MongoDB Administration 101
MongoDB Administration 101
 
Oracle GoldenGate
Oracle GoldenGate Oracle GoldenGate
Oracle GoldenGate
 
What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19c
 
Backups And Recovery
Backups And RecoveryBackups And Recovery
Backups And Recovery
 
Cassandra serving netflix @ scale
Cassandra serving netflix @ scaleCassandra serving netflix @ scale
Cassandra serving netflix @ scale
 
Communication Patterns Using Data-Centric Publish/Subscribe
Communication Patterns Using Data-Centric Publish/SubscribeCommunication Patterns Using Data-Centric Publish/Subscribe
Communication Patterns Using Data-Centric Publish/Subscribe
 
Multimedia Streaming Architecture
Multimedia Streaming ArchitectureMultimedia Streaming Architecture
Multimedia Streaming Architecture
 
Object Storage 1: The Fundamentals of Objects and Object Storage
Object Storage 1: The Fundamentals of Objects and Object StorageObject Storage 1: The Fundamentals of Objects and Object Storage
Object Storage 1: The Fundamentals of Objects and Object Storage
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HA
 
Spectrum Scale Best Practices by Olaf Weiser
Spectrum Scale Best Practices by Olaf WeiserSpectrum Scale Best Practices by Olaf Weiser
Spectrum Scale Best Practices by Olaf Weiser
 
MariaDB Performance Tuning and Optimization
MariaDB Performance Tuning and OptimizationMariaDB Performance Tuning and Optimization
MariaDB Performance Tuning and Optimization
 
How netflix manages petabyte scale apache cassandra in the cloud
How netflix manages petabyte scale apache cassandra in the cloudHow netflix manages petabyte scale apache cassandra in the cloud
How netflix manages petabyte scale apache cassandra in the cloud
 

Viewers also liked

Webinar: Backups and Disaster Recovery
Webinar: Backups and Disaster RecoveryWebinar: Backups and Disaster Recovery
Webinar: Backups and Disaster RecoveryMongoDB
 
Backup exec 2015 end user presentation
Backup exec 2015 end user presentationBackup exec 2015 end user presentation
Backup exec 2015 end user presentationTania Macarlupú
 
Slide presentation storage_craft_backup_disaster_recovery_for_microsoft_syste...
Slide presentation storage_craft_backup_disaster_recovery_for_microsoft_syste...Slide presentation storage_craft_backup_disaster_recovery_for_microsoft_syste...
Slide presentation storage_craft_backup_disaster_recovery_for_microsoft_syste...StorageCraft Benelux
 
Information system managment disaster recovery
Information system managment disaster recoveryInformation system managment disaster recovery
Information system managment disaster recoveryRavi Singh Shekhawat
 
Webinar: Backups + Disaster Recovery
Webinar: Backups + Disaster RecoveryWebinar: Backups + Disaster Recovery
Webinar: Backups + Disaster RecoveryMongoDB
 
Technologies for Disaster Management
Technologies for Disaster ManagementTechnologies for Disaster Management
Technologies for Disaster ManagementBrandon Greenberg
 
Top 10 Bad Coding Practices Lead to Security Problems
Top 10 Bad Coding Practices Lead to Security ProblemsTop 10 Bad Coding Practices Lead to Security Problems
Top 10 Bad Coding Practices Lead to Security ProblemsNarudom Roongsiriwong, CISSP
 
Webinar: An Enterprise Architect’s View of MongoDB
Webinar: An Enterprise Architect’s View of MongoDBWebinar: An Enterprise Architect’s View of MongoDB
Webinar: An Enterprise Architect’s View of MongoDBMongoDB
 
MISO L008 Disaster Recovery Plan
MISO L008 Disaster Recovery PlanMISO L008 Disaster Recovery Plan
MISO L008 Disaster Recovery PlanJan Wong
 
An Introduction to Big Data, NoSQL and MongoDB
An Introduction to Big Data, NoSQL and MongoDBAn Introduction to Big Data, NoSQL and MongoDB
An Introduction to Big Data, NoSQL and MongoDBWilliam LaForest
 
03 backup-and-recovery
03 backup-and-recovery03 backup-and-recovery
03 backup-and-recoveryhunny garg
 
Backup And Recovery
Backup And RecoveryBackup And Recovery
Backup And RecoveryWynthorpe
 
database recovery techniques
database recovery techniques database recovery techniques
database recovery techniques Kalhan Liyanage
 
ISO 22301: The New Standard for Business Continuity Best Practice
ISO 22301: The New Standard for Business Continuity Best PracticeISO 22301: The New Standard for Business Continuity Best Practice
ISO 22301: The New Standard for Business Continuity Best PracticeMissionMode
 
Disaster Recovery Presentation
Disaster Recovery PresentationDisaster Recovery Presentation
Disaster Recovery PresentationTimSchaefer
 
Disaster Recovery & Data Backup Strategies
Disaster Recovery & Data Backup StrategiesDisaster Recovery & Data Backup Strategies
Disaster Recovery & Data Backup StrategiesSpiceworks
 
Presentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyyPresentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyyTehmina Gulfam
 

Viewers also liked (20)

Webinar: Backups and Disaster Recovery
Webinar: Backups and Disaster RecoveryWebinar: Backups and Disaster Recovery
Webinar: Backups and Disaster Recovery
 
Backup exec 2015 end user presentation
Backup exec 2015 end user presentationBackup exec 2015 end user presentation
Backup exec 2015 end user presentation
 
Slide presentation storage_craft_backup_disaster_recovery_for_microsoft_syste...
Slide presentation storage_craft_backup_disaster_recovery_for_microsoft_syste...Slide presentation storage_craft_backup_disaster_recovery_for_microsoft_syste...
Slide presentation storage_craft_backup_disaster_recovery_for_microsoft_syste...
 
Information system managment disaster recovery
Information system managment disaster recoveryInformation system managment disaster recovery
Information system managment disaster recovery
 
Webinar: Backups + Disaster Recovery
Webinar: Backups + Disaster RecoveryWebinar: Backups + Disaster Recovery
Webinar: Backups + Disaster Recovery
 
Technologies for Disaster Management
Technologies for Disaster ManagementTechnologies for Disaster Management
Technologies for Disaster Management
 
Top 10 Bad Coding Practices Lead to Security Problems
Top 10 Bad Coding Practices Lead to Security ProblemsTop 10 Bad Coding Practices Lead to Security Problems
Top 10 Bad Coding Practices Lead to Security Problems
 
Webinar: An Enterprise Architect’s View of MongoDB
Webinar: An Enterprise Architect’s View of MongoDBWebinar: An Enterprise Architect’s View of MongoDB
Webinar: An Enterprise Architect’s View of MongoDB
 
MISO L008 Disaster Recovery Plan
MISO L008 Disaster Recovery PlanMISO L008 Disaster Recovery Plan
MISO L008 Disaster Recovery Plan
 
An Introduction to Big Data, NoSQL and MongoDB
An Introduction to Big Data, NoSQL and MongoDBAn Introduction to Big Data, NoSQL and MongoDB
An Introduction to Big Data, NoSQL and MongoDB
 
Database recovery
Database recoveryDatabase recovery
Database recovery
 
03 backup-and-recovery
03 backup-and-recovery03 backup-and-recovery
03 backup-and-recovery
 
Backup And Recovery
Backup And RecoveryBackup And Recovery
Backup And Recovery
 
Resumo ISO 27002
Resumo ISO 27002Resumo ISO 27002
Resumo ISO 27002
 
database recovery techniques
database recovery techniques database recovery techniques
database recovery techniques
 
ISO 22301: The New Standard for Business Continuity Best Practice
ISO 22301: The New Standard for Business Continuity Best PracticeISO 22301: The New Standard for Business Continuity Best Practice
ISO 22301: The New Standard for Business Continuity Best Practice
 
Disaster Recovery Presentation
Disaster Recovery PresentationDisaster Recovery Presentation
Disaster Recovery Presentation
 
Disaster Recovery & Data Backup Strategies
Disaster Recovery & Data Backup StrategiesDisaster Recovery & Data Backup Strategies
Disaster Recovery & Data Backup Strategies
 
Presentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyyPresentation on backup and recoveryyyyyyyyyyyyy
Presentation on backup and recoveryyyyyyyyyyyyy
 
Backup And Recovery
Backup And RecoveryBackup And Recovery
Backup And Recovery
 

Similar to Backup, Restore, and Disaster Recovery

Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryMongoDB
 
MongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL DatabaseMongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL DatabaseFITC
 
Backing up Wikipedia Databases
Backing up Wikipedia DatabasesBacking up Wikipedia Databases
Backing up Wikipedia DatabasesJaime Crespo
 
Deployment Strategy
Deployment StrategyDeployment Strategy
Deployment StrategyMongoDB
 
Back to Basics: Build Something Big With MongoDB
Back to Basics: Build Something Big With MongoDB Back to Basics: Build Something Big With MongoDB
Back to Basics: Build Something Big With MongoDB MongoDB
 
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on CephBuild an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on CephRongze Zhu
 
Evolution of MongoDB Replicaset and Its Best Practices
Evolution of MongoDB Replicaset and Its Best PracticesEvolution of MongoDB Replicaset and Its Best Practices
Evolution of MongoDB Replicaset and Its Best PracticesMydbops
 
Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data
Webinar: MongoDB Management Service (MMS): Session 02 - Backing up DataWebinar: MongoDB Management Service (MMS): Session 02 - Backing up Data
Webinar: MongoDB Management Service (MMS): Session 02 - Backing up DataMongoDB
 
Evolution Of MongoDB Replicaset
Evolution Of MongoDB ReplicasetEvolution Of MongoDB Replicaset
Evolution Of MongoDB ReplicasetM Malai
 
Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryMongoDB
 
The Care + Feeding of a Mongodb Cluster
The Care + Feeding of a Mongodb ClusterThe Care + Feeding of a Mongodb Cluster
The Care + Feeding of a Mongodb ClusterChris Henry
 
Deployment Strategies
Deployment StrategiesDeployment Strategies
Deployment StrategiesMongoDB
 
Back tobasicswebinar part6-rev.
Back tobasicswebinar part6-rev.Back tobasicswebinar part6-rev.
Back tobasicswebinar part6-rev.MongoDB
 
Quick-and-Easy Deployment of a Ceph Storage Cluster
Quick-and-Easy Deployment of a Ceph Storage ClusterQuick-and-Easy Deployment of a Ceph Storage Cluster
Quick-and-Easy Deployment of a Ceph Storage ClusterPatrick Quairoli
 
Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)MongoDB
 
Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...
Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...
Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...MongoDB
 
The Proto-Burst Buffer: Experience with the flash-based file system on SDSC's...
The Proto-Burst Buffer: Experience with the flash-based file system on SDSC's...The Proto-Burst Buffer: Experience with the flash-based file system on SDSC's...
The Proto-Burst Buffer: Experience with the flash-based file system on SDSC's...Glenn K. Lockwood
 
Db2 recovery IDUG EMEA 2013
Db2 recovery IDUG EMEA 2013Db2 recovery IDUG EMEA 2013
Db2 recovery IDUG EMEA 2013Dale McInnis
 
So you want to liberate your data?
So you want to liberate your data?So you want to liberate your data?
So you want to liberate your data?Mogens Heller Grabe
 

Similar to Backup, Restore, and Disaster Recovery (20)

Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster Recovery
 
MongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL DatabaseMongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL Database
 
Backing up Wikipedia Databases
Backing up Wikipedia DatabasesBacking up Wikipedia Databases
Backing up Wikipedia Databases
 
Deployment Strategy
Deployment StrategyDeployment Strategy
Deployment Strategy
 
Back to Basics: Build Something Big With MongoDB
Back to Basics: Build Something Big With MongoDB Back to Basics: Build Something Big With MongoDB
Back to Basics: Build Something Big With MongoDB
 
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on CephBuild an High-Performance and High-Durable Block Storage Service Based on Ceph
Build an High-Performance and High-Durable Block Storage Service Based on Ceph
 
Evolution of MongoDB Replicaset and Its Best Practices
Evolution of MongoDB Replicaset and Its Best PracticesEvolution of MongoDB Replicaset and Its Best Practices
Evolution of MongoDB Replicaset and Its Best Practices
 
Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data
Webinar: MongoDB Management Service (MMS): Session 02 - Backing up DataWebinar: MongoDB Management Service (MMS): Session 02 - Backing up Data
Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data
 
Evolution Of MongoDB Replicaset
Evolution Of MongoDB ReplicasetEvolution Of MongoDB Replicaset
Evolution Of MongoDB Replicaset
 
Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster Recovery
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 
The Care + Feeding of a Mongodb Cluster
The Care + Feeding of a Mongodb ClusterThe Care + Feeding of a Mongodb Cluster
The Care + Feeding of a Mongodb Cluster
 
Deployment Strategies
Deployment StrategiesDeployment Strategies
Deployment Strategies
 
Back tobasicswebinar part6-rev.
Back tobasicswebinar part6-rev.Back tobasicswebinar part6-rev.
Back tobasicswebinar part6-rev.
 
Quick-and-Easy Deployment of a Ceph Storage Cluster
Quick-and-Easy Deployment of a Ceph Storage ClusterQuick-and-Easy Deployment of a Ceph Storage Cluster
Quick-and-Easy Deployment of a Ceph Storage Cluster
 
Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)
 
Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...
Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...
Webinar: Serie Operazioni per la vostra applicazione - Sessione 6 - Installar...
 
The Proto-Burst Buffer: Experience with the flash-based file system on SDSC's...
The Proto-Burst Buffer: Experience with the flash-based file system on SDSC's...The Proto-Burst Buffer: Experience with the flash-based file system on SDSC's...
The Proto-Burst Buffer: Experience with the flash-based file system on SDSC's...
 
Db2 recovery IDUG EMEA 2013
Db2 recovery IDUG EMEA 2013Db2 recovery IDUG EMEA 2013
Db2 recovery IDUG EMEA 2013
 
So you want to liberate your data?
So you want to liberate your data?So you want to liberate your data?
So you want to liberate your data?
 

More from MongoDB

MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump StartMongoDB
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB
 

More from MongoDB (20)

MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
 

Backup, Restore, and Disaster Recovery

  • 1. #MongoDBDays Backup, Restore, and Disaster Recovery James Kerr Senior Solutions Architect, 10gen
  • 2. Agenda • DR Overview • Backup • Restore • Replication • Know your options
  • 5. Sometimes they are our fault
  • 6. DR vs. HA • Don’t confuse the two • Distinctly different business requirements • Technical solutions may converge
  • 7. Recovery Point Objective How much data can you afford to lose?
  • 8. Recovery Time Objective How long can you afford to be off-line?
  • 9. DR Solution Tradeoffs • Complexity increases as RPO approaches zero • Complexity increases as RTO approaches zero
  • 11. What’s the most important thing about making backups? Restoring them
  • 12. If you don't ensure that your backups can be restored, there's no point in doing backups
  • 13. Backup Options • mongodump • Copy files • Snapshot disk
  • 14. mongodump $ mongodump --help Export MongoDB data to BSON files. options: --help produce help message -v [ --verbose ] be more verbose (include multiple times for more verbosity e.g. -vvvvv) --version print the program's version and exit -h [ --host ] arg mongo host to connect to ( /s1,s2 for --port arg server port. Can also use --host hostname -u [ --username ] arg username -p [ --password ] arg password --dbpath arg directly access mongod database files in path, instead of connecting to a mongod needs to lock the data directory, so can if a mongod is currently accessing the s -d [ --db ] arg database to use -c [ --collection ] arg collection to use (some commands) -o [ --out ] arg (=dump)output directory or "-" for stdout -q [ --query ] arg json query --oplog Use oplog for point-in-time snapshotting
  • 15. mongodump • Dumps collections to *.bson files • Mirrors your structure • --db to dump a specific database • --collection to dump a specific collection • --oplog to record oplog while backing up • --query/filter selective dump
  • 16. File System Backups • Must use journaling • Copy /data/db files • Snapshot • Seriously, always use journaling
  • 17. Ensure Consistency • fsyncLock - flush and stop accepting writes • Don't forget to fsyncUnlock
  • 18. File System Backups - Pros and Cons • Entire database • Backup files will be large • Fastest way to create a backup • Fastest way to restore a backup
  • 20. mongorestore • mongorestore • --oplogReplay replay oplog to point-in-time
  • 21. File System Restores • Restore all databases • Restore selected databases
  • 23. Backup Example: Sharded Cluster 1. Stop Balancer (and wait) 2. or no balancing window 3. Stop one config server (data R/O) 4. Backup Data (shards, config) 5. Restart config server 6. Resume Balancer
  • 24. Tips and Tricks • bsondump – inspect data at console • lvm snapshot time/space trade-off – Multi volume backup – clean up snapshots
  • 27. Avoid single point of failure
  • 28. Replica Set Configuration > rs.conf() { "_id" : "replSetName", "version" : 3, "members" : [ { "_id" : 0, "host" : "myhost1.dnsname.com:27017" }, { "_id" : 1, "host" : "myhost2.dnsname.com:27017" }, { "_id" : 2, "host" : "myhost3.dnsname.com:27017" } ]}
  • 29. Avoid single point of failure in replica sets
  • 30. Deploy a Resilient Topology • Redundancy • Multiple Datacenters • Multiple Regions • Delayed Replication • Can support HA and DR requirements – HA by providing intra and inter datacenter failover – DR by creating geographically dispersed copies of data – DR by configuring a delay between the primary and one or more secondaries
  • 32. Choose the Right Tool • RPO on the order of seconds or minutes? – Use Replication • RPO on the order of hours? – Maybe backups will suffice • RTO on the order of seconds or minutes? – Use Replication • RTO on the order of hours or days? – Use backups with warm/cold standby • Need HA and DR?
  • 33. Use Replica Sets Design a topology to support both HA and DR
  • 34. #MongoDBDays Thank You James Kerr Senior Solutions Architect, 10gen

Editor's Notes

  1. Close to 20 years developing software and systemsAcross industries including scientific research, military command and control, e-commerce, telecom, finance and government (intel, DoD and civilian agencies)I’ve spent the last 7 years working with NoSQL databases focusing on delivering solutions for big data problems to the federal and state and local governments
  2. Story about how system is designed for DR but not HA
  3. Business requirements for DR are typically defined in terms of RPO and RTO
  4. The good news is that MongoDB provides a number of tools and features that let you design a solution to meet your needsThe best of which greatly simplifies the solution cases where RPO and RTO are approaching zero
  5. I started this presentation off with an overview of DR because this is probably the most common reason why people do backupsHowever, there may be other business needs for backups Data archival System testing etc.So let’s talk about doing backups in MongoDB
  6. Story about the navy’s failed DR plan for on-ship IT
  7. Obtains a write lock for the duration of the backupShould be run against dedicated/hiddensecondaries in a replica setUse --oplog to ensure a consistent point-in-time backup (PIT is the time that the backup completes)
  8. There are cases where you can do file system backups but…
  9. RPO and RTO on the order of hours
  10. Can be used to recover an individual node or a complete system
  11. So far I’ve covered the standard backup and restore capabilities that you would expect from any enterprise-class databaseThis is all great but what do you really care about? You care that your data stays online and that you don’t loose it.As systems grow to handle the gobs and gobs of data that they do today, it becomes impractical to rely on these brute-force backup procedures to protect their dataSo, while backups may cover the DR requirements for some businesses, many businesses desire much smaller RPOs and RTOs than what backups can provideWhat you really want is to have your data replicated in real time so that you are essentially backing your data up as it changesThis is exactly what MongoDB’s Replication features provide
  12. Drive home the point of backups having very practical limitations in systems dealing with Big Data. IE, how long would it take to do a backup of 100TB?How long would it take to restore that backup?