SlideShare ist ein Scribd-Unternehmen logo
1 von 46
MongoDB deployment tipsJared Rosoff - @forjared
Agenda Sizing Machines Understanding working set  Sizing RAM  Sizing Disk  Configuring Replica Sets Understanding failover  Avoiding single points of failure  Minimizing recovery time
Overview Secondary Secondary Secondary Config Config Config Router Router Shard 1 Shard 2 Shard 3 Primary Primary Primary Secondary Secondary Secondary
Servers and Hardware Secondary Secondary Secondary Config Config Config Router Router Shard 1 Shard 2 Shard 3 Primary Primary Primary Secondary Secondary Secondary
Sizing ram and disk
Collection 1 Index 1
Collection 1 Virtual Address Space 1 Index 1
Collection 1 Virtual Address Space 1 This is your virtual memory size (mapped)  Index 1
Collection 1 Virtual Address Space 1 Physical RAM Index 1
Collection 1 Virtual Address Space 1 Physical RAM Index 1 This is your resident memory size
Disk Collection 1 Virtual Address Space 1 Physical RAM Index 1
Disk Collection 1 Virtual Address Space 1 Physical RAM Index 1 Virtual Address Space 2
Disk Collection 1 Virtual Address Space 1 Physical RAM Index 1 100 ns = 10,000 ns =
Disk configurations Single Disk ~200 seeks / second
Disk configurations Single Disk RAID 0 ~200 seeks / second ~200 seeks / second ~200 seeks / second ~200 seeks / second
Disk configurations Single Disk RAID 0 ~200 seeks / second RAID 10 ~200 seeks / second ~200 seeks / second ~200 seeks / second ~400 seeks / second ~400 seeks / second ~400 seeks / second
SSDs ??  Seek time of 0.1ms vs 5ms  (200 seeks / sec => 10000 seeks / sec) But expensive
Tips for sizing hardware Know how important page faults are If you want low latency, avoid page faults Size memory appropriately  To avoid page faults, fit everything in RAM Collection Data + Index Data Provision disk appropriately RAID10 is recommended SSD’s are fast, if you can afford them
Replica Sets Secondary Secondary Secondary Config Config Config Router Router Shard 1 Shard 2 Shard 3 Primary Primary Primary Secondary Secondary Secondary
Understanding automatic failover
Primary Election As long as a partition can see a majority (>50%) of the cluster, then it will elect a primary.  Secondary Primary Secondary
Simple Failure 66% of cluster visible. Primary is elected Primary Failed Node Secondary
Simple Failure 33% of cluster visible.  Read only mode.  Failed Node Failed Node Secondary
Network Partition Secondary Primary Secondary
Network Partition 66% of cluster visible. Primary is elected Secondary Failed Node Primary Primary Secondary Secondary
Secondary Network Partition Primary Failed Node Secondary Secondary Failed Node 33% of cluster visible.  Read only mode.
Even Cluster Size Secondary Primary Secondary Secondary
Even Cluster Size 50% of cluster visible.  Read only mode.  Secondary Failed Node Primary Secondary Failed Node Secondary Secondary Secondary
Even Cluster Size Secondary Failed Node Primary Secondary Failed Node Secondary Secondary Secondary 50% of cluster visible.  Read only mode.
Avoiding single points of failure
Avoid Single points of failure
Avoid Single points of failure Secondary Primary Secondary Top of rack switch Rack falls over
Better Secondary Primary Secondary Loss of internet Building burns down
Better yet San Francisco Secondary Primary Dallas Secondary
Priorities San Francisco Priority 1 Priority 1 Secondary Priority 0 Primary Dallas Secondary Disaster recover data center. Will never become primary automatically.
Even Better San Francisco New York Secondary Primary Dallas Secondary
Fast recovery
2 Replicas + Arbiter?? Arbiter Is this a good idea?  Primary Secondary
2 Replicas + Arbiter?? 1 Arbiter Primary Secondary
2 Replicas + Arbiter?? 1 2 Arbiter Arbiter Primary Primary Secondary Secondary
2 Replicas + Arbiter?? 3 1 2 Full Sync Arbiter Arbiter Arbiter Primary Primary Primary Secondary Secondary Secondary Secondary Uh oh. Full Sync is going to use a lot of resources on the primary. So I may have downtime or degraded performance
With 3 replicas 1 Primary Secondary Secondary
With 3 replicas 1 2 Primary Primary Secondary Secondary Secondary Secondary
With 3 replicas 3 1 2 Primary Primary Primary Full Sync Secondary Secondary Secondary Secondary Secondary Secondary Secondary Sync can happen from secondary, which will not impact traffic on Primary.
Tips for choosing replica set topology Avoid single points of failure  Separate racks Separate data centers Avoid long recovery downtime Use journaling  Use 3+ replicas Keep your actives close  Use priority to control where failovers happen
Summary Sizing a machine  Know your working set size  Size RAM appropriately  Provision sufficient disks  Designing a replica set  Know how failover happens  Design for failure  Design for fast recover

