SlideShare a Scribd company logo
Keeping your data safe

                                   Richard M Kreuter
                                        10gen Inc.
                                   richard@10gen.com


                                   November 1, 2010




Keeping your data safe — webinar
Aspects of data safety




          Replication
                 Cross-data-center replication
                 Application-controlled replication
          Backup
          Disaster recovery




   Keeping your data safe — webinar
Replication




   MongoDB supports automatic replication (data mirroring)
          Recommended for failover, durability, backups (essentially all
          deployments).
          Works well over wide area networks.
          Also good for horizontal read scaling: clients can conditionally
          read from any of a number of slaves.




   Keeping your data safe — webinar
Replication Overview



          MongoDB’s replication is similar to many DB’s.
          Writes are accepted only by a Primary-mode (master,
          writable) mongod.
          Writes are recorded in a normalized format in the operation
          log.
          Secondary-mode (slave, read-only) mongods periodically query
          the oplog and apply operations.




   Keeping your data safe — webinar
Replica set replication
                   Master (write server)




      Slave (read replica)                          Slave (read replica)




                             Slave (read replica)
                                                                                        Old Master




                                                                     Slave (read replica)                Slave (read replica)




                                                                                            New master


   Keeping your data safe — webinar
Replica Set Failover and Invariants



          Replicating mongods track replica set membership.
          If secondaries can’t see the master, but can see a majority of
          replica set votes, an election is induced.
          Election selects exactly one most-recently-written node for
          primary.
          A primary steps down to secondary when it can’t see a
          majority of replica set votes.
          On set reintegration, unreplicated data on old primaries is
          rolled back to offline storage (e.g., for manual intervention).




   Keeping your data safe — webinar
getLastError()



   Data manipulation operations are “fire and forget” by default; that
   is, they return immediately, and don’t wait for any server process.
   The database command getLastError() is the interface for
   forcing operation synchrony:

   db.getLastError() // returns null for "no error",
                     // otherwise, a document containing
                     // an error message




   Keeping your data safe — webinar
getLastError() and write replication




   When running in a replicated configuration, getLastError() can
   also force data writes to replicating slaves:

   // write to 4 servers, timeout after 3 seconds
   db.getLastError({w: 4, wtimeout: 3000})




   Keeping your data safe — webinar
getLastError() and drivers, deployments



   All officially-supported MongoDB drivers have a SafeMode feature
   that implicitly invokes getLastError() after insert, update,
   delete operations. This way, application programmers have
   control over write replication separably from data manipulation
   logic.
   Replica Sets support a getLastErrorDefaults setting, which are
   used whenever a client calls getLastError() without parameters.
   This way, application architects and operations staff can design a
   system whose write replication can be configured independently of
   application code, if desired.




   Keeping your data safe — webinar
Backup strategies




          MongoDB tools (mongoexport, mongodump)
          More generic tools (fs snapshots, file copying commands)
          Storage device features (SAN, EBS snapshots)




   Keeping your data safe — webinar
MongoDB tools


  MongoDB comes with a couple pairs tools for backups
         mongodump & mongorestore — produce/consume BSON
         dumps of database content. Good for making compact
         backups. Note that indexes are reconstructed on
         mongorestore.
         mongoexport & mongoimport — produce/consume
         JSON/CSV text files of database content. More intended for
         cross-software transfers (e.g., transferring data between
         MongoDB and a spreadsheet program), but can be used for
         backup/recovery.




  Keeping your data safe — webinar
Backing up database files



   MongoDB’s data files (under the --dbpath argument) can be
   backed up using any technique available for files:
          File System/Volume Manager snapshots — some OSes’ file
          systems (ZFS, XFS, etc.) and some Volume Managers (e.g.,
          LVM) support point-in-time snapshotting. These snapshots
          can serve as backups.
          Plain ol’ file copying — you can just copy the database’s files
          around.




   Keeping your data safe — webinar
Storage-layer backups




   Some storage devices have snapshotting features; you can use
   these snapshots as backups
          Commercial SANs often have point-in-time block-level
          snapshotting.
          Amazon’s EBS supports snapshotting (but they recommend
          unmounting the EBS volumes to quiesce the data).




   Keeping your data safe — webinar
Locking the database for backups

   All backup strategies can, in principle, be performed on a live
   (a.k.a. “hot”) database, but with varying levels of efficacy. To
   ensure a clean backup, it’s recommended that you lock the
   database for the duration of your backup procedure.

   > use admin
   switched to db admin
   > db.runCommand({fsync:1,lock:1})
   // now use mongodump/snapshotting/etc., and then
   > db.$cmd.sys.unlock.findOne();

   In general, this procedure is best performed on replicating
   secondaries, which don’t accept writes.


   Keeping your data safe — webinar
