SlideShare a Scribd company logo
MongoDB Conference Berlin 2011




  MongoDB as a
 queryable cache
About me


   •      Martin Tepper
   •      Lead Developer at Travel IQ
   •      http://monogreen.de




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
Contents


   •      About Travel IQ
   •      The problem
   •      The solution
   •      The headaches




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
About Travel IQ


   •      Meta Search Engine for Flights and Hotels
   •      9 Hotel Providers
   •      21 Flight Providers
   •      ~ 6000 searches per day
   •      ~ 64k provider queries per day




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
MongoDB as a fast and queryable cache
About Travel IQ


   •      Real-Time Aggregation
   •      Ruby/Rails based
   •      API-Driven




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
Quick aside


   •      Ruby: OO script language
   •      Rails: MVC Web application framework
   •      ActiveRecord: ORM framework




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
The Problem
Basic Architecture




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
Basic Architecture




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
MongoDB as a fast and queryable cache
Strongly Normalized


   •      Very organized
   •      Reuse of models
   •      Saves disk space
   •      But …




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
sql = <<-SQL
SELECT MIN(outerei.id) FROM
(
   SELECT
    OBJ1.starts_at      AS OBJ1_starts_at,
    OBJ1.ends_at        AS OBJ1_ends_at,
    OBJ1.origin_id      AS OBJ1_origin_id,
    OBJ1.destination_id AS OBJ1_destination_id,
    MIN(P1.price)       AS the_price
    FROM packages P1
    LEFT JOIN journeys OBJ1 ON (P1.outbound_journey_id = OBJ1.id)
    LEFT JOIN results R1 ON (R1.package_id = P1.id)
    LEFT JOIN packagings PA1a ON (PA1a.package_id = P1.id AND PA1a.position = 1)
    LEFT JOIN offers O1a ON (PA1a.offer_id = O1a.id)
    WHERE R1.search_id        IN (#{search_id})
    AND R1.search_type        = 'FlightSearch'
    AND O1a.expires_at        > #{expiring_after}
    GROUP BY
    OBJ1.starts_at, OBJ1.ends_at,
    OBJ1.origin_id, OBJ1.destination_id
  ) AS innerei JOIN (
    SELECT P2.id,
    OBJ2.starts_at      AS OBJ2_starts_at,
    OBJ2.ends_at        AS OBJ2_ends_at,
    OBJ2.origin_id      AS OBJ2_origin_id,
    OBJ2.destination_id AS OBJ2_destination_id,
    P2.price
    FROM packages P2
    LEFT JOIN results R2 ON (R2.package_id = P2.id)
    LEFT JOIN journeys OBJ2 ON (P2.outbound_journey_id = OBJ2.id)
    LEFT JOIN packagings PA2a ON (PA2a.package_id = P2.id AND PA2a.position = 1)
    LEFT JOIN offers O2a ON (PA2a.offer_id = O2a.id)
    WHERE R2.search_id        IN (#{search_id})
The problem


   •      Strongly normalized database
   •      Complex query requirements
   •      Lots of joins
   •      ActiveRecord and rendering overhead
   •      Slow API calls




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
The Solution
Solution 1: Schema


   •      Redo the schema
   •      Migration hard
   •      Some relationships hard to denormalize




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
Solution 2: Memcached


   •      Memcached
   •      Very fast response times
   •      But no real queries
   →      Horrible abstraction layer




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
Memcached response times over time


                                       10,0
response time of api call in seconds




                                        8,0




                                        6,0




                                        4,0




                                        2,0




                                         0
                                              1    2   3   4   5   6   7   8   9   10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45


                                                                                                         seconds after search start



                                                  MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
Solution 3: MongoDB


   •      Document-oriented – less render overhead
   •      Grouping of offers
   •      Proper queries and counts
   •      Still quite fast




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
How we use MongoDB




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
How we use MongoDB


   •      Replica set with 2 nodes and 2 arbiters
   •      Two servers with 16 cores / 64GB RAM
        →      run MySQL and MongoDB
   •      ~ 600 writes/s and reads/s normal load
   •      ~ 6000 writes/s doable




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
MongoDB response times over time


                                       10,0
response time of api call in seconds




                                        8,0




                                        6,0




                                        4,0




                                        2,0




                                         0
                                              1    2   3   4   5   6   7   8   9   10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45


                                                                                                         seconds after search start




                                                  MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
The Headaches
Problems with MongoDB


   •      Segmentation Faults
   •      Only in production




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
Problems with MongoDB


   •      Segmentation Faults
   •      Only in production
   →      Replica Set helped a lot
   →      Fixed with nightly build




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
Problems with MongoDB


   •      Write performance during peak load
   •      Lots of small concurrent writes




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
Problems with MongoDB


   •      Write performance during peak load
   •      Lots of small concurrent writes
   →      Solved by bundling writes




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
Problems with MongoDB


   •      Hotel data too big to denormalize
   •      In separate collection




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
Problems with MongoDB


   •      Hotel data too big to denormalize
   •      In separate collection
   →      Solved with app-level “join“




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
Problems with MongoDB


   •      Data consistency
   •      Typical caching problem
   •      Updates to MySQL also in MongoDB




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
Problems with MongoDB


   •      Data consistency
   •      Typical caching problem
   •      Updates to MySQL also in MongoDB
   →      Solved with callbacks in ActiveRecord




MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
Thank you

More Related Content

KEY
Hybrid MongoDB and RDBMS Applications
KEY
MongoDB, E-commerce and Transactions
PDF
NoSQL into E-Commerce: lessons learned
PDF
Using MongoDB and a Relational Database at MongoDB Day
PDF
MongoDB vs OrientDB
PPTX
A Presentation on MongoDB Introduction - Habilelabs
PDF
Migrating from RDBMS to MongoDB
PDF
Introduction to MongoDB
Hybrid MongoDB and RDBMS Applications
MongoDB, E-commerce and Transactions
NoSQL into E-Commerce: lessons learned
Using MongoDB and a Relational Database at MongoDB Day
MongoDB vs OrientDB
A Presentation on MongoDB Introduction - Habilelabs
Migrating from RDBMS to MongoDB
Introduction to MongoDB

What's hot (20)

PDF
Common MongoDB Use Cases
PPTX
Migrating from MongoDB to Neo4j - Lessons Learned
KEY
CouchDB introduction
PPTX
Why MongoDB over other Databases - Habilelabs
PPT
MongoDB Pros and Cons
PDF
Intro to NoSQL and MongoDB
PDF
Using Spring with NoSQL databases (SpringOne China 2012)
PDF
Introduction to couchdb
PPTX
Mongo db intro.pptx
PPTX
3 scenarios when to use MongoDB!
PPT
Introduction to MongoDB
PPTX
An Introduction To NoSQL & MongoDB
PPTX
TechEd AU 2014: Microsoft Azure DocumentDB Deep Dive
KEY
NoSQL: Why, When, and How
PDF
No sql way_in_pg
PDF
Why we love ArangoDB. The hunt for the right NosQL Database
PPTX
Webinar: What's new in the .NET Driver
PDF
Webinar: Serverless Architectures with AWS Lambda and MongoDB Atlas
PDF
Developing polyglot persistence applications (SpringOne India 2012)
PDF
Professional Frontend Engineering
Common MongoDB Use Cases
Migrating from MongoDB to Neo4j - Lessons Learned
CouchDB introduction
Why MongoDB over other Databases - Habilelabs
MongoDB Pros and Cons
Intro to NoSQL and MongoDB
Using Spring with NoSQL databases (SpringOne China 2012)
Introduction to couchdb
Mongo db intro.pptx
3 scenarios when to use MongoDB!
Introduction to MongoDB
An Introduction To NoSQL & MongoDB
TechEd AU 2014: Microsoft Azure DocumentDB Deep Dive
NoSQL: Why, When, and How
No sql way_in_pg
Why we love ArangoDB. The hunt for the right NosQL Database
Webinar: What's new in the .NET Driver
Webinar: Serverless Architectures with AWS Lambda and MongoDB Atlas
Developing polyglot persistence applications (SpringOne India 2012)
Professional Frontend Engineering
Ad

Viewers also liked (20)

PDF
Synchronise your data between MySQL and MongoDB
PPTX
MongoDB Schema Design: Four Real-World Examples
PPTX
MongoDB 3.0
DOCX
Shruthi_GV_Resume
PDF
Independent practice association, what you need to know
PPTX
OpenStackで始めるクラウド環境構築入門
PPT
Operation management
PDF
Role of Pharma Brand Manager
PPTX
Marketing management process
PDF
Structure of a Feature Story
PPTX
4 modes of transportation
PPT
Enterprise Systems
PDF
Summary of kotler's marketing management book
PDF
Introduction to Real-Time Data Processing
PPTX
Fat stranding
PDF
内容组织
PPTX
Best Practices for Security in Microsoft SharePoint 2013
PPTX
Synchronise your data between MySQL and MongoDB
MongoDB Schema Design: Four Real-World Examples
MongoDB 3.0
Shruthi_GV_Resume
Independent practice association, what you need to know
OpenStackで始めるクラウド環境構築入門
Operation management
Role of Pharma Brand Manager
Marketing management process
Structure of a Feature Story
4 modes of transportation
Enterprise Systems
Summary of kotler's marketing management book
Introduction to Real-Time Data Processing
Fat stranding
内容组织
Best Practices for Security in Microsoft SharePoint 2013
Ad

Similar to MongoDB as a fast and queryable cache (20)

KEY
Mongo scaling
KEY
2012 phoenix mug
PPTX
Back to Basics Webinar 2 - Your First MongoDB Application
PPTX
Back to Basics Webinar 2: Your First MongoDB Application
PDF
SQL? NoSQL? NewSQL?!? What's a Java developer to do? - PhillyETE 2012
PPTX
Conceptos básicos. Seminario web 2: Su primera aplicación MongoDB
PDF
MongoDB and Play! Framework workshop
PDF
Optimizing Slow Queries with Indexes and Creativity
PPTX
Back to Basics: My First MongoDB Application
PPTX
Back to Basics 2017 - Your First MongoDB Application
PDF
MongoDB@sfr.fr
KEY
Schema Design with MongoDB
PDF
MongoDB Tokyo - Monitoring and Queueing
PDF
Mongodb in-anger-boston-rb-2011
KEY
Building Your First MongoDB Application
PDF
10gen Presents Schema Design and Data Modeling
KEY
PPTX
First app online conf
PPTX
Scaling with MongoDB
PDF
Building Apps with MongoDB
Mongo scaling
2012 phoenix mug
Back to Basics Webinar 2 - Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB Application
SQL? NoSQL? NewSQL?!? What's a Java developer to do? - PhillyETE 2012
Conceptos básicos. Seminario web 2: Su primera aplicación MongoDB
MongoDB and Play! Framework workshop
Optimizing Slow Queries with Indexes and Creativity
Back to Basics: My First MongoDB Application
Back to Basics 2017 - Your First MongoDB Application
MongoDB@sfr.fr
Schema Design with MongoDB
MongoDB Tokyo - Monitoring and Queueing
Mongodb in-anger-boston-rb-2011
Building Your First MongoDB Application
10gen Presents Schema Design and Data Modeling
First app online conf
Scaling with MongoDB
Building Apps with MongoDB

More from MongoDB (20)

PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
PDF
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
PDF
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
PDF
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
PDF
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
PDF
MongoDB SoCal 2020: MongoDB Atlas Jump Start
PDF
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
PDF
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
PDF
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
PDF
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
PDF
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
PDF
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
PDF
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
PDF
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
PDF
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
PDF
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...

Recently uploaded (20)

PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Big Data Technologies - Introduction.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
Teaching material agriculture food technology
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Machine learning based COVID-19 study performance prediction
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Approach and Philosophy of On baking technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Mobile App Security Testing_ A Comprehensive Guide.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Big Data Technologies - Introduction.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Teaching material agriculture food technology
sap open course for s4hana steps from ECC to s4
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Machine learning based COVID-19 study performance prediction
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Approach and Philosophy of On baking technology
The AUB Centre for AI in Media Proposal.docx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
The Rise and Fall of 3GPP – Time for a Sabbatical?
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...

MongoDB as a fast and queryable cache

  • 1. MongoDB Conference Berlin 2011 MongoDB as a queryable cache
  • 2. About me • Martin Tepper • Lead Developer at Travel IQ • http://monogreen.de MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 3. Contents • About Travel IQ • The problem • The solution • The headaches MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 4. About Travel IQ • Meta Search Engine for Flights and Hotels • 9 Hotel Providers • 21 Flight Providers • ~ 6000 searches per day • ~ 64k provider queries per day MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 6. About Travel IQ • Real-Time Aggregation • Ruby/Rails based • API-Driven MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 7. Quick aside • Ruby: OO script language • Rails: MVC Web application framework • ActiveRecord: ORM framework MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 9. Basic Architecture MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 10. Basic Architecture MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 12. Strongly Normalized • Very organized • Reuse of models • Saves disk space • But … MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 13. sql = <<-SQL SELECT MIN(outerei.id) FROM ( SELECT OBJ1.starts_at AS OBJ1_starts_at, OBJ1.ends_at AS OBJ1_ends_at, OBJ1.origin_id AS OBJ1_origin_id, OBJ1.destination_id AS OBJ1_destination_id, MIN(P1.price) AS the_price FROM packages P1 LEFT JOIN journeys OBJ1 ON (P1.outbound_journey_id = OBJ1.id) LEFT JOIN results R1 ON (R1.package_id = P1.id) LEFT JOIN packagings PA1a ON (PA1a.package_id = P1.id AND PA1a.position = 1) LEFT JOIN offers O1a ON (PA1a.offer_id = O1a.id) WHERE R1.search_id IN (#{search_id}) AND R1.search_type = 'FlightSearch' AND O1a.expires_at > #{expiring_after} GROUP BY OBJ1.starts_at, OBJ1.ends_at, OBJ1.origin_id, OBJ1.destination_id ) AS innerei JOIN ( SELECT P2.id, OBJ2.starts_at AS OBJ2_starts_at, OBJ2.ends_at AS OBJ2_ends_at, OBJ2.origin_id AS OBJ2_origin_id, OBJ2.destination_id AS OBJ2_destination_id, P2.price FROM packages P2 LEFT JOIN results R2 ON (R2.package_id = P2.id) LEFT JOIN journeys OBJ2 ON (P2.outbound_journey_id = OBJ2.id) LEFT JOIN packagings PA2a ON (PA2a.package_id = P2.id AND PA2a.position = 1) LEFT JOIN offers O2a ON (PA2a.offer_id = O2a.id) WHERE R2.search_id IN (#{search_id})
  • 14. The problem • Strongly normalized database • Complex query requirements • Lots of joins • ActiveRecord and rendering overhead • Slow API calls MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 16. Solution 1: Schema • Redo the schema • Migration hard • Some relationships hard to denormalize MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 17. Solution 2: Memcached • Memcached • Very fast response times • But no real queries → Horrible abstraction layer MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 18. Memcached response times over time 10,0 response time of api call in seconds 8,0 6,0 4,0 2,0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 seconds after search start MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 19. Solution 3: MongoDB • Document-oriented – less render overhead • Grouping of offers • Proper queries and counts • Still quite fast MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 20. How we use MongoDB MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 21. How we use MongoDB • Replica set with 2 nodes and 2 arbiters • Two servers with 16 cores / 64GB RAM → run MySQL and MongoDB • ~ 600 writes/s and reads/s normal load • ~ 6000 writes/s doable MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 22. MongoDB response times over time 10,0 response time of api call in seconds 8,0 6,0 4,0 2,0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 seconds after search start MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 24. Problems with MongoDB • Segmentation Faults • Only in production MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 25. Problems with MongoDB • Segmentation Faults • Only in production → Replica Set helped a lot → Fixed with nightly build MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 26. Problems with MongoDB • Write performance during peak load • Lots of small concurrent writes MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 27. Problems with MongoDB • Write performance during peak load • Lots of small concurrent writes → Solved by bundling writes MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 28. Problems with MongoDB • Hotel data too big to denormalize • In separate collection MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 29. Problems with MongoDB • Hotel data too big to denormalize • In separate collection → Solved with app-level “join“ MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 30. Problems with MongoDB • Data consistency • Typical caching problem • Updates to MySQL also in MongoDB MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25
  • 31. Problems with MongoDB • Data consistency • Typical caching problem • Updates to MySQL also in MongoDB → Solved with callbacks in ActiveRecord MongoDB as a queryable cache · Martin Tepper, monogreen.de · 2011-03-25