Weitere ähnliche Inhalte

Ähnlich wie MongoDB Deployment Tips

MongoDB Best Practices in AWS
MongoDB Best Practices in AWS MongoDB Best Practices in AWS
MongoDB Best Practices in AWS Chris Harris
 
The overview of raid10
The overview of raid10The overview of raid10
The overview of raid10gary Jiang
 
rac_for_beginners_ppt.pdf
rac_for_beginners_ppt.pdfrac_for_beginners_ppt.pdf
rac_for_beginners_ppt.pdfHODCA1
 
The care and feeding of a MySQL database
The care and feeding of a MySQL databaseThe care and feeding of a MySQL database
The care and feeding of a MySQL databaseDave Stokes
 
Top 5 Mistakes When Writing Spark Applications
Top 5 Mistakes When Writing Spark ApplicationsTop 5 Mistakes When Writing Spark Applications
Top 5 Mistakes When Writing Spark ApplicationsSpark Summit
 
Top 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applicationsTop 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applicationshadooparchbook
 
Top 5 Mistakes to Avoid When Writing Apache Spark Applications
Top 5 Mistakes to Avoid When Writing Apache Spark ApplicationsTop 5 Mistakes to Avoid When Writing Apache Spark Applications
Top 5 Mistakes to Avoid When Writing Apache Spark ApplicationsCloudera, Inc.
 
Top 5 Mistakes When Writing Spark Applications by Mark Grover and Ted Malaska
Top 5 Mistakes When Writing Spark Applications by Mark Grover and Ted MalaskaTop 5 Mistakes When Writing Spark Applications by Mark Grover and Ted Malaska
Top 5 Mistakes When Writing Spark Applications by Mark Grover and Ted MalaskaSpark Summit
 
Top 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applicationsTop 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applicationshadooparchbook
 
PhpTek Ten Things to do to make your MySQL servers Happier and Healthier
PhpTek Ten Things to do to make your MySQL servers Happier and HealthierPhpTek Ten Things to do to make your MySQL servers Happier and Healthier
PhpTek Ten Things to do to make your MySQL servers Happier and HealthierDave Stokes
 
Top 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applicationsTop 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applicationsmarkgrover
 
Congratsyourthedbatoo
CongratsyourthedbatooCongratsyourthedbatoo
CongratsyourthedbatooDave Stokes
 
Replication, Durability, and Disaster Recovery
Replication, Durability, and Disaster RecoveryReplication, Durability, and Disaster Recovery
Replication, Durability, and Disaster RecoverySteven Francia
 
Performance and predictability (1)
Performance and predictability (1)Performance and predictability (1)
Performance and predictability (1)RichardWarburton
 
Performance and Predictability - Richard Warburton
Performance and Predictability - Richard WarburtonPerformance and Predictability - Richard Warburton
Performance and Predictability - Richard WarburtonJAXLondon2014
 