Disaster Recovery
   The general solution for recovering a failed server is as follows:
    1 Repair/replace any failed hardware or operating system layers

       (e.g., replace disks, provision new hosts or virtual machines,
       etc.)
    2 If step 1 completes quickly enough and its data directory is

       trustworthy (e.g., if the mongod was cleanly shut down, say,
       after a UPS-induced system halt), bring the mongod online
       and it will attempt to replay the replica set’s primary’s oplog.
    3 If the data directory is suspect, you can move it aside or

       delete it, and then
             1   Either bring up the mongod with an empty data directory, in
                 which case it will clone the primary’s databases ...
             2   ... or else seed the mongod’s data directory with a recent
                 snapshot or mongodump backup.
      4   The mongod will attempt to replay all the primary’s oplog
          records.
   Keeping your data safe — webinar
Some aspects of disaster recovery

          Cloning the primary can impose notable load on the primary,
          so it’s probably prefarable to initialize a new secondary from a
          snapshot or a database dump.
          If you operate in multiple data centers, it’s advisable to try to
          keep snapshots/database backups “nearby” in data center
          space to avoid having to transfer large amounts of data during
          disaster recorvery events. For example, you might make
          periodic snapshots/backups of a secondary in each of your
          data centers, and use these for initializing new secondaries.
          It can occur that the primary’s oplog “rolls over” before a
          recovering secondary catches up. See
          http://www.mongodb.org/display/DOCS/Halted+Replication
          for more details.
          In general, avoiding a disaster is better than recovering from
          one. Employ monitoring tools!
   Keeping your data safe — webinar

More Related Content

What's hot

data deduplication
data deduplicationdata deduplication
data deduplication
ssuser1eca7d
 
Distributed file systems (from Google)
Distributed file systems (from Google)Distributed file systems (from Google)
Distributed file systems (from Google)
Sri Prasanna
 
Linux Kernel Init Process
Linux Kernel Init ProcessLinux Kernel Init Process
Linux Kernel Init Process
Kernel TLV
 
Database Replication
Database ReplicationDatabase Replication
Database Replication
Vatroslav Mileusnić
 
Storage Management using LVM
Storage Management using LVMStorage Management using LVM
Storage Management using LVM
Priyank Kapadia
 
Multiple processor (ppt 2010)
Multiple processor (ppt 2010)Multiple processor (ppt 2010)
Multiple processor (ppt 2010)
Arth Ramada
 
Linux con europe_2014_f
Linux con europe_2014_fLinux con europe_2014_f
Linux con europe_2014_f
sprdd
 
Operating System
Operating SystemOperating System
Operating System
Subhasis Dash
 
CPU Caches
CPU CachesCPU Caches
CPU Caches
shinolajla
 
Modern CPUs and Caches - A Starting Point for Programmers
Modern CPUs and Caches - A Starting Point for ProgrammersModern CPUs and Caches - A Starting Point for Programmers
Modern CPUs and Caches - A Starting Point for Programmers
Yaser Zhian
 
OS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switchOS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switch
Daniel Ben-Zvi
 
Process management in os
Process management in osProcess management in os
Process management in os
Miong Lazaro
 
MYSQLDUMP & ZRM COMMUNITY (EN)
MYSQLDUMP & ZRM COMMUNITY (EN)MYSQLDUMP & ZRM COMMUNITY (EN)
MYSQLDUMP & ZRM COMMUNITY (EN)
Cédric P
 
JP Morgan Remote to Core Implementation
JP Morgan Remote to Core ImplementationJP Morgan Remote to Core Implementation
JP Morgan Remote to Core Implementation
John Napier
 
Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)
Gerard Braad
 
First steps on CentOs7
First steps on CentOs7First steps on CentOs7
First steps on CentOs7
Marc Cortinas Val
 
Process and Threads in Linux - PPT
Process and Threads in Linux - PPTProcess and Threads in Linux - PPT
Process and Threads in Linux - PPT
QUONTRASOLUTIONS
 
Cache memory
Cache memoryCache memory
Cache memory
Anuj Modi
 
Cache design
Cache design Cache design
Cache design
maamir farooq
 
Operating system - Process and its concepts
Operating system - Process and its conceptsOperating system - Process and its concepts
Operating system - Process and its concepts
Karan Thakkar
 

