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.
The Right (And Wrong) Use Cases for MongoDB 
Damon LaCaille 
damon.lacaille@mongodb.com
We’ll be covering... 
• About MongoDB 
• Benefits of using MongoDB 
• Specific Use Cases 
– Good: Single View, Mobile, Ana...
About MongoDB
Benefits of MongoDB 
• Performance 
• Availability and Scalability 
• Data Model 
• Query Model
Benefits of MongoDB 
Performance 
Scalability and Performance 
Depth of Functionality
Benefits of MongoDB 
Performance 
Scalability and Performance 
Key/Value Stores 
Cache Only 
Depth of Functionality
Benefits of MongoDB 
Performance 
Scalability and Performance 
Key/Value Stores 
Depth of Functionality 
RDBMS 
Cache Only...
Benefits of MongoDB 
Performance 
Scalability and Performance 
Key/Value Stores 
MongoDB 
Depth of Functionality 
RDBMS 
M...
Benefits of MongoDB 
Availability and Scalability 
Application 
mongod 
mongod 
mongod
Benefits of MongoDB 
Availability and Scalability 
Application 
mongod 
mongod 
mongod 
mongod 
mongod 
mongod 
mongos 
[A...
Benefits of MongoDB 
Availability and Scalability 
Application 
mongod 
mongod 
mongod 
mongod 
mongod 
mongod 
mongos | m...
Benefits of MongoDB 
RDBMS -Hard to Make Changes 
New 
Table 
New 
Table 
New 
Column 
Name Age Phone Email
Benefits of MongoDB 
RDBMS vs. Document Data Model 
Mental model 
Relational model
Benefits of MongoDB 
RDBMS vs. Document Data Model 
Mental model 
Document model
Benefits of MongoDB 
{ 
: ‘Paul’, 
surname: ‘Miller’, 
cell: ‘+447557505611’ 
location: [45.123,47.232], 
profession: [ban...
Benefits of MongoDB 
{ 
: ‘Paul’, 
surname: ‘Miller’, 
cell: ‘+447557505611’ 
location: [45.123,47.232], 
profession: [ban...
Benefits of MongoDB 
{ 
: ‘Paul’, 
surname: ‘Miller’, 
cell: ‘+447557505611’ 
location: [45.123,47.232], 
profession: [ban...
Benefits of MongoDB 
{ 
: ‘Paul’, 
surname: ‘Miller’, 
cell: ‘+447557505611’ 
location: [45.123,47.232], 
profession: [ban...
Benefits of MongoDB 
{ 
: ‘Paul’, 
surname: ‘Miller’, 
cell: ‘+447557505611’ 
location: [45.123,47.232], 
profession: [ban...
Benefits of MongoDB 
Rich Query Model 
{ 
: ‘Paul’, 
surname: ‘Miller’, 
cell: ‘+447557505611’ 
location: [45.123,47.232],...
Benefits of MongoDB 
Relational Database Challenges
Benefits of MongoDB 
Relational Database Challenges 
• Data Types 
• Unstructured data 
• Semi-structured data 
• Polymorp...
Benefits of MongoDB 
Relational Database Challenges 
• Data Types 
• Unstructured data 
• Semi-structured data 
• Polymorp...
Benefits of MongoDB 
Relational Database Challenges 
• Data Types 
• Unstructured data 
• Semi-structured data 
• Polymorp...
Benefits of MongoDB 
Relational Database Challenges 
• Data Types 
• Unstructured data 
• Semi-structured data 
• Polymorp...
Good Use Cases
Use Cases 
• Applications never before 
possible 
• Volume, Variety, Velocity 
• Developer Productivity
Use Case - Single View
Use Case - Single View 
• 70+ systems 
• 50 million policies 
• 118 million customers 
• 190 million documents
Use Case - Single View 
• 70+ systems 
• 50 million policies 
• 118 million customers 
• 190 million documents
Use Case - Single View 
• 70+ systems 
• 50 million policies 
• 118 million customers 
• 190 million documents 
• Rolling ...
Use Case -Mobile
Use Case -Mobile
Use Case -Mobile
Use Case -Mobile 
• 2 million requests per day 
• 40 million users w/ alerts
Use Case -Mobile 
• 2 million requests per day 
• 40 million users w/ alerts 
• Mobile backend as a service for Facebook 
...
Use Case -Analytics
Use Case -Analytics
Use Case -Analytics 
• Pairs MongoDB-powered analytics with visual maps 
• Provides real-time and historical information 
...
Use Case -Analytics 
• Pairs MongoDB-powered analytics with visual maps 
• Provides real-time and historical information 
...
Use Case -Analytics 
Real Time Analytics 
• Light-weight analytics very quickly 
• Sub-second response times 
• High avail...
Use Case -Analytics 
Real Time Analytics Batch Analytics 
• Complex, long-running analyses 
• Slower response times (minut...
Use Case -Analytics 
Informs 
Populates
“Bad” Use Cases
Use Case - Cache Only
Wrong Use Case 
• Developer productivity and satisfaction is not a concern for 
you 
• Limited vertical scalability is a c...
Upcoming SlideShare
Loading in …5
×

The Right (and Wrong) Use Cases for MongoDB

13,045 views

Published on

Learn which use cases are an ideal fit for MongoDB.

Published in: Technology

The Right (and Wrong) Use Cases for MongoDB

  1. 1. The Right (And Wrong) Use Cases for MongoDB Damon LaCaille damon.lacaille@mongodb.com
  2. 2. We’ll be covering... • About MongoDB • Benefits of using MongoDB • Specific Use Cases – Good: Single View, Mobile, Analytics – Not So Good... • Q&A
  3. 3. About MongoDB
  4. 4. Benefits of MongoDB • Performance • Availability and Scalability • Data Model • Query Model
  5. 5. Benefits of MongoDB Performance Scalability and Performance Depth of Functionality
  6. 6. Benefits of MongoDB Performance Scalability and Performance Key/Value Stores Cache Only Depth of Functionality
  7. 7. Benefits of MongoDB Performance Scalability and Performance Key/Value Stores Depth of Functionality RDBMS Cache Only Highly Transactional
  8. 8. Benefits of MongoDB Performance Scalability and Performance Key/Value Stores MongoDB Depth of Functionality RDBMS Mobile Content Mgmt. Analytics Cache Only Highly Transactional Internet of Things Single View Personalization Catalog
  9. 9. Benefits of MongoDB Availability and Scalability Application mongod mongod mongod
  10. 10. Benefits of MongoDB Availability and Scalability Application mongod mongod mongod mongod mongod mongod mongos [A-L] [M-Z]
  11. 11. Benefits of MongoDB Availability and Scalability Application mongod mongod mongod mongod mongod mongod mongos | mongos | mongos mongod mongod mongod mongod mongod mongod mongod mongod mongod [A-E] [P-T] [F-J] [K-O] [U-Z]
  12. 12. Benefits of MongoDB RDBMS -Hard to Make Changes New Table New Table New Column Name Age Phone Email
  13. 13. Benefits of MongoDB RDBMS vs. Document Data Model Mental model Relational model
  14. 14. Benefits of MongoDB RDBMS vs. Document Data Model Mental model Document model
  15. 15. Benefits of MongoDB { : ‘Paul’, surname: ‘Miller’, cell: ‘+447557505611’ location: [45.123,47.232], profession: [banking, finance, trader], cars: [ { model: ‘Bentley’, year: 1973, value: 100000, … }, { model: ‘Rolls Royce’, year: 1965, value: 330000, … } ] } Natural Data Model
  16. 16. Benefits of MongoDB { : ‘Paul’, surname: ‘Miller’, cell: ‘+447557505611’ location: [45.123,47.232], profession: [banking, finance, trader], cars: [ { model: ‘Bentley’, year: 1973, value: 100000, … }, { model: ‘Rolls Royce’, year: 1965, value: 330000, … } ] } Natural Data Model Field Names
  17. 17. Benefits of MongoDB { : ‘Paul’, surname: ‘Miller’, cell: ‘+447557505611’ location: [45.123,47.232], profession: [banking, finance, trader], cars: [ { model: ‘Bentley’, year: 1973, value: 100000, … }, { model: ‘Rolls Royce’, year: 1965, value: 330000, … } ] } Natural Data Model Field Names Typed field values
  18. 18. Benefits of MongoDB { : ‘Paul’, surname: ‘Miller’, cell: ‘+447557505611’ location: [45.123,47.232], profession: [banking, finance, trader], cars: [ { model: ‘Bentley’, year: 1973, value: 100000, … }, { model: ‘Rolls Royce’, year: 1965, value: 330000, … } ] } Natural Data Model Field Names Typed field values Fields can contain arrays
  19. 19. Benefits of MongoDB { : ‘Paul’, surname: ‘Miller’, cell: ‘+447557505611’ location: [45.123,47.232], profession: [banking, finance, trader], cars: [ { model: ‘Bentley’, year: 1973, value: 100000, … }, { model: ‘Rolls Royce’, year: 1965, value: 330000, … } ] } Natural Data Model Field Names Typed field values Fields can contain arrays } Fields can contain an array of sub-documents
  20. 20. Benefits of MongoDB Rich Query Model { : ‘Paul’, surname: ‘Miller’, cell: ‘+447557505611’ location: [45.123,47.232], profession: [banking, finance, trader], cars: [ { model: ‘Bentley’, year: 1973, value: 100000, … }, { model: ‘Rolls Royce’, year: 1965, value: 330000, … } ] } Rich Queries • Find Paul’s car • Find everybody in London with a car built between 1970 and 1980 Geo • Find all car owners within 10m of Manhattan Text Search • Find all cars whose VIN starts with ZA1 Aggregation • Calculate the average value of Paul’s car collection Map Reduce • What is the ownership pattern of colors by geography over time? (Is silver trending up in the US?)
  21. 21. Benefits of MongoDB Relational Database Challenges
  22. 22. Benefits of MongoDB Relational Database Challenges • Data Types • Unstructured data • Semi-structured data • Polymorphic data
  23. 23. Benefits of MongoDB Relational Database Challenges • Data Types • Unstructured data • Semi-structured data • Polymorphic data • Agile Development • Iterative • Short development cycles • New workloads
  24. 24. Benefits of MongoDB Relational Database Challenges • Data Types • Unstructured data • Semi-structured data • Polymorphic data • Agile Development • Iterative • Short development cycles • New workloads • New Architectures • Horizontal scaling • Commodity servers • Cloud computing
  25. 25. Benefits of MongoDB Relational Database Challenges • Data Types • Unstructured data • Semi-structured data • Polymorphic data • Agile Development • Iterative • Short development cycles • New workloads • Volume of Data • Petabytes of data • Trillions of records • Millions of queries per second • New Architectures • Horizontal scaling • Commodity servers • Cloud computing
  26. 26. Good Use Cases
  27. 27. Use Cases • Applications never before possible • Volume, Variety, Velocity • Developer Productivity
  28. 28. Use Case - Single View
  29. 29. Use Case - Single View • 70+ systems • 50 million policies • 118 million customers • 190 million documents
  30. 30. Use Case - Single View • 70+ systems • 50 million policies • 118 million customers • 190 million documents
  31. 31. Use Case - Single View • 70+ systems • 50 million policies • 118 million customers • 190 million documents • Rolling out internationally • A version for its sales force • Real time prediction of customer attrition rates.
  32. 32. Use Case -Mobile
  33. 33. Use Case -Mobile
  34. 34. Use Case -Mobile
  35. 35. Use Case -Mobile • 2 million requests per day • 40 million users w/ alerts
  36. 36. Use Case -Mobile • 2 million requests per day • 40 million users w/ alerts • Mobile backend as a service for Facebook • 270,000+ apps • Unknown workload types • API requests growing 500% annually
  37. 37. Use Case -Analytics
  38. 38. Use Case -Analytics
  39. 39. Use Case -Analytics • Pairs MongoDB-powered analytics with visual maps • Provides real-time and historical information • Finds trends and relationships
  40. 40. Use Case -Analytics • Pairs MongoDB-powered analytics with visual maps • Provides real-time and historical information • Finds trends and relationships What’s next? The SmartData Platform • Predict best ways to cut traffic congestion • Analyze energy usage trends to improve efficiency • Map crime stats and city data relationships so crime can actually be reduced
  41. 41. Use Case -Analytics Real Time Analytics • Light-weight analytics very quickly • Sub-second response times • High availability requirements
  42. 42. Use Case -Analytics Real Time Analytics Batch Analytics • Complex, long-running analyses • Slower response times (minutes/days) • Lower availability requirements • Light-weight analytics very quickly • Sub-second response times • High availability requirements
  43. 43. Use Case -Analytics Informs Populates
  44. 44. “Bad” Use Cases
  45. 45. Use Case - Cache Only
  46. 46. Wrong Use Case • Developer productivity and satisfaction is not a concern for you • Limited vertical scalability is a comfort blanket • “It’s always been done this way” • You can see the future and know all possibilities for your schema

×