Losing Data in a Safe Way – Advanced Replication Strategies in Apache Hadoop ...
Losing Data in a Safe Way – Advanced Replication Strategies in Apache Hadoop ...Losing Data in a Safe Way – Advanced Replication Strategies in Apache Hadoop ...
Losing Data in a Safe Way – Advanced Replication Strategies in Apache Hadoop ...DataWorks Summit
 
OOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AASOOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AASKyle Hailey
 

Ähnlich wie MongoDB Deployment Tips (20)

MongoDB Best Practices in AWS
MongoDB Best Practices in AWS MongoDB Best Practices in AWS
MongoDB Best Practices in AWS
 
The overview of raid10
The overview of raid10The overview of raid10
The overview of raid10
 
rac_for_beginners_ppt.pdf
rac_for_beginners_ppt.pdfrac_for_beginners_ppt.pdf
rac_for_beginners_ppt.pdf
 
MySQL Monitoring 101
MySQL Monitoring 101MySQL Monitoring 101
MySQL Monitoring 101
 
The care and feeding of a MySQL database
The care and feeding of a MySQL databaseThe care and feeding of a MySQL database
The care and feeding of a MySQL database
 
Raid
Raid Raid
Raid
 
Top 5 Mistakes When Writing Spark Applications
Top 5 Mistakes When Writing Spark ApplicationsTop 5 Mistakes When Writing Spark Applications
Top 5 Mistakes When Writing Spark Applications
 
Top 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applicationsTop 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applications
 
Top 5 Mistakes to Avoid When Writing Apache Spark Applications
Top 5 Mistakes to Avoid When Writing Apache Spark ApplicationsTop 5 Mistakes to Avoid When Writing Apache Spark Applications
Top 5 Mistakes to Avoid When Writing Apache Spark Applications
 
Top 5 Mistakes When Writing Spark Applications by Mark Grover and Ted Malaska
Top 5 Mistakes When Writing Spark Applications by Mark Grover and Ted MalaskaTop 5 Mistakes When Writing Spark Applications by Mark Grover and Ted Malaska
Top 5 Mistakes When Writing Spark Applications by Mark Grover and Ted Malaska
 
Top 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applicationsTop 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applications
 
PhpTek Ten Things to do to make your MySQL servers Happier and Healthier
PhpTek Ten Things to do to make your MySQL servers Happier and HealthierPhpTek Ten Things to do to make your MySQL servers Happier and Healthier
PhpTek Ten Things to do to make your MySQL servers Happier and Healthier
 
Top 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applicationsTop 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applications
 
Congratsyourthedbatoo
CongratsyourthedbatooCongratsyourthedbatoo
Congratsyourthedbatoo
 
Replication, Durability, and Disaster Recovery
Replication, Durability, and Disaster RecoveryReplication, Durability, and Disaster Recovery
Replication, Durability, and Disaster Recovery
 
Performance and predictability (1)
Performance and predictability (1)Performance and predictability (1)
Performance and predictability (1)
 
Performance and Predictability - Richard Warburton
Performance and Predictability - Richard WarburtonPerformance and Predictability - Richard Warburton
Performance and Predictability - Richard Warburton
 
Losing Data in a Safe Way – Advanced Replication Strategies in Apache Hadoop ...
Losing Data in a Safe Way – Advanced Replication Strategies in Apache Hadoop ...Losing Data in a Safe Way – Advanced Replication Strategies in Apache Hadoop ...
Losing Data in a Safe Way – Advanced Replication Strategies in Apache Hadoop ...
 
OOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AASOOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AAS
 
Apache SolrCloud
Apache SolrCloudApache SolrCloud
Apache SolrCloud
 

Mehr von Jared Rosoff

MongoDB Advanced Schema Design - Inboxes
MongoDB Advanced Schema Design - InboxesMongoDB Advanced Schema Design - Inboxes
MongoDB Advanced Schema Design - InboxesJared Rosoff
 
Mongosv 2011 - Sharding
Mongosv 2011 - ShardingMongosv 2011 - Sharding
Mongosv 2011 - ShardingJared Rosoff
 