What's hot (20)

data deduplication
data deduplicationdata deduplication
data deduplication
 
Distributed file systems (from Google)
Distributed file systems (from Google)Distributed file systems (from Google)
Distributed file systems (from Google)
 
Linux Kernel Init Process
Linux Kernel Init ProcessLinux Kernel Init Process
Linux Kernel Init Process
 
Database Replication
Database ReplicationDatabase Replication
Database Replication
 
Storage Management using LVM
Storage Management using LVMStorage Management using LVM
Storage Management using LVM
 
Multiple processor (ppt 2010)
Multiple processor (ppt 2010)Multiple processor (ppt 2010)
Multiple processor (ppt 2010)
 
Linux con europe_2014_f
Linux con europe_2014_fLinux con europe_2014_f
Linux con europe_2014_f
 
Operating System
Operating SystemOperating System
Operating System
 
CPU Caches
CPU CachesCPU Caches
CPU Caches
 
Modern CPUs and Caches - A Starting Point for Programmers
Modern CPUs and Caches - A Starting Point for ProgrammersModern CPUs and Caches - A Starting Point for Programmers
Modern CPUs and Caches - A Starting Point for Programmers
 
OS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switchOS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switch
 
Process management in os
Process management in osProcess management in os
Process management in os
 
MYSQLDUMP & ZRM COMMUNITY (EN)
MYSQLDUMP & ZRM COMMUNITY (EN)MYSQLDUMP & ZRM COMMUNITY (EN)
MYSQLDUMP & ZRM COMMUNITY (EN)
 
JP Morgan Remote to Core Implementation
JP Morgan Remote to Core ImplementationJP Morgan Remote to Core Implementation
JP Morgan Remote to Core Implementation
 
Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)Inspection and maintenance tools (Linux / OpenStack)
Inspection and maintenance tools (Linux / OpenStack)
 
First steps on CentOs7
First steps on CentOs7First steps on CentOs7
First steps on CentOs7
 
Process and Threads in Linux - PPT
Process and Threads in Linux - PPTProcess and Threads in Linux - PPT
Process and Threads in Linux - PPT
 
Cache memory
Cache memoryCache memory
Cache memory
 
Cache design
Cache design Cache design
Cache design
 
Operating system - Process and its concepts
Operating system - Process and its conceptsOperating system - Process and its concepts
Operating system - Process and its concepts
 

Viewers also liked

2011 mongo sf-sharding
2011 mongo sf-sharding2011 mongo sf-sharding
2011 mongo sf-sharding
MongoDB
 
Modeling for Performance
Modeling for PerformanceModeling for Performance
Modeling for Performance
MongoDB
 
Morning with MongoDB Paris 2012 - Making Big Data Small
Morning with MongoDB Paris 2012 - Making Big Data SmallMorning with MongoDB Paris 2012 - Making Big Data Small
Morning with MongoDB Paris 2012 - Making Big Data Small
MongoDB
 
Schema design short
Schema design shortSchema design short
Schema design short
MongoDB
 
Building a Mongo DSL in Scala at Hot Potato
Building a Mongo DSL in Scala at Hot PotatoBuilding a Mongo DSL in Scala at Hot Potato
Building a Mongo DSL in Scala at Hot Potato
MongoDB
 
Indexing and Query Optimizer
Indexing and Query OptimizerIndexing and Query Optimizer
Indexing and Query Optimizer
MongoDB
 
Mongo Berlin - Mastering the Shell
Mongo Berlin - Mastering the ShellMongo Berlin - Mastering the Shell
Mongo Berlin - Mastering the Shell
MongoDB
 
Schema Design
Schema DesignSchema Design
Schema Design
MongoDB
 
Securing Data in MongoDB with Gazzang and Chef
Securing Data in MongoDB with Gazzang and ChefSecuring Data in MongoDB with Gazzang and Chef
Securing Data in MongoDB with Gazzang and Chef
MongoDB
 
Indexing and Query Optimizer (Richard Kreuter)
Indexing and Query Optimizer (Richard Kreuter)Indexing and Query Optimizer (Richard Kreuter)
Indexing and Query Optimizer (Richard Kreuter)
MongoDB
 

Viewers also liked (10)

2011 mongo sf-sharding
2011 mongo sf-sharding2011 mongo sf-sharding
2011 mongo sf-sharding
 
Modeling for Performance
Modeling for PerformanceModeling for Performance
Modeling for Performance
 
