run mongodb with confidence: backing up and monitoring with mms
TRANSCRIPT
![Page 1: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/1.jpg)
MongoDB Backup and Monitoring with MMS
Sam Weaver, Senior Solution Architect
#MongoDBWorld
![Page 2: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/2.jpg)
Operational complexities
![Page 3: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/3.jpg)
What is MMS?
![Page 4: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/4.jpg)
What is MMS?
![Page 5: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/5.jpg)
The MMS User Interface
Navigation tabs take you to the different functional areas of MongoDB Management Service. Through this interface, you can monitor your deployment, configure alerts via email or SMS, backup your data and automate your deployments.
![Page 6: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/6.jpg)
Monitoring
![Page 7: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/7.jpg)
Monitoring
MMS monitors deployments through a monitoring agent installed on a host server. One agent can:
• Identify the members of the deployment and server configuration, MongoDB Version, query profile, logs, etc.
• Dynamically create a graphical representation of the deployment technology.
• Visualize performance indications like lock percentage, reads/writes, queues, etc.
• Enable you to configure alerts for when these numbers aren’t “normal”
![Page 8: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/8.jpg)
Topology view
![Page 9: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/9.jpg)
Charting
![Page 10: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/10.jpg)
Alerting
![Page 11: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/11.jpg)
• Set a base line for normal by seeing how your production environment responds to regular traffic
• Check for spikes in operations – peak or unexpected load?
What’s “normal”?
![Page 12: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/12.jpg)
=Key performance indicators
• Page faults, queues and lock % may be indicators that you need to scale up or out
• Oplog window indicates how long a secondary can be behind the primary
• Background average flush indicates if your disks are struggling
![Page 13: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/13.jpg)
Monitoring
Additionally, MongoDB offers Proactive Support for Subscription Customers, where our engineers are able to monitor your deployment and make suggestions in order to tweak for better performance or avoid doom.
![Page 14: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/14.jpg)
Backup
![Page 15: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/15.jpg)
Disasters are not only due to user error...
![Page 16: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/16.jpg)
There’s many other causes of disasters
![Page 17: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/17.jpg)
34% of companies fail to test their tape backups
![Page 18: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/18.jpg)
77% of those that did, found failures
![Page 19: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/19.jpg)
60% of companies that lost their data…
![Page 20: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/20.jpg)
Closed business within 6 months
![Page 21: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/21.jpg)
140,000 HDD crashes per week in the US
![Page 22: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/22.jpg)
93% of those who lost their DC for 10 days…
![Page 23: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/23.jpg)
Filed for bankruptcy within 1 year
![Page 24: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/24.jpg)
Risks Are All Around
• Risks– Storage failure– Power outage– Programmer error– Hardware failure– Data center failure– Cyber attack– Weather related incidents
![Page 25: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/25.jpg)
• 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?
• MongoDB Solutions– Replication– Application and Infrastructure engineering– Backup of your Data
Analyzing your Risk Tolerance
![Page 26: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/26.jpg)
Our Recommendations for Avoiding Risk
![Page 27: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/27.jpg)
Solution 1: Replication
• Built into MongoDB, only ops and infrastructure cost
• Tunable durability gives you very little to zero risk in case of failure
• Down for a very short interval
• BUT… programmer errors will replicate almost instantly
![Page 28: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/28.jpg)
Solution 2: Application and Infrastructure Engineering
Lots of potential solutions to ensure redundancy in applications and their infrastructure, such as:
• Having more than one data center
• Spreading across AWS zones
![Page 29: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/29.jpg)
Solution 3: Backup Your Data
Backup of your data is one way to assure availability and lower risk. Keep in mind, backups:
• Can suffer from being out of date
• Can be slow
• Isolated
• ...but usually cheap and covers most risks
![Page 30: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/30.jpg)
• mongodump/mongorestore
• Storage level options
• MongoDB Backup Service
Comparing MongoDB Backup Approaches
![Page 31: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/31.jpg)
• Can be run online or offline
• Oplog aware for point in time restores
• Filter in, filter out
• Considerations:– Data size– Sharding
Mongodump/MongoRestore
![Page 32: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/32.jpg)
• 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
![Page 33: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/33.jpg)
● Possible in the cloud (via mms.mongodb.com) or in your own hosted environment
● Available on a variety of operating systems (Examples - RHEL, Ubuntu, CentOS, OS X, Windows)
Backup with MongoDB Management Service
![Page 34: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/34.jpg)
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
MongoDB Backup Recovery Approaches
![Page 35: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/35.jpg)
MongoDB Backup with MMSHow it Works
![Page 36: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/36.jpg)
• Access the MMS UI • Install the Backup Agent onto one server• Select the replica sets or cluster you
want to back up• Click the Start button
Backup with MongoDB Management Service
![Page 37: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/37.jpg)
System Architecture
![Page 38: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/38.jpg)
The Web Interface
![Page 39: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/39.jpg)
Backup is Highly Configurable
Select which:
•Replica Sets to include/exclude
•Collections/namespaces to include/exclude
• How often snapshots are taken of your data (down to 15 minute intervals)
•How long your data is stored (up to 1 year)
![Page 40: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/40.jpg)
• 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 24 hours
Under the Hood
![Page 41: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/41.jpg)
Snapshots page
![Page 42: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/42.jpg)
Restore from a Snapshot
Restoring data is incredibly simple -
•Select the snapshot you’d like to restore and choose a delivery method (SCP push or HTTPS pull)
•Receive the file
•Unzip it
•Point your mongod to this directory
![Page 43: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/43.jpg)
![Page 44: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/44.jpg)
Restoring a MongoDB Sharded Cluster
Restoring data is only a few extra steps• Select your cluster in the MMS UI• Restore from a pre-build snapshot or
request a checkpoint restore (15 minute window)
• You will receive one data file to download for each shard, and one for the config server(s)
• Follow the same process as before for moving the data files to the server
![Page 45: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/45.jpg)
How Do We Backup a Sharded Cluster?
•Behind the scenes:– Balancer paused every 6 hours** – A no-op token is inserted across all shards,
mongoses and config servers– Oplog applied to replica sets until point at
which token was inserted
•Provides a consistent state of database across shards
**The balancer can be paused more frequently to accommodate more frequent restore points.
![Page 46: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/46.jpg)
Small Deployment
![Page 47: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/47.jpg)
Deploy for Redundancy
![Page 48: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/48.jpg)
Recap: MongoDB Backup with MMS
• Simplest means of backing up your
database
• Peace of mind, it just works
• Point-in-time restores for replica sets
• Check point restores for clusters
• Spin up QA or reporting environments
quickly from snapshots
![Page 49: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/49.jpg)
Resources
• MMS Cloud mms.mongodb.com
• MMS Cloud Documentation mms.mongodb.com/help/
• MMS On-Prem Documentation mms.mongodb.com/help-hosted/
• MMS On-Prem software download available on the subscription downloads page
![Page 50: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/50.jpg)
Questions?
![Page 51: Run MongoDB with Confidence: Backing up and Monitoring with MMS](https://reader038.vdocuments.mx/reader038/viewer/2022110306/55515a68b4c905e1708b4c8e/html5/thumbnails/51.jpg)
Thanks!
Sam Weaver, Senior Solution Architect