Successfully reported this slideshow.
Senior Solution Architect, MongoDB
Sam Weaver
#MongoDBMangementService
MongoDB Backup
Overview
Agenda
• Recap the need for backup
• Cover methods for backing up MongoDB
• Introduce MMS Backup
• Walkthrough
Disasters do happen
and sometimes they are our fault
• Risks
– Storage failure
– Power outage
– Programmer error
– Hardware failure
– Data centre failure
– Cyber attack
• Stor...
• Relative to any particular risk
– How much data can you afford to lose? (RPO)
– How long can you afford to be offline? (...
Replication
• Built into MongoDB, only ops and
infrastructure cost
• Very little to zero data loss in failure
• Down for a...
Application Engineering
• Flexible
• Expensive, time and money
• Good use of engineer?
Backup
• Slower to restore
• Can suffer from being out of date
• Fairly cheap
• Isolated
• Covers most risks
• Mongodump/mongorestore
• Storage level options
• MongoDB Backup Service
Backup Approaches
• Can be run online or offline
• Oplog aware for point in time restores
• Filter in, filter out
• Considerations
– Data si...
• Copy files in your data directory (e.g.
/data/db)
• File system or block storage snapshots
• Fastest way to backup/resto...
Using the MongoDB Management Service
(MMS) for Backup
How it Works
Overview
• From the initial sync, we rebuild your data in
our datacenters and take a snapshot
• We take snapshots every 6 hours
• O...
Once your agents are up...
Once your agents are up...
• Choose which replica sets to enable backup
on
• Choose which collections/namespaces to
includ...
potential choices (select the snapshot you’d like to restore to)
Snapshot screens
Click the “restore this snapshot” ,
select the delivery method, and
complete these fields
Notes: one time link means one
t...
confirm your 2FA
fun!
get your restore ID
if you check the status on the job, there will now be a http link available.. This will
download a tar.gz file to your com...
• Create a dbpath for the MongoDB data files
• Create a symbolic link pointing to the data files or
create the database pa...
Restoring Sharded Clusters
• Balancer paused every 6 hours
• A no-op token is inserted across all shards and
config server...
Click your cluster (in blue font)
You can select a snapshot to restore from OR you can take the way more fun route to restore from
a checkpoint. Click “rest...
here is a list of all the restore
cluster checkpoints for your
sharded cluster. You can select
one of these points in time...
• You will receive one data file to download for
each shard
• And one for the config server(s)
• Same process as before fo...
Mongodump File system MMS Backup
Initial complexity Medium High Low
Confidence in Backups Medium Medium High
Point in time...
Key Benefits
Point in Time
• Oplog stored for 48 hours
• Restore your replica set to any point-in-time in
the last 24 hours by creating...
Snapshot Policy
• Every 6 hours for 48 hours
• Every day for 1 week
• Every week for for a month
• Every month for a year
...
Easy to Restore
• Pull from custom URL via HTTPS
– One time link that expires when used
• Push via SCP
– Just enter the ho...
Unlimited Restores
• Confidence in your restore process
• Build development, QA, analytics environments
without impacting ...
Fully Managed
• Created by the engineers that build MongoDB
• No need to write or maintain custom backup
scripts
Getting Started
Getting Started
1. Create an account at mms.mongodb.com
2. Install MMS Monitoring on your deployment
3. Register at mms.mo...
Restore from a point in time snapshot documentation
https://mms.mongodb.com/help/tutorial/restore-from-point-in-time-snaps...
mms-sales@mongodb.com for one
month free!
Questions?
Senior Solution Architect, MongoDB
Sam Weaver
#MongoDBMagementService
Thank You
Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data
Upcoming SlideShare
Loading in …5
×

Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

971 views

Published on

In this session we will cover how MMS can be used to backup and restore your data from MongoDB. We will cover backing up both replica sets and sharded environments, and discuss how to do point-in-time restores and restoring from snapshots.

Presented by, Sam Weaver:
Sam Weaver is a Senior Solution Architect at MongoDB based in London. Prior to MongoDB, he worked at Red Hat doing technical pre-sales on the product portfolio including Linux, Virtualisation and Middleware. Originally from Cheltenham, England he received his Bachelors from Cardiff University and currently lives in Camberley, Surrey.

Visit www.mongodb.com/presentations to view other presentations in this series and many other topics.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Webinar: MongoDB Management Service (MMS): Session 02 - Backing up Data

  1. 1. Senior Solution Architect, MongoDB Sam Weaver #MongoDBMangementService MongoDB Backup Overview
  2. 2. Agenda • Recap the need for backup • Cover methods for backing up MongoDB • Introduce MMS Backup • Walkthrough
  3. 3. Disasters do happen
  4. 4. and sometimes they are our fault
  5. 5. • Risks – Storage failure – Power outage – Programmer error – Hardware failure – Data centre failure – Cyber attack • Storage level options • MongoDB Backup Service Availability and Durability
  6. 6. • Relative to any particular risk – How much data can you afford to lose? (RPO) – How long can you afford to be offline? (RTO) – What price are you willing to pay to remove the risk? • Solutions – Replication – Application engineering? – Backup Addressing Risks
  7. 7. Replication • Built into MongoDB, only ops and infrastructure cost • Very little to zero data loss in failure • Down for a very short interval • BUT… programmer errors will replicate almost instantly
  8. 8. Application Engineering • Flexible • Expensive, time and money • Good use of engineer?
  9. 9. Backup • Slower to restore • Can suffer from being out of date • Fairly cheap • Isolated • Covers most risks
  10. 10. • Mongodump/mongorestore • Storage level options • MongoDB Backup Service Backup Approaches
  11. 11. • Can be run online or offline • Oplog aware for point in time restores • Filter in, filter out • Considerations – Data size – Sharding Mongodump/MongoRestore
  12. 12. • Copy files in your data directory (e.g. /data/db) • File system or block storage snapshots • Fastest way to backup/restore • Considerations – Journal – Consistency – Backup granularity (whole file system back up?) – Ops expertise – Storage of snapshots or data file backups Storage-level Backups
  13. 13. Using the MongoDB Management Service (MMS) for Backup
  14. 14. How it Works
  15. 15. Overview
  16. 16. • From the initial sync, we rebuild your data in our datacenters and take a snapshot • We take snapshots every 6 hours • Oplog is stored for 48 hours to enable 24 hour Point-in-time restores Under the Hood
  17. 17. Once your agents are up...
  18. 18. Once your agents are up... • Choose which replica sets to enable backup on • Choose which collections/namespaces to include/exclude • An initial sync is taken of your data • Edit snapshot policy
  19. 19. potential choices (select the snapshot you’d like to restore to) Snapshot screens
  20. 20. Click the “restore this snapshot” , select the delivery method, and complete these fields Notes: one time link means one time link and no it will never work again and no you cannot email it round and it will work for someone else etc
  21. 21. confirm your 2FA fun! get your restore ID
  22. 22. if you check the status on the job, there will now be a http link available.. This will download a tar.gz file to your computer.
  23. 23. • Create a dbpath for the MongoDB data files • Create a symbolic link pointing to the data files or create the database path and migrate the data files ln -s <hash-snapshot-name> /data/db • Start a mongod using your new data directory as the dbpath mongod --dbpath /location/of/data Download the data files
  24. 24. Restoring Sharded Clusters • Balancer paused every 6 hours • A no-op token is inserted across all shards and config servers • Oplog applied to replica sets until point in which token was inserted • Provides a consistent state of database across shards
  25. 25. Click your cluster (in blue font)
  26. 26. You can select a snapshot to restore from OR you can take the way more fun route to restore from a checkpoint. Click “restore!”
  27. 27. here is a list of all the restore cluster checkpoints for your sharded cluster. You can select one of these points in time. This is the slower option, since MMS will then rebuild a snapshot up until the time you’ve entered. Depending on retention settings the window of time available to select from will be limited.
  28. 28. • You will receive one data file to download for each shard • And one for the config server(s) • Same process as before for moving the data files to the server Restoring Sharded Clusters
  29. 29. Mongodump File system MMS Backup Initial complexity Medium High Low Confidence in Backups Medium Medium High Point in time recovery of replica set Sort of ☺ No Yes System Overhead High Can be low Low Scalable No With work Yes Consistent Snapshot of Sharded System Difficult Difficult Yes Recovery Approaches
  30. 30. Key Benefits
  31. 31. Point in Time • Oplog stored for 48 hours • Restore your replica set to any point-in-time in the last 24 hours by creating a custom snapshot • Configurable!
  32. 32. Snapshot Policy • Every 6 hours for 48 hours • Every day for 1 week • Every week for for a month • Every month for a year • Configurable!
  33. 33. Easy to Restore • Pull from custom URL via HTTPS – One time link that expires when used • Push via SCP – Just enter the hostname and auth method (password or key file) – The directory to push the data to
  34. 34. Unlimited Restores • Confidence in your restore process • Build development, QA, analytics environments without impacting production
  35. 35. Fully Managed • Created by the engineers that build MongoDB • No need to write or maintain custom backup scripts
  36. 36. Getting Started
  37. 37. Getting Started 1. Create an account at mms.mongodb.com 2. Install MMS Monitoring on your deployment 3. Register at mms.mongodb.com/backup 4. Install MMS Backup on your deployment 5. Start initial sync 6. Rest easy!
  38. 38. Restore from a point in time snapshot documentation https://mms.mongodb.com/help/tutorial/restore-from-point-in-time-snapshot/ Restore from a stored snapshot https://mms.mongodb.com/help/tutorial/restore-from-snapshot/ Configure your backup data delivery method https://mms.mongodb.com/help/tutorial/restore- select-delivery-format/ All documentation available: http://mms.mongodb.com/help/ Getting Started
  39. 39. mms-sales@mongodb.com for one month free!
  40. 40. Questions?
  41. 41. Senior Solution Architect, MongoDB Sam Weaver #MongoDBMagementService Thank You

×