Morning with MongoDB Paris 2012 - Making Big Data Small
Morning with MongoDB Paris 2012 - Making Big Data SmallMorning with MongoDB Paris 2012 - Making Big Data Small
Morning with MongoDB Paris 2012 - Making Big Data Small
 
Schema design short
Schema design shortSchema design short
Schema design short
 
Building a Mongo DSL in Scala at Hot Potato
Building a Mongo DSL in Scala at Hot PotatoBuilding a Mongo DSL in Scala at Hot Potato
Building a Mongo DSL in Scala at Hot Potato
 
Indexing and Query Optimizer
Indexing and Query OptimizerIndexing and Query Optimizer
Indexing and Query Optimizer
 
Mongo Berlin - Mastering the Shell
Mongo Berlin - Mastering the ShellMongo Berlin - Mastering the Shell
Mongo Berlin - Mastering the Shell
 
Schema Design
Schema DesignSchema Design
Schema Design
 
Securing Data in MongoDB with Gazzang and Chef
Securing Data in MongoDB with Gazzang and ChefSecuring Data in MongoDB with Gazzang and Chef
Securing Data in MongoDB with Gazzang and Chef
 
Indexing and Query Optimizer (Richard Kreuter)
Indexing and Query Optimizer (Richard Kreuter)Indexing and Query Optimizer (Richard Kreuter)
Indexing and Query Optimizer (Richard Kreuter)
 

Similar to Keeping data-safe-webinar-2010-11-01

Testing Delphix: easy data virtualization
Testing Delphix: easy data virtualizationTesting Delphix: easy data virtualization
Testing Delphix: easy data virtualization
Franck Pachot
 
Clustered PHP - DC PHP 2009
Clustered PHP - DC PHP 2009Clustered PHP - DC PHP 2009
Clustered PHP - DC PHP 2009
marcelesser
 
NetApp against ransomware
NetApp against ransomwareNetApp against ransomware
NetApp against ransomware
Damien Berezenko
 
Lock, Stock and Backup: Data Guaranteed
Lock, Stock and Backup: Data GuaranteedLock, Stock and Backup: Data Guaranteed
Lock, Stock and Backup: Data Guaranteed
Jervin Real
 
snapshot vs backup
snapshot vs backupsnapshot vs backup
snapshot vs backup
ssuser1eca7d
 
Talon systems - Distributed multi master replication strategy
Talon systems - Distributed multi master replication strategyTalon systems - Distributed multi master replication strategy
Talon systems - Distributed multi master replication strategy
Saptarshi Chatterjee
 
Database architectureby howard
Database architectureby howardDatabase architectureby howard
Database architectureby howard
oracle documents
 
Fast Start Failover DataGuard
Fast Start Failover DataGuardFast Start Failover DataGuard
Fast Start Failover DataGuard
Borsaniya Vaibhav
 
High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2
Mario Redón Luz
 
Oaklands college: Protecting your data.
Oaklands college: Protecting your data.Oaklands college: Protecting your data.
Oaklands college: Protecting your data.
JISC RSC Eastern
 
Must Read HP Data Protector Interview Questions
Must Read HP Data Protector Interview QuestionsMust Read HP Data Protector Interview Questions
Must Read HP Data Protector Interview Questions
Laxman J
 
Collaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryCollaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mystery
Nelson Calero
 
MongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of viewMongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of view
Pierre Baillet
 
RDS for MySQL, No BS Operations and Patterns
RDS for MySQL, No BS Operations and PatternsRDS for MySQL, No BS Operations and Patterns
RDS for MySQL, No BS Operations and Patterns
Laine Campbell
 
Champion Fas Deduplication
Champion Fas DeduplicationChampion Fas Deduplication
Champion Fas Deduplication
Michael Hudak
 
SPFS - A filesystem for Spectrum Protect
SPFS - A filesystem for Spectrum ProtectSPFS - A filesystem for Spectrum Protect
SPFS - A filesystem for Spectrum Protect
tdalebjork
 
SPFS - A filesystem for Spectrum Protect
SPFS - A filesystem for Spectrum ProtectSPFS - A filesystem for Spectrum Protect
SPFS - A filesystem for Spectrum Protect
tdalebjork
 
Oracle11g notes
Oracle11g notesOracle11g notes
Oracle11g notes
Manish Mudhliyar
 
Backing up Wikipedia Databases
Backing up Wikipedia DatabasesBacking up Wikipedia Databases
Backing up Wikipedia Databases
Jaime Crespo
 