Mongosv 2011 - Replication
Mongosv 2011 - ReplicationMongosv 2011 - Replication
Mongosv 2011 - ReplicationJared Rosoff
 
Scaling with mongo db - SF Mongo User Group 7-19-2011
Scaling with mongo db - SF Mongo User Group 7-19-2011Scaling with mongo db - SF Mongo User Group 7-19-2011
Scaling with mongo db - SF Mongo User Group 7-19-2011Jared Rosoff
 
MongoDB on EC2 and EBS
MongoDB on EC2 and EBSMongoDB on EC2 and EBS
MongoDB on EC2 and EBSJared Rosoff
 
Indexing & query optimization
Indexing & query optimizationIndexing & query optimization
Indexing & query optimizationJared Rosoff
 
Web performance meetup bos 11 18-2010
Web performance meetup bos 11 18-2010Web performance meetup bos 11 18-2010
Web performance meetup bos 11 18-2010Jared Rosoff
 
Scalable Event Analytics with MongoDB & Ruby on Rails
Scalable Event Analytics with MongoDB & Ruby on RailsScalable Event Analytics with MongoDB & Ruby on Rails
Scalable Event Analytics with MongoDB & Ruby on RailsJared Rosoff
 

Mehr von Jared Rosoff (8)

MongoDB Advanced Schema Design - Inboxes
MongoDB Advanced Schema Design - InboxesMongoDB Advanced Schema Design - Inboxes
MongoDB Advanced Schema Design - Inboxes
 
Mongosv 2011 - Sharding
Mongosv 2011 - ShardingMongosv 2011 - Sharding
Mongosv 2011 - Sharding
 
Mongosv 2011 - Replication
Mongosv 2011 - ReplicationMongosv 2011 - Replication
Mongosv 2011 - Replication
 
Scaling with mongo db - SF Mongo User Group 7-19-2011
Scaling with mongo db - SF Mongo User Group 7-19-2011Scaling with mongo db - SF Mongo User Group 7-19-2011
Scaling with mongo db - SF Mongo User Group 7-19-2011
 
MongoDB on EC2 and EBS
MongoDB on EC2 and EBSMongoDB on EC2 and EBS
MongoDB on EC2 and EBS
 
Indexing & query optimization
Indexing & query optimizationIndexing & query optimization
Indexing & query optimization
 
Web performance meetup bos 11 18-2010
Web performance meetup bos 11 18-2010Web performance meetup bos 11 18-2010
Web performance meetup bos 11 18-2010
 
Scalable Event Analytics with MongoDB & Ruby on Rails
Scalable Event Analytics with MongoDB & Ruby on RailsScalable Event Analytics with MongoDB & Ruby on Rails
Scalable Event Analytics with MongoDB & Ruby on Rails
 

Kürzlich hochgeladen

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

