SlideShare uma empresa Scribd logo
1 de 32
Baixar para ler offline
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
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
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

Mais conteúdo relacionado

Destaque

Synchronise your data between MySQL and MongoDB
Synchronise your data between MySQL and MongoDBSynchronise your data between MySQL and MongoDB
Synchronise your data between MySQL and MongoDBGiuseppe Maxia
 
MongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMike Friedman
 
Independent practice association, what you need to know
Independent practice association, what you need to knowIndependent practice association, what you need to know
Independent practice association, what you need to knowARBYRNE
 
OpenStackで始めるクラウド環境構築入門
OpenStackで始めるクラウド環境構築入門OpenStackで始めるクラウド環境構築入門
OpenStackで始めるクラウド環境構築入門VirtualTech Japan Inc.
 
Operation management
Operation managementOperation management
Operation managementShanta Mishra
 
STABLE Course Notes
STABLE Course NotesSTABLE Course Notes
STABLE Course NotesAlan Batt
 
Role of Pharma Brand Manager
Role of Pharma Brand ManagerRole of Pharma Brand Manager
Role of Pharma Brand ManagerThe Enablers
 
Structure of a Feature Story
Structure of a Feature StoryStructure of a Feature Story
Structure of a Feature StoryPirita Juppi
 
4 modes of transportation
4 modes of transportation4 modes of transportation
4 modes of transportationcadimsda
 
Enterprise Systems
Enterprise SystemsEnterprise Systems
Enterprise SystemsSaurabh Goel
 
Summary of kotler's marketing management book
Summary of kotler's marketing management bookSummary of kotler's marketing management book
Summary of kotler's marketing management bookSasquatch S
 
Introduction to Real-Time Data Processing
Introduction to Real-Time Data ProcessingIntroduction to Real-Time Data Processing
Introduction to Real-Time Data ProcessingApache Apex
 
内容组织
内容组织内容组织
内容组织flydream
 
Best Practices for Security in Microsoft SharePoint 2013
Best Practices for Security in Microsoft SharePoint 2013Best Practices for Security in Microsoft SharePoint 2013
Best Practices for Security in Microsoft SharePoint 2013AntonioMaio2
 

Destaque (20)

Synchronise your data between MySQL and MongoDB
Synchronise your data between MySQL and MongoDBSynchronise your data between MySQL and MongoDB
Synchronise your data between MySQL and MongoDB
 
MongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World Examples
 
MongoDB 3.0
MongoDB 3.0 MongoDB 3.0
MongoDB 3.0
 
Shruthi_GV_Resume
Shruthi_GV_ResumeShruthi_GV_Resume
Shruthi_GV_Resume
 
Independent practice association, what you need to know
Independent practice association, what you need to knowIndependent practice association, what you need to know
Independent practice association, what you need to know
 
OpenStackで始めるクラウド環境構築入門
OpenStackで始めるクラウド環境構築入門OpenStackで始めるクラウド環境構築入門
OpenStackで始めるクラウド環境構築入門
 
Operation management
Operation managementOperation management
Operation management
 
STABLE Course Notes
STABLE Course NotesSTABLE Course Notes
STABLE Course Notes
 
Role of Pharma Brand Manager
Role of Pharma Brand ManagerRole of Pharma Brand Manager
Role of Pharma Brand Manager
 
Marketing management process
Marketing management processMarketing management process
Marketing management process
 
Structure of a Feature Story
Structure of a Feature StoryStructure of a Feature Story
Structure of a Feature Story
 
4 modes of transportation
4 modes of transportation4 modes of transportation
4 modes of transportation
 
Enterprise Systems
Enterprise SystemsEnterprise Systems
Enterprise Systems
 
Summary of kotler's marketing management book
Summary of kotler's marketing management bookSummary of kotler's marketing management book
Summary of kotler's marketing management book
 
Introduction to Real-Time Data Processing
Introduction to Real-Time Data ProcessingIntroduction to Real-Time Data Processing
Introduction to Real-Time Data Processing
 