Data Guard25 August
Data Guard25 AugustData Guard25 August
Data Guard25 August
Guenadi JILEVSKI
 

Similar to Keeping data-safe-webinar-2010-11-01 (20)

Testing Delphix: easy data virtualization
Testing Delphix: easy data virtualizationTesting Delphix: easy data virtualization
Testing Delphix: easy data virtualization
 
Clustered PHP - DC PHP 2009
Clustered PHP - DC PHP 2009Clustered PHP - DC PHP 2009
Clustered PHP - DC PHP 2009
 
NetApp against ransomware
NetApp against ransomwareNetApp against ransomware
NetApp against ransomware
 
Lock, Stock and Backup: Data Guaranteed
Lock, Stock and Backup: Data GuaranteedLock, Stock and Backup: Data Guaranteed
Lock, Stock and Backup: Data Guaranteed
 
snapshot vs backup
snapshot vs backupsnapshot vs backup
snapshot vs backup
 
Talon systems - Distributed multi master replication strategy
Talon systems - Distributed multi master replication strategyTalon systems - Distributed multi master replication strategy
Talon systems - Distributed multi master replication strategy
 
Database architectureby howard
Database architectureby howardDatabase architectureby howard
Database architectureby howard
 
Fast Start Failover DataGuard
Fast Start Failover DataGuardFast Start Failover DataGuard
Fast Start Failover DataGuard
 
High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2
 
Oaklands college: Protecting your data.
Oaklands college: Protecting your data.Oaklands college: Protecting your data.
Oaklands college: Protecting your data.
 
Must Read HP Data Protector Interview Questions
Must Read HP Data Protector Interview QuestionsMust Read HP Data Protector Interview Questions
Must Read HP Data Protector Interview Questions
 
Collaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryCollaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mystery
 
MongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of viewMongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of view
 
RDS for MySQL, No BS Operations and Patterns
RDS for MySQL, No BS Operations and PatternsRDS for MySQL, No BS Operations and Patterns
RDS for MySQL, No BS Operations and Patterns
 
Champion Fas Deduplication
Champion Fas DeduplicationChampion Fas Deduplication
Champion Fas Deduplication
 
SPFS - A filesystem for Spectrum Protect
SPFS - A filesystem for Spectrum ProtectSPFS - A filesystem for Spectrum Protect
SPFS - A filesystem for Spectrum Protect
 
SPFS - A filesystem for Spectrum Protect
SPFS - A filesystem for Spectrum ProtectSPFS - A filesystem for Spectrum Protect
SPFS - A filesystem for Spectrum Protect
 
Oracle11g notes
Oracle11g notesOracle11g notes
Oracle11g notes
 
Backing up Wikipedia Databases
Backing up Wikipedia DatabasesBacking up Wikipedia Databases
Backing up Wikipedia Databases
 
Data Guard25 August
Data Guard25 AugustData Guard25 August
Data Guard25 August
 

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 Atlas
MongoDB
 
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 MongoDB
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
 
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
 
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
 
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.2
MongoDB
 
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 Mindset
MongoDB
 
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
 
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 Dive
MongoDB
 
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
 
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...
 

Recently uploaded

HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
BibashShahi
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
Edge AI and Vision Alliance
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 

Recently uploaded (20)

HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 

