Your SlideShare is downloading. ×
0
Technical Evangelist,MongoDB

@tgrall
Tugdual “Tug” Grall
@Neotys
SQLvs NoSQL Performance
A MongoDB perspective
@tgralltug@mongodb.com
{ “about” : “me” }
Tugdual“Tug”Grall
• MongoDB
• Technical Evangelist
• Couchbase
• Technical Evang...
Why MongoDB ?
@tgralltug@mongodb.com
Relational Database
@tgralltug@mongodb.com
@tgralltug@mongodb.com
And makes things hard to change
Name Age Phone Email
New Column
New Table
New Table
New Column
@tgralltug@mongodb.com
It runs on expensive hardware
“Clients can also opt to run zEC12 without a raised
datacenter floor ...
@tgralltug@mongodb.com
This was a problem for Google
250,000+MBP’s==4.1miles
2010 Search Index Size: !
100,000,000 GB
New ...
@tgralltug@mongodb.com
And for Facebook
What is MongoDB?
@tgralltug@mongodb.com
MongoDB Vision
To provide the best database for how we build and run
apps today
Build
• New and com...
@tgralltug@mongodb.com
Documents are easier
Relational MongoDB
{	
  
	
  	
  first_name:	
  "Paul",
	
  	
  surname:	
  "M...
@tgralltug@mongodb.com
Full Featured
Queries
• Find Paul’s cars
• Find everybody in London with a car built
between 1970 a...
@tgralltug@mongodb.com
Easier and Cheaper to Scale
Vs.
Price
Scale
Price
Scale
@tgralltug@mongodb.com
7,000,000+
MongoDB Downloads
150,000+
Online Education Registrants
25,000+
MongoDB User Group Membe...
@tgralltug@mongodb.com
MongoDB Use Cases
16
Big Data Product & Asset
Catalogs
Security & 

Fraud
Internet of
Things
Databa...
MongoDB Deployments
@tgralltug@mongodb.com
High Availability : Replication
@tgralltug@mongodb.com
Horizontal Scalability: Sharding
Shard 1 Shard 1 Shard nShard 1 …
Horizontally Scalable
@tgralltug@mongodb.com
MongoDB Architecture
@tgralltug@mongodb.com
Multi Data Center
Performance
MongoDB is a Distributed Database
Insert Update Delete Query Aggregations
@tgralltug@mongodb.com
Queries
@tgralltug@mongodb.com
Analyze Query Performance
• Use query explain() cursor method
• Use Database Profiler to find slow ...
@tgralltug@mongodb.com
Monitoring the system
@tgralltug@mongodb.com
Monitor: What to look?
Locks Avoid long running operations that could slow down the database
Page F...
@tgralltug@mongodb.com
Many tools / Many Metrics
• MMS : MongoDB Management Services
• CLI and RESTAPI
• Neotys
More..
You must prepare your deployment
@tgralltug@mongodb.com
The most important part
@tgralltug@mongodb.com
Node 1
Secondary
Config
Server
Node 1
Secondary
Config
Server
Node 1
Secondary
Config
Server
Shard Sha...
@tgralltug@mongodb.com
Example : email storage
Cardinality!
Write
Scaling!
Query
Isolation!
Reliability!
Index!
Locality!
...
Conclusion
@tgralltug@mongodb.com
Conclusion
• MongoDB is a general purpose database
• Document Design
• Create Index and check the e...
Questions?
@tgrall
@neotys
ThankYou
Upcoming SlideShare
Loading in...5
×

Neotys conference

370

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
370
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
19
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Neotys conference"

  1. 1. Technical Evangelist,MongoDB
 @tgrall Tugdual “Tug” Grall @Neotys SQLvs NoSQL Performance A MongoDB perspective
  2. 2. @tgralltug@mongodb.com { “about” : “me” } Tugdual“Tug”Grall • MongoDB • Technical Evangelist • Couchbase • Technical Evangelist • eXo • CTO • Oracle • Developer/Product Manager • Mainly Java/SOA • Developer in consulting firms • Web • @tgrall • http://blog.grallandco.com • tgrall • NantesJUG co-founder • Pet Project : • http://www.resultri.com • tug@mongodb.com • tugdual@gmail.com
  3. 3. Why MongoDB ?
  4. 4. @tgralltug@mongodb.com Relational Database
  5. 5. @tgralltug@mongodb.com
  6. 6. @tgralltug@mongodb.com And makes things hard to change Name Age Phone Email New Column New Table New Table New Column
  7. 7. @tgralltug@mongodb.com It runs on expensive hardware “Clients can also opt to run zEC12 without a raised datacenter floor -- a first for high-end IBM mainframes.” ! ! IBM Press Release 28 Aug, 2012!
  8. 8. @tgralltug@mongodb.com This was a problem for Google 250,000+MBP’s==4.1miles 2010 Search Index Size: ! 100,000,000 GB New data added per day! 100,000+ GB Databases they could use! 0
  9. 9. @tgralltug@mongodb.com And for Facebook
  10. 10. What is MongoDB?
  11. 11. @tgralltug@mongodb.com MongoDB Vision To provide the best database for how we build and run apps today Build • New and complex data • Flexible • New languages • Faster development Run • Big Data scalability • Real-time • Commodity hardware • Cloud
  12. 12. @tgralltug@mongodb.com Documents are easier Relational MongoDB {      first_name:  "Paul",    surname:  "Miller",    city:  "London",    location:  [45.123,47.232],    cars:  [          {  model:  "Bentley",            year:  1973,            value:  100000,  …  },        {  model:  "Rolls  Royce",              year:  1965,              value:  330000,  …  }      ] }
  13. 13. @tgralltug@mongodb.com Full Featured Queries • Find Paul’s cars • Find everybody in London with a car built between 1970 and 1980 Geospatial • Find all of the car owners within 5km of Trafalgar Sq. Text Search • Find all the cars described as having leather seats Aggregation • Calculate the average value of Paul’s car collection Map Reduce • What is the ownership pattern of colors by geography over time? (is purple trending up in China?) { first_name: ‘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, … } } }
  14. 14. @tgralltug@mongodb.com Easier and Cheaper to Scale Vs. Price Scale Price Scale
  15. 15. @tgralltug@mongodb.com 7,000,000+ MongoDB Downloads 150,000+ Online Education Registrants 25,000+ MongoDB User Group Members 25,000+ MongoDB Management Service (MMS) Users 20,000+ MongoDB Days Attendees
  16. 16. @tgralltug@mongodb.com MongoDB Use Cases 16 Big Data Product & Asset Catalogs Security & 
 Fraud Internet of Things Database-as-a- Service Mobile 
 Apps Customer Data Management Data 
 Hub Social & Collaboration Content Management Intelligence Agencies Top Investment and Retail Banks Top US Retailer Top Global Shipping Company Top Industrial Equipment Manufacturer Top Media Company Top Investment and Retail Banks
  17. 17. MongoDB Deployments
  18. 18. @tgralltug@mongodb.com High Availability : Replication
  19. 19. @tgralltug@mongodb.com Horizontal Scalability: Sharding Shard 1 Shard 1 Shard nShard 1 … Horizontally Scalable
  20. 20. @tgralltug@mongodb.com MongoDB Architecture
  21. 21. @tgralltug@mongodb.com Multi Data Center
  22. 22. Performance
  23. 23. MongoDB is a Distributed Database Insert Update Delete Query Aggregations
  24. 24. @tgralltug@mongodb.com Queries
  25. 25. @tgralltug@mongodb.com Analyze Query Performance • Use query explain() cursor method • Use Database Profiler to find slow queries db.inventory.find( { type: 'food' } ).explain()! ! {! "cursor" : "BtreeCursor type_1",! "isMultiKey" : false,! "n" : 5,! "nscannedObjects" : 5,! "nscanned" : 5,! "nscannedObjectsAllPlans" : 5,! "nscannedAllPlans" : 5,! …! "scanAndOrder" : false,! "millis" : 0,! "indexBounds" : { "type" : [! [ "food",! "food" ]! ] },! "server" : "mongodbo0.example.net:27017" }
  26. 26. @tgralltug@mongodb.com Monitoring the system
  27. 27. @tgralltug@mongodb.com Monitor: What to look? Locks Avoid long running operations that could slow down the database Page Faults Check that the working set stays in RAM, reduce I/O operations Nbr of Connections Reduce RAM consumption Replication Lag Time to copy the data to secondaries OpLog Size Size of the replication queue Chunk Distribution Data should be balanced on all the nodes
  28. 28. @tgralltug@mongodb.com Many tools / Many Metrics • MMS : MongoDB Management Services • CLI and RESTAPI • Neotys
  29. 29. More..
  30. 30. You must prepare your deployment
  31. 31. @tgralltug@mongodb.com The most important part
  32. 32. @tgralltug@mongodb.com Node 1 Secondary Config Server Node 1 Secondary Config Server Node 1 Secondary Config Server Shard Shard Shard Mongos App Server Mongos App Server Mongos App Server A good shard key
  33. 33. @tgralltug@mongodb.com Example : email storage Cardinality! Write Scaling! Query Isolation! Reliability! Index! Locality! _id! Doc level! One shard! Scatter/ gather! All users affected! Good! hash(_id)! Hash level! All Shards! Scatter/ gather! All users affected! Poor! user! Many docs! All Shards! Targeted Some users affected Good! user, time! Doc level! All Shards! Targeted! Some users affected Good!
  34. 34. Conclusion
  35. 35. @tgralltug@mongodb.com Conclusion • MongoDB is a general purpose database • Document Design • Create Index and check the explain plans • MongoDB is a distributed database • Choose the shard key wisely • MongoDB use replication • Check OpLog and Replication Lag • Monitor all these with tools
  36. 36. Questions?
  37. 37. @tgrall @neotys ThankYou
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×