Fat stranding
Fat strandingFat stranding
Fat stranding
 
内容组织
内容组织内容组织
内容组织
 
Best Practices for Security in Microsoft SharePoint 2013
Best Practices for Security in Microsoft SharePoint 2013Best Practices for Security in Microsoft SharePoint 2013
Best Practices for Security in Microsoft SharePoint 2013
 
OSS BSS BEST BOOK
OSS BSS BEST BOOKOSS BSS BEST BOOK
OSS BSS BEST BOOK
 
IPSAS Implementation
IPSAS ImplementationIPSAS Implementation
IPSAS Implementation
 

Semelhante a MongoDB as a fast and queryable cache

MongoDB Aggregation Performance
MongoDB Aggregation PerformanceMongoDB Aggregation Performance
MongoDB Aggregation PerformanceMongoDB
 
Using Mongomapper to store dynamic data
Using Mongomapper to store dynamic dataUsing Mongomapper to store dynamic data
Using Mongomapper to store dynamic datawonko
 
Making the case for write-optimized database algorithms / Mark Callaghan (Fac...
Making the case for write-optimized database algorithms / Mark Callaghan (Fac...Making the case for write-optimized database algorithms / Mark Callaghan (Fac...
Making the case for write-optimized database algorithms / Mark Callaghan (Fac...Ontico
 
Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2Marco Tusa
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Chris Richardson
 
A Morning with MongoDB Barcelona: Use Cases and Roadmap
A Morning with MongoDB Barcelona: Use Cases and RoadmapA Morning with MongoDB Barcelona: Use Cases and Roadmap
A Morning with MongoDB Barcelona: Use Cases and RoadmapMongoDB
 
MongoDB Pros and Cons
MongoDB Pros and ConsMongoDB Pros and Cons
MongoDB Pros and Consjohnrjenson
 
Mongodb at-gilt-groupe-seattle-2012-09-14-final
Mongodb at-gilt-groupe-seattle-2012-09-14-finalMongodb at-gilt-groupe-seattle-2012-09-14-final
Mongodb at-gilt-groupe-seattle-2012-09-14-finalMongoDB
 
MongoDB Europe 2016 - Big Data meets Big Compute
MongoDB Europe 2016 - Big Data meets Big ComputeMongoDB Europe 2016 - Big Data meets Big Compute
MongoDB Europe 2016 - Big Data meets Big ComputeMongoDB
 
Scaling and Transaction Futures
Scaling and Transaction FuturesScaling and Transaction Futures
Scaling and Transaction FuturesMongoDB
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?DATAVERSITY
 
MongoDB at Gilt Groupe
MongoDB at Gilt GroupeMongoDB at Gilt Groupe
MongoDB at Gilt GroupeMongoDB
 
Data as Documents: Overview and intro to MongoDB
Data as Documents: Overview and intro to MongoDBData as Documents: Overview and intro to MongoDB
Data as Documents: Overview and intro to MongoDBMitch Pirtle
 
Benchmarking, Load Testing, and Preventing Terrible Disasters
Benchmarking, Load Testing, and Preventing Terrible DisastersBenchmarking, Load Testing, and Preventing Terrible Disasters
Benchmarking, Load Testing, and Preventing Terrible DisastersMongoDB
 
Hardware Provisioning for MongoDB
Hardware Provisioning for MongoDBHardware Provisioning for MongoDB
Hardware Provisioning for MongoDBMongoDB
 
Python Ireland Conference 2016 - Python and MongoDB Workshop
Python Ireland Conference 2016 - Python and MongoDB WorkshopPython Ireland Conference 2016 - Python and MongoDB Workshop
Python Ireland Conference 2016 - Python and MongoDB WorkshopJoe Drumgoole
 
Memcached Code Camp 2009
Memcached Code Camp 2009Memcached Code Camp 2009
Memcached Code Camp 2009NorthScale
 
Scaling with mongo db (with notes)
Scaling with mongo db (with notes)Scaling with mongo db (with notes)
Scaling with mongo db (with notes)emiltamas
 
MongoDB Use Cases and Roadmap
MongoDB Use Cases and RoadmapMongoDB Use Cases and Roadmap
MongoDB Use Cases and RoadmapMongoDB
 

Semelhante a MongoDB as a fast and queryable cache (20)

MongoDB Aggregation Performance
MongoDB Aggregation PerformanceMongoDB Aggregation Performance
MongoDB Aggregation Performance
 
Using Mongomapper to store dynamic data
Using Mongomapper to store dynamic dataUsing Mongomapper to store dynamic data
Using Mongomapper to store dynamic data
 
Making the case for write-optimized database algorithms / Mark Callaghan (Fac...
Making the case for write-optimized database algorithms / Mark Callaghan (Fac...Making the case for write-optimized database algorithms / Mark Callaghan (Fac...
Making the case for write-optimized database algorithms / Mark Callaghan (Fac...
 
Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
A Morning with MongoDB Barcelona: Use Cases and Roadmap
A Morning with MongoDB Barcelona: Use Cases and RoadmapA Morning with MongoDB Barcelona: Use Cases and Roadmap
A Morning with MongoDB Barcelona: Use Cases and Roadmap
 
MongoDB Pros and Cons
MongoDB Pros and ConsMongoDB Pros and Cons
MongoDB Pros and Cons
 
Mongodb at-gilt-groupe-seattle-2012-09-14-final
Mongodb at-gilt-groupe-seattle-2012-09-14-finalMongodb at-gilt-groupe-seattle-2012-09-14-final
Mongodb at-gilt-groupe-seattle-2012-09-14-final
 
MongoDB Europe 2016 - Big Data meets Big Compute
MongoDB Europe 2016 - Big Data meets Big ComputeMongoDB Europe 2016 - Big Data meets Big Compute
MongoDB Europe 2016 - Big Data meets Big Compute
 
MongoDB
MongoDBMongoDB
MongoDB
 
Scaling and Transaction Futures
Scaling and Transaction FuturesScaling and Transaction Futures
Scaling and Transaction Futures
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
 
MongoDB at Gilt Groupe
MongoDB at Gilt GroupeMongoDB at Gilt Groupe
MongoDB at Gilt Groupe
 
Data as Documents: Overview and intro to MongoDB
Data as Documents: Overview and intro to MongoDBData as Documents: Overview and intro to MongoDB
Data as Documents: Overview and intro to MongoDB
 
Benchmarking, Load Testing, and Preventing Terrible Disasters
Benchmarking, Load Testing, and Preventing Terrible DisastersBenchmarking, Load Testing, and Preventing Terrible Disasters
Benchmarking, Load Testing, and Preventing Terrible Disasters
 
Hardware Provisioning for MongoDB
Hardware Provisioning for MongoDBHardware Provisioning for MongoDB
Hardware Provisioning for MongoDB
 
Python Ireland Conference 2016 - Python and MongoDB Workshop
Python Ireland Conference 2016 - Python and MongoDB WorkshopPython Ireland Conference 2016 - Python and MongoDB Workshop
Python Ireland Conference 2016 - Python and MongoDB Workshop
 
Memcached Code Camp 2009
Memcached Code Camp 2009Memcached Code Camp 2009
Memcached Code Camp 2009
 
Scaling with mongo db (with notes)
Scaling with mongo db (with notes)Scaling with mongo db (with notes)
Scaling with mongo db (with notes)
 
MongoDB Use Cases and Roadmap
MongoDB Use Cases and RoadmapMongoDB Use Cases and Roadmap
MongoDB Use Cases and Roadmap
 

Mais de MongoDB

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

Mais de MongoDB (20)

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

Último

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
 
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
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Último (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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...
 
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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

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
  • 5.
  • 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
  • 11.
  • 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