Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ops Jumpstart: MongoDB Administration 101

963 views

Published on

New to MongoDB? We'll provide an overview of installation, high availability through replication, scale out through sharding, and options for monitoring and backup. No prior knowledge of MongoDB is assumed. This session will jumpstart your knowledge of MongoDB operations, providing you with context for the rest of the day's content.

Published in: Technology
  • Be the first to comment

Ops Jumpstart: MongoDB Administration 101

  1. 1. MongoDB Administration 101 (Ops Jumpstart) Marc Schwering Senior Solutions Architect MongoDB @m4rcsch #MonogDBDays marc@mongodb.com
  2. 2. 2 • Overview • High Availability through Replica Sets • Scalability through Sharding • Deployment Architectures • Database Management Agenda
  3. 3. Overview
  4. 4. 4 MongoDB Document Database General Purpose Agile Scalable
  5. 5. 5 • Document Data Model – App and DB data structures in harmony – Fast to develop against – quicker to market • Dynamic Schema – Polymorphic data is the norm – Data model can evolve as app evolves – quicker to iterate • Built-in Horizontal Scalability – Low infrastructure costs – commodity hosts & no need for SAN – Elasticity - start small and invest incrementally Why MongoDB? Initial DB decision doesn’t constrain a successfully growing business, later on
  6. 6. 6 Operational Database
  7. 7. 7 Document Data Model Relational - Tables Document - Collections { firstname: ‘Paul’, surname: ‘Miller’, city: ‘London’, location: { type: “Point”, coordinates : [-0.128, 51.507] }, cars: [ { model: ‘Bentley’, year: 1973, value: 100000, … }, { model: ‘Rolls Royce’, year: 1965, value: 330000, … } ] }
  8. 8. 8 Document Data Model Relational MongoDB
  9. 9. 9 Full featured Interaction Queries • Find Paul’s cars Geospatial • Find all of the car owners within 5km of Trafalgar Square Text Search • Find all the cars with ‘leather seats’ in their description Aggregation & Map Reduce • Calculate the average value of every owner’s car collection, and show only the top 10 { firstname: ‘Paul’, surname: ‘Miller’, city: ‘London’, location: { type: “Point”, coordinates : [-0.128, 51.507] }, cars: [ { model: ‘Bentley’, year: 1973, value: 100000, … }, { model: ‘Rolls Royce’, year: 1965, value: 330000, … } ] }
  10. 10. High Availability through Replica Sets
  11. 11. 11 Replica Sets • Replica Set – two or more copies • Automated Replication & Failover • Addresses availability – High Availability – Disaster Recovery – Maintenance (rolling updates) • Deployment Flexibility – Data locality to users – Delayed replicas – Workload isolation Primary Driver Application Secondary Secondary Replication
  12. 12. 12 Replica Set - Initialised
  13. 13. 13 Replica Set – Failure & Re-election
  14. 14. 14 Replica Set – Failed-over
  15. 15. 15 Replica Set - Recovery
  16. 16. 16 Replica Set - Recovered
  17. 17. Scalability through Sharding
  18. 18. 18 Needing to Scale-out? • Increasing volume of persisted data is too large for host machine? • Write throughput being constrained by hard disks of host machine? • Read latencies being constrained by the size of memory of host machine?
  19. 19. 19 Working Set Exceeding RAM
  20. 20. 20 Sharding Auto-Sharding • Increase and decrease capacity as you go • Automatic Balancing • Transparent to applications • Scale capacity, scale reads, scale writes
  21. 21. 21 Sharding
  22. 22. Deployment Architectures
  23. 23. 23 Single Data Centre • Automated failover • Tolerates server failures • Tolerates rack failures • Number of replicas defines failure tolerance Primary – A Primary – B Primary – C Secondary – A Secondary – ASecondary – B Secondary – BSecondary – CSecondary – C
  24. 24. 24 Active/Standby Data Centres • Tolerates server and rack failure • Standby data center for disaster recovery Data Center - West Primary – A Primary – B Primary – C Secondary – ASecondary – B Secondary – C Data Center - East Secondary – A Secondary – B Secondary – C
  25. 25. 25 Active/Active Data Centres • Tolerates server, rack, data center failures, network partitions Data Center - West Primary – A Primary – B Primary – C Secondary – A Secondary – BSecondary – C Data Center - East Secondary – A Secondary – B Secondary – C Secondary – B Secondary – C Secondary – A Data Center - Central Arbiter – A Arbiter – B Arbiter – C
  26. 26. 26 Global Data Distribution Real-Time Real-Time Real-Time Real-Time Real-Time Real-Time Real-Time Primary Secondary Secondary Secondary Secondary Secondary Secondary Secondary
  27. 27. 27 Write locally, Read globally Primary:NYC Secondary:NYC Primary:LON Primary:SYD Secondary:LON Secondary:NYC Secondary:SYD Secondary:LON Secondary:SYD
  28. 28. Database Management
  29. 29. 29 MongoDB Management Service (MMS) Managed MongoDB on the Infrastructure of Your Choice
  30. 30. 30 • Cloud based MMS or • On-Prem MMS • Monitoring • Backup & Restore • Automation – Deployment & Elasticity – Rolling upgrade/downgrade without downtime MMS
  31. 31. 31 • Continuous low-overhead backup • Consistent across Shards on different hosts • Point-in-time recovery MMS Backup
  32. 32. 32 Business Needs Security Features Authentication In-database LDAP Kerberos x.509 Certificates Authorization Built-in Roles User-Defined Roles Field-Level Redaction Auditing Admin Operations Queries (via Partner Solutions) Encryption Network: SSL (with FIPS 140-2) Disk: Partner Solutions Enterprise-Grade Security
  33. 33. 33 help db.help() db.stats() > mongostat > iostat Windows: perfmon Console!
  34. 34. 34 > db.serverStatus( { workingSet: 1 } ) … "workingSet" : { "note" : "thisIsAnEstimate", "pagesInMemory" : 378, "computationTimeMicros" : 4104, "overSeconds" : 4646 }, stats
  35. 35. 35 > mongostat … Insert query update delete getmore command flushes mapped vsize res *0 *0 *0 *0 0 1|0 0 160m 2.75g 5m *0 *0 *0 *0 0 1|0 0 160m 2.75g 5m stats
  36. 36. Questions? @m4rcsch - marc@mongodb.com
  37. 37. 37 For More Information Resource Location MongoDB Downloads mongodb.com/download Free Online Training education.mongodb.com Webinars and Events mongodb.com/events White Papers mongodb.com/white-papers Case Studies mongodb.com/customers Presentations mongodb.com/presentations Documentation docs.mongodb.org Resource Location
  38. 38. @m4rcsch - marc@mongodb.com

×