Keeping data-safe-webinar-2010-11-01

  • 1. Keeping your data safe Richard M Kreuter 10gen Inc. richard@10gen.com November 1, 2010 Keeping your data safe — webinar
  • 2. Aspects of data safety Replication Cross-data-center replication Application-controlled replication Backup Disaster recovery Keeping your data safe — webinar
  • 3. Replication MongoDB supports automatic replication (data mirroring) Recommended for failover, durability, backups (essentially all deployments). Works well over wide area networks. Also good for horizontal read scaling: clients can conditionally read from any of a number of slaves. Keeping your data safe — webinar
  • 4. Replication Overview MongoDB’s replication is similar to many DB’s. Writes are accepted only by a Primary-mode (master, writable) mongod. Writes are recorded in a normalized format in the operation log. Secondary-mode (slave, read-only) mongods periodically query the oplog and apply operations. Keeping your data safe — webinar
  • 5. Replica set replication Master (write server) Slave (read replica) Slave (read replica) Slave (read replica) Old Master Slave (read replica) Slave (read replica) New master Keeping your data safe — webinar
  • 6. Replica Set Failover and Invariants Replicating mongods track replica set membership. If secondaries can’t see the master, but can see a majority of replica set votes, an election is induced. Election selects exactly one most-recently-written node for primary. A primary steps down to secondary when it can’t see a majority of replica set votes. On set reintegration, unreplicated data on old primaries is rolled back to offline storage (e.g., for manual intervention). Keeping your data safe — webinar
  • 7. getLastError() Data manipulation operations are “fire and forget” by default; that is, they return immediately, and don’t wait for any server process. The database command getLastError() is the interface for forcing operation synchrony: db.getLastError() // returns null for "no error", // otherwise, a document containing // an error message Keeping your data safe — webinar
  • 8. getLastError() and write replication When running in a replicated configuration, getLastError() can also force data writes to replicating slaves: // write to 4 servers, timeout after 3 seconds db.getLastError({w: 4, wtimeout: 3000}) Keeping your data safe — webinar
  • 9. getLastError() and drivers, deployments All officially-supported MongoDB drivers have a SafeMode feature that implicitly invokes getLastError() after insert, update, delete operations. This way, application programmers have control over write replication separably from data manipulation logic. Replica Sets support a getLastErrorDefaults setting, which are used whenever a client calls getLastError() without parameters. This way, application architects and operations staff can design a system whose write replication can be configured independently of application code, if desired. Keeping your data safe — webinar
  • 10. Backup strategies MongoDB tools (mongoexport, mongodump) More generic tools (fs snapshots, file copying commands) Storage device features (SAN, EBS snapshots) Keeping your data safe — webinar
  • 11. MongoDB tools MongoDB comes with a couple pairs tools for backups mongodump & mongorestore — produce/consume BSON dumps of database content. Good for making compact backups. Note that indexes are reconstructed on mongorestore. mongoexport & mongoimport — produce/consume JSON/CSV text files of database content. More intended for cross-software transfers (e.g., transferring data between MongoDB and a spreadsheet program), but can be used for backup/recovery. Keeping your data safe — webinar
  • 12. Backing up database files MongoDB’s data files (under the --dbpath argument) can be backed up using any technique available for files: File System/Volume Manager snapshots — some OSes’ file systems (ZFS, XFS, etc.) and some Volume Managers (e.g., LVM) support point-in-time snapshotting. These snapshots can serve as backups. Plain ol’ file copying — you can just copy the database’s files around. Keeping your data safe — webinar
  • 13. Storage-layer backups Some storage devices have snapshotting features; you can use these snapshots as backups Commercial SANs often have point-in-time block-level snapshotting. Amazon’s EBS supports snapshotting (but they recommend unmounting the EBS volumes to quiesce the data). Keeping your data safe — webinar
  • 14. Locking the database for backups All backup strategies can, in principle, be performed on a live (a.k.a. “hot”) database, but with varying levels of efficacy. To ensure a clean backup, it’s recommended that you lock the database for the duration of your backup procedure. > use admin switched to db admin > db.runCommand({fsync:1,lock:1}) // now use mongodump/snapshotting/etc., and then > db.$cmd.sys.unlock.findOne(); In general, this procedure is best performed on replicating secondaries, which don’t accept writes. Keeping your data safe — webinar
  • 15. Disaster Recovery The general solution for recovering a failed server is as follows: 1 Repair/replace any failed hardware or operating system layers (e.g., replace disks, provision new hosts or virtual machines, etc.) 2 If step 1 completes quickly enough and its data directory is trustworthy (e.g., if the mongod was cleanly shut down, say, after a UPS-induced system halt), bring the mongod online and it will attempt to replay the replica set’s primary’s oplog. 3 If the data directory is suspect, you can move it aside or delete it, and then 1 Either bring up the mongod with an empty data directory, in which case it will clone the primary’s databases ... 2 ... or else seed the mongod’s data directory with a recent snapshot or mongodump backup. 4 The mongod will attempt to replay all the primary’s oplog records. Keeping your data safe — webinar
  • 16. Some aspects of disaster recovery Cloning the primary can impose notable load on the primary, so it’s probably prefarable to initialize a new secondary from a snapshot or a database dump. If you operate in multiple data centers, it’s advisable to try to keep snapshots/database backups “nearby” in data center space to avoid having to transfer large amounts of data during disaster recorvery events. For example, you might make periodic snapshots/backups of a secondary in each of your data centers, and use these for initializing new secondaries. It can occur that the primary’s oplog “rolls over” before a recovering secondary catches up. See http://www.mongodb.org/display/DOCS/Halted+Replication for more details. In general, avoiding a disaster is better than recovering from one. Employ monitoring tools! Keeping your data safe — webinar