SlideShare uma empresa Scribd logo
1 de 37
Baixar para ler offline
#MongoDB 
Advanced MongoDB 
for Development, Deployment 
and Operation 
Daniel Coupal 
Technical Services Engineer, Palo Alto, CA 
Silicon Valley Code Camp 2014
2 
MongoDB Overview 
400+ employees 1,000+ customers 
13 offices around the world Over $231 million in funding
3 
This presentation is not … 
• an introduction to MongoDB 
First steps with MongoDB 
by Nuri Halperin 
5:00 PM Saturday 
• about code examples 
Beer Locker: Building a RESTful API with Node.js 
by Scott Smith 
2:45 PM Sunday 
Get MEAN! MongoDb + express + angular + node 
by Ward Bell 
1:45 PM Saturday 
Getting RESTless with MeteorJS and MongoDB in the browser 
by Ryan Jarvinen 
2:45 PM Sunday
4 
This presentation is about … 
• Making you successful in developing, 
deploying and operating an application with 
MongoDB 
• I do expect you to know the basics of 
MongoDB. 
• …even better if you already have an 
application about to be deployed
5 
Agenda 
1. Some Concepts 
2. The Story of your Application 
I. Prototype and Development 
II. Deployment 
III. Operation 
3. Wrapping up 
4. Q&A
1. Some Concepts
7 
Some Concepts 
• Oplog 
• Working set 
• MMS 
• Collection scans 
• Deployments/elections
8 
What is a Replica Set Oplog? 
• A capped collection that stores an ordered 
history of logical writes to a MongoDB 
database 
– Does not store operations like increment, add to set, 
etc. Those are translated to the final document. 
– Safe to replay old oplogs. Needs to play all of them in 
the right order. 
• Enables replication 
• Enables backups
9 
Sizing the Oplog collection 
• The capped collection dictates the amount 
of hours a secondary/backup agent can stop 
talking to the primary 
• MMS Monitoring has 
a Replication Oplog 
Window graph 
• Higher rate of writes 
to the DBs requires a 
larger Oplog collection
Working set 
10 
• Working Set: The total body of data+indexes 
that the application uses in the course of 
normal operation. 
– http://docs.mongodb.org/manual/faq/storage/#what-is-the- 
working-set 
– MongoDB v2.4 added a working set estimator to the 
serverStatus command 
– http://docs.mongodb.org/manual/reference/command/ 
serverStatus/#serverStatus.workingSet
The MMS Components 
A. Monitoring 
1. Cloud: Sept 2011 
2. On-Prem: July 2013 
B. Backups 
1. Cloud: April 2013 
2. On-Prem: April 2014 
C. Automation 
11 
1. Cloud: October 2014
The MMS User Interface 
12
Overview of MMS Monitoring 
13
Overview of MMS Backup 
14
MMS under the hood: monitoring and backup agents 
15
Collection scan 
16 
• Very bad if you have a large collection 
• One of the main performance issue see in our 
customers’ application 
• Can be identified in the logs with the ‘nscanned’ 
attribute on slow queries
Deployments/elections 
17 
• 3 data nodes 
• If even number of data nodes, add an arbiter 
– Don’t use more than one arbiter 
• Many Data Centers or availability zones 
• What is important for you? 
=> can be chosen per operation 
– Durability of writes 
– Performance
2. The Story of your Application
I. Prototype and Development 
19 
1. Schema, schema, schema! 
2. What happens when a failure is returned 
by the database? 
3. Index correctly 
4. Incorporate testability in your application 
5. Think about data sizing and growth 
6. Performance Tuning
Think about data sizing and growth 
20 
• How much data will you have initially? 
• How will your data set grow over time? 
• How big is your working set? 
• Will you be loading huge bulk inserts, or have a constant 
stream of writes? 
• How many reads and writes will you need to service per 
second? 
• What is the peak load you need to provision for?
Performance Tuning 
1. Assess the problem and establish acceptable behavior 
2. Measure the current performance 
3. Find the bottleneck* 
4. Remove the bottleneck 
5. Re-test to confirm 
6. Repeat 
* - (This is often the hard part) 
(Adapted from http://en.wikipedia.org/wiki/Performance_tuning ) 
21
II. Deploy 
22 
1. Deployment topology 
2. Have a test/staging environment 
– Track slow queries and collection scans 
3. MongoDB production notes 
– http://docs.mongodb.org/manual/administration/production-notes 
4. Storage considerations
Storage considerations 
23 
• RAID 
=> 0+1 
• NAS, SAN or Direct Attached? 
=> Direct Attached 
• HDD or SSD 
=> SSD, if budget permit
III. Operation 
24 
1. Monitor 
2. Upgrade 
3. Backup 
4. Troubleshoot
Disaster will strike 
25 
“Shit will happen!” 
• Are you prepared? 
• Have backups? 
• Have a good picture of your “normal state”
Monitor 
26 
• iostat, top, vmstat, sar 
• mongostat, mongotop 
• MMS Monitoring 
– Use Munin extensions
Upgrade 
27 
• Major versions have same binary format, 
same protocol, etc 
• MMS Automation handles automatic 
upgrades
Comparing MongoDB backup approaches 
28 
Mongodump File system MMS Backup 
Cloud 
MMS Backup 
On-Prem 
Initial complexity Medium High Low High 
System overhead High Low Low Medium 
Point in time 
Yes * No Yes Yes 
recovery of replica 
set 
Consistent 
snapshot of 
sharded system 
Yes * Yes * Yes Yes 
Scalable No Yes Yes Yes 
Restore time Slow Fast Medium Medium 
* Possible, but need to write the tools and go though a lot of pain
3. Wrapping up
Common Mistakes 
30 
1. Missing indexes 
2. Not testing before deploying application changes 
3. ulimits 
a. number of open files => 64000 
b. number of processes/threads => 64000 
4. Appropriate schema 
5. Hardware 
a. right disks for the job 
b. enough RAM 
6. Not seeking help early enough
Resources 
31 
• MongoDB Professional Customer Support 
– 24x7 support 
– the sun never set on MongoDB Customer Support Team 
• MongoDB Consulting Days 
• MongoDB World (@NYC in June) 
• MongoDB Days (@SF on Dec 3, 2014) 
• MongoDB Office Hours 
• Google Groups
Static Resources 
32 
• MongoDB on-line presentations mongodb.com/presentations 
• Free MongoDB classes university.mongodb.com 
• MMS Cloud mms.mongodb.com 
• MMS Cloud Documentation mms.mongodb.com/help-classic 
• mtools to analyze MongoDB logs github.com/rueckstiess/mtools
Summary 
33 
• Use available resources 
• Testing 
– Plan for it, plan resources for it, do it before deploying
Take away 
34 
I hope you walk out of this presentation and 
you make at least one single change in your 
application, deployment, configuration, etc 
that will prevent one issue from happening.
We hire 
35 
Positions open in Palo Alto, Austin and NYC 
• http://www.mongodb.com/careers 
Technical service engineer in Palo Alto 
• http://www.mongodb.com/careers/ 
positions/technical-services-engineer
4. Q&A
Thank you for using 
Daniel Coupal, Technical Services Engineer

Mais conteúdo relacionado

Mais procurados

Webinar: Best Practices for Upgrading to MongoDB 3.2
Webinar: Best Practices for Upgrading to MongoDB 3.2Webinar: Best Practices for Upgrading to MongoDB 3.2
Webinar: Best Practices for Upgrading to MongoDB 3.2Dana Elisabeth Groce
 
Interactive Data Analysis with Apache Flink @ Flink Meetup in Berlin
Interactive Data Analysis with Apache Flink @ Flink Meetup in BerlinInteractive Data Analysis with Apache Flink @ Flink Meetup in Berlin
Interactive Data Analysis with Apache Flink @ Flink Meetup in BerlinTill Rohrmann
 
Continuous Integration & Continuous Delivery
Continuous Integration & Continuous DeliveryContinuous Integration & Continuous Delivery
Continuous Integration & Continuous DeliveryDatabricks
 
Spark Summit EU talk by Jim Dowling
Spark Summit EU talk by Jim DowlingSpark Summit EU talk by Jim Dowling
Spark Summit EU talk by Jim DowlingSpark Summit
 
IniniFlux Feature_Perf_Comparison
IniniFlux Feature_Perf_ComparisonIniniFlux Feature_Perf_Comparison
IniniFlux Feature_Perf_ComparisonInfiniFlux
 
Webinar: What's New in MongoDB 3.2
Webinar: What's New in MongoDB 3.2Webinar: What's New in MongoDB 3.2
Webinar: What's New in MongoDB 3.2MongoDB
 
Extending the Yahoo Streaming Benchmark
Extending the Yahoo Streaming BenchmarkExtending the Yahoo Streaming Benchmark
Extending the Yahoo Streaming BenchmarkJamie Grier
 
Kiwipycon2011 async-with-gevent-redis
Kiwipycon2011 async-with-gevent-redisKiwipycon2011 async-with-gevent-redis
Kiwipycon2011 async-with-gevent-redisalexdong
 
Accelerating Shuffle: A Tailor-Made RDMA Solution for Apache Spark with Yuval...
Accelerating Shuffle: A Tailor-Made RDMA Solution for Apache Spark with Yuval...Accelerating Shuffle: A Tailor-Made RDMA Solution for Apache Spark with Yuval...
Accelerating Shuffle: A Tailor-Made RDMA Solution for Apache Spark with Yuval...Spark Summit
 
The inherent complexity of stream processing
The inherent complexity of stream processingThe inherent complexity of stream processing
The inherent complexity of stream processingnathanmarz
 
Serverless Swift for Mobile Developers
Serverless Swift for Mobile DevelopersServerless Swift for Mobile Developers
Serverless Swift for Mobile DevelopersAll Things Open
 
Elephants in the cloud or how to become cloud ready
Elephants in the cloud or how to become cloud readyElephants in the cloud or how to become cloud ready
Elephants in the cloud or how to become cloud readyKrzysztof Adamski
 
Dr. Elephant for Monitoring and Tuning Apache Spark Jobs on Hadoop with Carl ...
Dr. Elephant for Monitoring and Tuning Apache Spark Jobs on Hadoop with Carl ...Dr. Elephant for Monitoring and Tuning Apache Spark Jobs on Hadoop with Carl ...
Dr. Elephant for Monitoring and Tuning Apache Spark Jobs on Hadoop with Carl ...Databricks
 
Storm: distributed and fault-tolerant realtime computation
Storm: distributed and fault-tolerant realtime computationStorm: distributed and fault-tolerant realtime computation
Storm: distributed and fault-tolerant realtime computationnathanmarz
 
Using Simplicity to Make Hard Big Data Problems Easy
Using Simplicity to Make Hard Big Data Problems EasyUsing Simplicity to Make Hard Big Data Problems Easy
Using Simplicity to Make Hard Big Data Problems Easynathanmarz
 
Whats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
Whats wrong with postgres | PGConf EU 2019 | Craig KerstiensWhats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
Whats wrong with postgres | PGConf EU 2019 | Craig KerstiensCitus Data
 
Apache Flink vs Apache Spark - Reproducible experiments on cloud.
Apache Flink vs Apache Spark - Reproducible experiments on cloud.Apache Flink vs Apache Spark - Reproducible experiments on cloud.
Apache Flink vs Apache Spark - Reproducible experiments on cloud.Shelan Perera
 
Lightening Talk - PostgreSQL Worst Practices
Lightening Talk - PostgreSQL Worst PracticesLightening Talk - PostgreSQL Worst Practices
Lightening Talk - PostgreSQL Worst PracticesPGConf APAC
 
Sparklyr: Recap, Updates, and Use Cases with Javier Luraschi
Sparklyr: Recap, Updates, and Use Cases with Javier LuraschiSparklyr: Recap, Updates, and Use Cases with Javier Luraschi
Sparklyr: Recap, Updates, and Use Cases with Javier LuraschiDatabricks
 

Mais procurados (20)

Webinar: Best Practices for Upgrading to MongoDB 3.2
Webinar: Best Practices for Upgrading to MongoDB 3.2Webinar: Best Practices for Upgrading to MongoDB 3.2
Webinar: Best Practices for Upgrading to MongoDB 3.2
 
Interactive Data Analysis with Apache Flink @ Flink Meetup in Berlin
Interactive Data Analysis with Apache Flink @ Flink Meetup in BerlinInteractive Data Analysis with Apache Flink @ Flink Meetup in Berlin
Interactive Data Analysis with Apache Flink @ Flink Meetup in Berlin
 
Continuous Integration & Continuous Delivery
Continuous Integration & Continuous DeliveryContinuous Integration & Continuous Delivery
Continuous Integration & Continuous Delivery
 
Spark Summit EU talk by Jim Dowling
Spark Summit EU talk by Jim DowlingSpark Summit EU talk by Jim Dowling
Spark Summit EU talk by Jim Dowling
 
IniniFlux Feature_Perf_Comparison
IniniFlux Feature_Perf_ComparisonIniniFlux Feature_Perf_Comparison
IniniFlux Feature_Perf_Comparison
 
Webinar: What's New in MongoDB 3.2
Webinar: What's New in MongoDB 3.2Webinar: What's New in MongoDB 3.2
Webinar: What's New in MongoDB 3.2
 
Extending the Yahoo Streaming Benchmark
Extending the Yahoo Streaming BenchmarkExtending the Yahoo Streaming Benchmark
Extending the Yahoo Streaming Benchmark
 
January 2011 HUG: Kafka Presentation
January 2011 HUG: Kafka PresentationJanuary 2011 HUG: Kafka Presentation
January 2011 HUG: Kafka Presentation
 
Kiwipycon2011 async-with-gevent-redis
Kiwipycon2011 async-with-gevent-redisKiwipycon2011 async-with-gevent-redis
Kiwipycon2011 async-with-gevent-redis
 
Accelerating Shuffle: A Tailor-Made RDMA Solution for Apache Spark with Yuval...
Accelerating Shuffle: A Tailor-Made RDMA Solution for Apache Spark with Yuval...Accelerating Shuffle: A Tailor-Made RDMA Solution for Apache Spark with Yuval...
Accelerating Shuffle: A Tailor-Made RDMA Solution for Apache Spark with Yuval...
 
The inherent complexity of stream processing
The inherent complexity of stream processingThe inherent complexity of stream processing
The inherent complexity of stream processing
 
Serverless Swift for Mobile Developers
Serverless Swift for Mobile DevelopersServerless Swift for Mobile Developers
Serverless Swift for Mobile Developers
 
Elephants in the cloud or how to become cloud ready
Elephants in the cloud or how to become cloud readyElephants in the cloud or how to become cloud ready
Elephants in the cloud or how to become cloud ready
 
Dr. Elephant for Monitoring and Tuning Apache Spark Jobs on Hadoop with Carl ...
Dr. Elephant for Monitoring and Tuning Apache Spark Jobs on Hadoop with Carl ...Dr. Elephant for Monitoring and Tuning Apache Spark Jobs on Hadoop with Carl ...
Dr. Elephant for Monitoring and Tuning Apache Spark Jobs on Hadoop with Carl ...
 
Storm: distributed and fault-tolerant realtime computation
Storm: distributed and fault-tolerant realtime computationStorm: distributed and fault-tolerant realtime computation
Storm: distributed and fault-tolerant realtime computation
 
Using Simplicity to Make Hard Big Data Problems Easy
Using Simplicity to Make Hard Big Data Problems EasyUsing Simplicity to Make Hard Big Data Problems Easy
Using Simplicity to Make Hard Big Data Problems Easy
 
Whats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
Whats wrong with postgres | PGConf EU 2019 | Craig KerstiensWhats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
Whats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
 
Apache Flink vs Apache Spark - Reproducible experiments on cloud.
Apache Flink vs Apache Spark - Reproducible experiments on cloud.Apache Flink vs Apache Spark - Reproducible experiments on cloud.
Apache Flink vs Apache Spark - Reproducible experiments on cloud.
 
Lightening Talk - PostgreSQL Worst Practices
Lightening Talk - PostgreSQL Worst PracticesLightening Talk - PostgreSQL Worst Practices
Lightening Talk - PostgreSQL Worst Practices
 
Sparklyr: Recap, Updates, and Use Cases with Javier Luraschi
Sparklyr: Recap, Updates, and Use Cases with Javier LuraschiSparklyr: Recap, Updates, and Use Cases with Javier Luraschi
Sparklyr: Recap, Updates, and Use Cases with Javier Luraschi
 

Semelhante a Silicon Valley Code Camp 2014 - Advanced MongoDB

Silicon Valley Code Camp 2016 - MongoDB in production
Silicon Valley Code Camp 2016 - MongoDB in productionSilicon Valley Code Camp 2016 - MongoDB in production
Silicon Valley Code Camp 2016 - MongoDB in productionDaniel Coupal
 
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...Databricks
 
Webinar: Backups + Disaster Recovery
Webinar: Backups + Disaster RecoveryWebinar: Backups + Disaster Recovery
Webinar: Backups + Disaster RecoveryMongoDB
 
Profiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsProfiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsAchievers Tech
 
Hardware Provisioning
Hardware ProvisioningHardware Provisioning
Hardware ProvisioningMongoDB
 
Advanced Benchmarking at Parse
Advanced Benchmarking at ParseAdvanced Benchmarking at Parse
Advanced Benchmarking at ParseMongoDB
 
Hardware Provisioning
Hardware Provisioning Hardware Provisioning
Hardware Provisioning MongoDB
 
Hardware Provisioning for MongoDB
Hardware Provisioning for MongoDBHardware Provisioning for MongoDB
Hardware Provisioning for MongoDBMongoDB
 
MongoDB Management Service: Getting Started with MMS
MongoDB Management Service: Getting Started with MMSMongoDB Management Service: Getting Started with MMS
MongoDB Management Service: Getting Started with MMSMongoDB
 
Webinar: Best Practices for Upgrading to MongoDB 3.0
Webinar: Best Practices for Upgrading to MongoDB 3.0Webinar: Best Practices for Upgrading to MongoDB 3.0
Webinar: Best Practices for Upgrading to MongoDB 3.0MongoDB
 
Conceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producciónConceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producciónMongoDB
 
Backing Up Data with MMS
Backing Up Data with MMSBacking Up Data with MMS
Backing Up Data with MMSMongoDB
 
MongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDB
MongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDBMongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDB
MongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDBMongoDB
 
Walking the Walk: Developing the MongoDB Backup Service with MongoDB
Walking the Walk: Developing the MongoDB Backup Service with MongoDBWalking the Walk: Developing the MongoDB Backup Service with MongoDB
Walking the Walk: Developing the MongoDB Backup Service with MongoDBMongoDB
 
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 20197 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019Dave Stokes
 
Performant Django - Ara Anjargolian
Performant Django - Ara AnjargolianPerformant Django - Ara Anjargolian
Performant Django - Ara AnjargolianHakka Labs
 
MongoDB Management Service (MMS): Session 01: Getting Started with MMS
MongoDB Management Service (MMS): Session 01: Getting Started with MMSMongoDB Management Service (MMS): Session 01: Getting Started with MMS
MongoDB Management Service (MMS): Session 01: Getting Started with MMSMongoDB
 
Run MongoDB with Confidence: Backing up and Monitoring with MMS
Run MongoDB with Confidence: Backing up and Monitoring with MMSRun MongoDB with Confidence: Backing up and Monitoring with MMS
Run MongoDB with Confidence: Backing up and Monitoring with MMSMongoDB
 
MongoDB.local Atlanta: MongoDB @ Sensus: Xylem IoT and MongoDB
MongoDB.local Atlanta: MongoDB @ Sensus: Xylem IoT and MongoDBMongoDB.local Atlanta: MongoDB @ Sensus: Xylem IoT and MongoDB
MongoDB.local Atlanta: MongoDB @ Sensus: Xylem IoT and MongoDBMongoDB
 
Performance Optimization of Cloud Based Applications by Peter Smith, ACL
Performance Optimization of Cloud Based Applications by Peter Smith, ACLPerformance Optimization of Cloud Based Applications by Peter Smith, ACL
Performance Optimization of Cloud Based Applications by Peter Smith, ACLTriNimbus
 

Semelhante a Silicon Valley Code Camp 2014 - Advanced MongoDB (20)

Silicon Valley Code Camp 2016 - MongoDB in production
Silicon Valley Code Camp 2016 - MongoDB in productionSilicon Valley Code Camp 2016 - MongoDB in production
Silicon Valley Code Camp 2016 - MongoDB in production
 
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
Lessons Learned Replatforming A Large Machine Learning Application To Apache ...
 
Webinar: Backups + Disaster Recovery
Webinar: Backups + Disaster RecoveryWebinar: Backups + Disaster Recovery
Webinar: Backups + Disaster Recovery
 
Profiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsProfiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty Details
 
Hardware Provisioning
Hardware ProvisioningHardware Provisioning
Hardware Provisioning
 
Advanced Benchmarking at Parse
Advanced Benchmarking at ParseAdvanced Benchmarking at Parse
Advanced Benchmarking at Parse
 
Hardware Provisioning
Hardware Provisioning Hardware Provisioning
Hardware Provisioning
 
Hardware Provisioning for MongoDB
Hardware Provisioning for MongoDBHardware Provisioning for MongoDB
Hardware Provisioning for MongoDB
 
MongoDB Management Service: Getting Started with MMS
MongoDB Management Service: Getting Started with MMSMongoDB Management Service: Getting Started with MMS
MongoDB Management Service: Getting Started with MMS
 
Webinar: Best Practices for Upgrading to MongoDB 3.0
Webinar: Best Practices for Upgrading to MongoDB 3.0Webinar: Best Practices for Upgrading to MongoDB 3.0
Webinar: Best Practices for Upgrading to MongoDB 3.0
 
Conceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producciónConceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producción
 
Backing Up Data with MMS
Backing Up Data with MMSBacking Up Data with MMS
Backing Up Data with MMS
 
MongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDB
MongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDBMongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDB
MongoDB Days Silicon Valley: Best Practices for Upgrading to MongoDB
 
Walking the Walk: Developing the MongoDB Backup Service with MongoDB
Walking the Walk: Developing the MongoDB Backup Service with MongoDBWalking the Walk: Developing the MongoDB Backup Service with MongoDB
Walking the Walk: Developing the MongoDB Backup Service with MongoDB
 
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 20197 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
7 Database Mistakes YOU Are Making -- Linuxfest Northwest 2019
 
Performant Django - Ara Anjargolian
Performant Django - Ara AnjargolianPerformant Django - Ara Anjargolian
Performant Django - Ara Anjargolian
 
MongoDB Management Service (MMS): Session 01: Getting Started with MMS
MongoDB Management Service (MMS): Session 01: Getting Started with MMSMongoDB Management Service (MMS): Session 01: Getting Started with MMS
MongoDB Management Service (MMS): Session 01: Getting Started with MMS
 
Run MongoDB with Confidence: Backing up and Monitoring with MMS
Run MongoDB with Confidence: Backing up and Monitoring with MMSRun MongoDB with Confidence: Backing up and Monitoring with MMS
Run MongoDB with Confidence: Backing up and Monitoring with MMS
 
MongoDB.local Atlanta: MongoDB @ Sensus: Xylem IoT and MongoDB
MongoDB.local Atlanta: MongoDB @ Sensus: Xylem IoT and MongoDBMongoDB.local Atlanta: MongoDB @ Sensus: Xylem IoT and MongoDB
MongoDB.local Atlanta: MongoDB @ Sensus: Xylem IoT and MongoDB
 
Performance Optimization of Cloud Based Applications by Peter Smith, ACL
Performance Optimization of Cloud Based Applications by Peter Smith, ACLPerformance Optimization of Cloud Based Applications by Peter Smith, ACL
Performance Optimization of Cloud Based Applications by Peter Smith, ACL
 

Último

8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyAnusha Are
 

Último (20)

8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 

Silicon Valley Code Camp 2014 - Advanced MongoDB

  • 1. #MongoDB Advanced MongoDB for Development, Deployment and Operation Daniel Coupal Technical Services Engineer, Palo Alto, CA Silicon Valley Code Camp 2014
  • 2. 2 MongoDB Overview 400+ employees 1,000+ customers 13 offices around the world Over $231 million in funding
  • 3. 3 This presentation is not … • an introduction to MongoDB First steps with MongoDB by Nuri Halperin 5:00 PM Saturday • about code examples Beer Locker: Building a RESTful API with Node.js by Scott Smith 2:45 PM Sunday Get MEAN! MongoDb + express + angular + node by Ward Bell 1:45 PM Saturday Getting RESTless with MeteorJS and MongoDB in the browser by Ryan Jarvinen 2:45 PM Sunday
  • 4. 4 This presentation is about … • Making you successful in developing, deploying and operating an application with MongoDB • I do expect you to know the basics of MongoDB. • …even better if you already have an application about to be deployed
  • 5. 5 Agenda 1. Some Concepts 2. The Story of your Application I. Prototype and Development II. Deployment III. Operation 3. Wrapping up 4. Q&A
  • 7. 7 Some Concepts • Oplog • Working set • MMS • Collection scans • Deployments/elections
  • 8. 8 What is a Replica Set Oplog? • A capped collection that stores an ordered history of logical writes to a MongoDB database – Does not store operations like increment, add to set, etc. Those are translated to the final document. – Safe to replay old oplogs. Needs to play all of them in the right order. • Enables replication • Enables backups
  • 9. 9 Sizing the Oplog collection • The capped collection dictates the amount of hours a secondary/backup agent can stop talking to the primary • MMS Monitoring has a Replication Oplog Window graph • Higher rate of writes to the DBs requires a larger Oplog collection
  • 10. Working set 10 • Working Set: The total body of data+indexes that the application uses in the course of normal operation. – http://docs.mongodb.org/manual/faq/storage/#what-is-the- working-set – MongoDB v2.4 added a working set estimator to the serverStatus command – http://docs.mongodb.org/manual/reference/command/ serverStatus/#serverStatus.workingSet
  • 11. The MMS Components A. Monitoring 1. Cloud: Sept 2011 2. On-Prem: July 2013 B. Backups 1. Cloud: April 2013 2. On-Prem: April 2014 C. Automation 11 1. Cloud: October 2014
  • 12. The MMS User Interface 12
  • 13. Overview of MMS Monitoring 13
  • 14. Overview of MMS Backup 14
  • 15. MMS under the hood: monitoring and backup agents 15
  • 16. Collection scan 16 • Very bad if you have a large collection • One of the main performance issue see in our customers’ application • Can be identified in the logs with the ‘nscanned’ attribute on slow queries
  • 17. Deployments/elections 17 • 3 data nodes • If even number of data nodes, add an arbiter – Don’t use more than one arbiter • Many Data Centers or availability zones • What is important for you? => can be chosen per operation – Durability of writes – Performance
  • 18. 2. The Story of your Application
  • 19. I. Prototype and Development 19 1. Schema, schema, schema! 2. What happens when a failure is returned by the database? 3. Index correctly 4. Incorporate testability in your application 5. Think about data sizing and growth 6. Performance Tuning
  • 20. Think about data sizing and growth 20 • How much data will you have initially? • How will your data set grow over time? • How big is your working set? • Will you be loading huge bulk inserts, or have a constant stream of writes? • How many reads and writes will you need to service per second? • What is the peak load you need to provision for?
  • 21. Performance Tuning 1. Assess the problem and establish acceptable behavior 2. Measure the current performance 3. Find the bottleneck* 4. Remove the bottleneck 5. Re-test to confirm 6. Repeat * - (This is often the hard part) (Adapted from http://en.wikipedia.org/wiki/Performance_tuning ) 21
  • 22. II. Deploy 22 1. Deployment topology 2. Have a test/staging environment – Track slow queries and collection scans 3. MongoDB production notes – http://docs.mongodb.org/manual/administration/production-notes 4. Storage considerations
  • 23. Storage considerations 23 • RAID => 0+1 • NAS, SAN or Direct Attached? => Direct Attached • HDD or SSD => SSD, if budget permit
  • 24. III. Operation 24 1. Monitor 2. Upgrade 3. Backup 4. Troubleshoot
  • 25. Disaster will strike 25 “Shit will happen!” • Are you prepared? • Have backups? • Have a good picture of your “normal state”
  • 26. Monitor 26 • iostat, top, vmstat, sar • mongostat, mongotop • MMS Monitoring – Use Munin extensions
  • 27. Upgrade 27 • Major versions have same binary format, same protocol, etc • MMS Automation handles automatic upgrades
  • 28. Comparing MongoDB backup approaches 28 Mongodump File system MMS Backup Cloud MMS Backup On-Prem Initial complexity Medium High Low High System overhead High Low Low Medium Point in time Yes * No Yes Yes recovery of replica set Consistent snapshot of sharded system Yes * Yes * Yes Yes Scalable No Yes Yes Yes Restore time Slow Fast Medium Medium * Possible, but need to write the tools and go though a lot of pain
  • 30. Common Mistakes 30 1. Missing indexes 2. Not testing before deploying application changes 3. ulimits a. number of open files => 64000 b. number of processes/threads => 64000 4. Appropriate schema 5. Hardware a. right disks for the job b. enough RAM 6. Not seeking help early enough
  • 31. Resources 31 • MongoDB Professional Customer Support – 24x7 support – the sun never set on MongoDB Customer Support Team • MongoDB Consulting Days • MongoDB World (@NYC in June) • MongoDB Days (@SF on Dec 3, 2014) • MongoDB Office Hours • Google Groups
  • 32. Static Resources 32 • MongoDB on-line presentations mongodb.com/presentations • Free MongoDB classes university.mongodb.com • MMS Cloud mms.mongodb.com • MMS Cloud Documentation mms.mongodb.com/help-classic • mtools to analyze MongoDB logs github.com/rueckstiess/mtools
  • 33. Summary 33 • Use available resources • Testing – Plan for it, plan resources for it, do it before deploying
  • 34. Take away 34 I hope you walk out of this presentation and you make at least one single change in your application, deployment, configuration, etc that will prevent one issue from happening.
  • 35. We hire 35 Positions open in Palo Alto, Austin and NYC • http://www.mongodb.com/careers Technical service engineer in Palo Alto • http://www.mongodb.com/careers/ positions/technical-services-engineer
  • 37. Thank you for using Daniel Coupal, Technical Services Engineer