MongoDB Deployment Tips

  • 1. MongoDB deployment tipsJared Rosoff - @forjared
  • 2. Agenda Sizing Machines Understanding working set Sizing RAM Sizing Disk Configuring Replica Sets Understanding failover Avoiding single points of failure Minimizing recovery time
  • 3. Overview Secondary Secondary Secondary Config Config Config Router Router Shard 1 Shard 2 Shard 3 Primary Primary Primary Secondary Secondary Secondary
  • 4. Servers and Hardware Secondary Secondary Secondary Config Config Config Router Router Shard 1 Shard 2 Shard 3 Primary Primary Primary Secondary Secondary Secondary
  • 7. Collection 1 Virtual Address Space 1 Index 1
  • 8. Collection 1 Virtual Address Space 1 This is your virtual memory size (mapped) Index 1
  • 9. Collection 1 Virtual Address Space 1 Physical RAM Index 1
  • 10. Collection 1 Virtual Address Space 1 Physical RAM Index 1 This is your resident memory size
  • 11. Disk Collection 1 Virtual Address Space 1 Physical RAM Index 1
  • 12. Disk Collection 1 Virtual Address Space 1 Physical RAM Index 1 Virtual Address Space 2
  • 13. Disk Collection 1 Virtual Address Space 1 Physical RAM Index 1 100 ns = 10,000 ns =
  • 14. Disk configurations Single Disk ~200 seeks / second
  • 15. Disk configurations Single Disk RAID 0 ~200 seeks / second ~200 seeks / second ~200 seeks / second ~200 seeks / second
  • 16. Disk configurations Single Disk RAID 0 ~200 seeks / second RAID 10 ~200 seeks / second ~200 seeks / second ~200 seeks / second ~400 seeks / second ~400 seeks / second ~400 seeks / second
  • 17. SSDs ?? Seek time of 0.1ms vs 5ms (200 seeks / sec => 10000 seeks / sec) But expensive
  • 18. Tips for sizing hardware Know how important page faults are If you want low latency, avoid page faults Size memory appropriately To avoid page faults, fit everything in RAM Collection Data + Index Data Provision disk appropriately RAID10 is recommended SSD’s are fast, if you can afford them
  • 19. Replica Sets Secondary Secondary Secondary Config Config Config Router Router Shard 1 Shard 2 Shard 3 Primary Primary Primary Secondary Secondary Secondary
  • 21. Primary Election As long as a partition can see a majority (>50%) of the cluster, then it will elect a primary. Secondary Primary Secondary
  • 22. Simple Failure 66% of cluster visible. Primary is elected Primary Failed Node Secondary
  • 23. Simple Failure 33% of cluster visible. Read only mode. Failed Node Failed Node Secondary
  • 24. Network Partition Secondary Primary Secondary
  • 25. Network Partition 66% of cluster visible. Primary is elected Secondary Failed Node Primary Primary Secondary Secondary
  • 26. Secondary Network Partition Primary Failed Node Secondary Secondary Failed Node 33% of cluster visible. Read only mode.
  • 27. Even Cluster Size Secondary Primary Secondary Secondary
  • 28. Even Cluster Size 50% of cluster visible. Read only mode. Secondary Failed Node Primary Secondary Failed Node Secondary Secondary Secondary
  • 29. Even Cluster Size Secondary Failed Node Primary Secondary Failed Node Secondary Secondary Secondary 50% of cluster visible. Read only mode.
  • 31. Avoid Single points of failure
  • 32. Avoid Single points of failure Secondary Primary Secondary Top of rack switch Rack falls over
  • 33. Better Secondary Primary Secondary Loss of internet Building burns down
  • 34. Better yet San Francisco Secondary Primary Dallas Secondary
  • 35. Priorities San Francisco Priority 1 Priority 1 Secondary Priority 0 Primary Dallas Secondary Disaster recover data center. Will never become primary automatically.
  • 36. Even Better San Francisco New York Secondary Primary Dallas Secondary
  • 38. 2 Replicas + Arbiter?? Arbiter Is this a good idea? Primary Secondary
  • 39. 2 Replicas + Arbiter?? 1 Arbiter Primary Secondary
  • 40. 2 Replicas + Arbiter?? 1 2 Arbiter Arbiter Primary Primary Secondary Secondary
  • 41. 2 Replicas + Arbiter?? 3 1 2 Full Sync Arbiter Arbiter Arbiter Primary Primary Primary Secondary Secondary Secondary Secondary Uh oh. Full Sync is going to use a lot of resources on the primary. So I may have downtime or degraded performance
  • 42. With 3 replicas 1 Primary Secondary Secondary
  • 43. With 3 replicas 1 2 Primary Primary Secondary Secondary Secondary Secondary
  • 44. With 3 replicas 3 1 2 Primary Primary Primary Full Sync Secondary Secondary Secondary Secondary Secondary Secondary Secondary Sync can happen from secondary, which will not impact traffic on Primary.
  • 45. Tips for choosing replica set topology Avoid single points of failure Separate racks Separate data centers Avoid long recovery downtime Use journaling Use 3+ replicas Keep your actives close Use priority to control where failovers happen
  • 46. Summary Sizing a machine Know your working set size Size RAM appropriately Provision sufficient disks Designing a replica set Know how failover happens Design for failure Design for fast recover