SlideShare a Scribd company logo
Building a Cross Channel Content Delivery
         Platform with MongoDB
     Webinar Building a Cross Channel Content Delivery Platform with MongoDB will begin
                       at 6:00 AM EDT / 4:00 AM PDT / 11:00 AM UTC

             Audio should start immediately when you log into the event via Audio
                Broadcast. You will need a Voip headset and reliable internet
             connection for Audio Broadcast. If you are having issues connecting,
                    please dial 1-877-668-4493; Access code: 666 687 901.

                             There is a Q&A following the webinar.

                 A recording of the webinar will be available 24 hours after the
                                      event is complete.
10gen Overview



                     10gen is the
                     company
                     behind
                     MongoDB –
                     the leading
                     NoSQL
                     database

                 2
10gen Overview




                     170+
                     employees




                 3
10gen Overview




                     500+
                     customers




                 4
10gen Overview




                     $73M
                     in funding from
                     top investors



                 5
Leading Organizations Rely on
MongoDB




                  6
Media Company Change




         Application




           RDBMS

               7
Media Company Change




         Application




           RDBMS

               8
Media Company Change




         Application




           RDBMS

               9
Media Company Change




         Application




           RDBMS

               10
Media Company Change




         Application




           RDBMS

               11
So What?

1. Slow onboard of each channel
due to complex schema changes.

2. Unable to scale database to
  understand our customer!

3. Reduce in user experience due
        to performance
                12
Schema

1. Slow onboard of each channel
due to complex schema changes.




               13
Example?

                                  Real Twitter
 {

     "_id" : ObjectId("4f47b268fb1c80e141e9888c"),

     "user" : {

         "friends_count" : 73,

         "location" : "Brazil",

         "screen_name" : "Bia_cunha1",

         "name" : "Beatriz Helena Cunha",

         "followers_count" : 102,

     }

 }


                                            14
Media Company Change




   JSON
          Application




            RDBMS

                15
Media Company Change



          JSON     JSON    JSON

   JSON
           Application

                    SQL!


                 RDBMS

                    16
Media Company Change



          JSON   JSON    JSON

   JSON
           Application

                 JSON




                 17
Example Tracker


click = {user: "Chris",
      date: new Date(),
      url: "http://www.mongodb.org"}

> db.tracker.save(click)




                   18
Example Tracker



db.click.update(
  {url: "http://www.mongodb.org" },
  {$push: {tags: [“MongoDB”, “NoSQL”]}}
)




                   19
Example Tracker


click = {user: "Chris",
      date: new Date(),
      url: "http://www.mongodb.org",
      tags : [“MongoDB”, “NoSQL”]}




                   20
Now we can answer...




What are our customers doing?




                21
Example - twitter

                                  Real Twitter
 {

     "_id" : ObjectId("4f47b268fb1c80e141e9888c"),

     "user" : {

         "friends_count" : 73,

         "location" : "Brazil",

         "screen_name" : "Bia_cunha1",

         "name" : "Beatriz Helena Cunha",

         "followers_count" : 102,

     }

 }


                                            22
Example - twitter

db.tweets.aggregate(
  {$match:
    {"user.friends_count": { $gt: 0 },
     "user.followers_count": { $gt: 0 }
    }
  },
  {$project:
    { location: "$user.location",
      friends: "$user.friends_count",
      followers: "$user.followers_count"
    }
  },
  {$group:
    {_id:     "$location",
     friends: {$sum: "$friends"},
     followers: {$sum: "$followers"}
    }
  }
);


                                           23
Example - twitter

db.tweets.aggregate(
  {$match:
    {"user.friends_count": { $gt: 0 },          Predicate
     "user.followers_count": { $gt: 0 }
    }
  },
  {$project:
    { location: "$user.location",
      friends: "$user.friends_count",
      followers: "$user.followers_count"
    }
  },
  {$group:
    {_id:     "$location",
     friends: {$sum: "$friends"},
     followers: {$sum: "$followers"}
    }
  }
);


                                           24
Example - twitter

db.tweets.aggregate(
  {$match:
    {"user.friends_count": { $gt: 0 },
                                                 Predicate
     "user.followers_count": { $gt: 0 }
    }
  },
  {$project:                                     Parts of the
    { location: "$user.location",
      friends: "$user.friends_count",           document you
      followers: "$user.followers_count"        want to project
    }
  },
  {$group:
    {_id:     "$location",
     friends: {$sum: "$friends"},
     followers: {$sum: "$followers"}
    }
  }
);


                                           25
Example - twitter

db.tweets.aggregate(
  {$match:                                        Predicate
    {"user.friends_count": { $gt: 0 },
     "user.followers_count": { $gt: 0 }
    }
  },
  {$project:
    { location: "$user.location",
                                                  Parts of the
      friends: "$user.friends_count",            document you
      followers: "$user.followers_count"         want to project
    }
  },
  {$group:
    {_id:     "$location",
     friends: {$sum: "$friends"},               Function to apply
     followers: {$sum: "$followers"}
    }                                            to the result set
  }
);


                                           26
Example - twitter


{

     "result"   :[

     
   {

     
   
      "_id" : "Far Far Away",

     
   
      "friends" : 344,

     
   
      "followers" : 789

     
   },
...

     ],

     "ok" : 1
}




                                       27
Scale!

 Let’s scale our database to
understand ALL our customer!




              28
Sharding - Range distribution

   sh.shardCollection("test.tweets", {_id: 1})




   shard01                     shard02           shard03




                                     29
Sharding - Range distribution




     a-i        j-r        s-z


   shard01    shard02    shard03




                30
Sharding - Splits




     a-i        ja-jz      s-z

   shard01      k-r
              shard02    shard03




                    31
Sharding - Splits




     a-i        ja-ji      s-z

   shard01      ji-js
              shard02    shard03
               js-jw

                jz-r


                    32
Sharding - Auto Balancing




    a-i        ja-ji          s-z

               ji-js
   shard01   shard02        shard03

    js-jw      js-jw

               jz-r          jz-r


                33
Sharding - Auto Balancing




    a-i        ja-ji          s-z

  shard01      ji-js
             shard02        shard03
   js-jw                     jz-r




                34
Performance

Improve user experience due to
    increased performance




               35
Memory




MongoDB revolves around memory
         mapped files
Operating System map files on the
Filesystem to Virtual Memory

• 200 gigs of MongoDB files creates 200 gigs
  of virtual memory
• OS controls what data in RAM
• When a piece of data isn't found in memory
     – OS goes to disk to fetch the data
• Indexes are part of the Regular Database files
• Deployment Trick: Pre-Warm your Database
  (PreWarming your cache) to prevent cold
A Few Words on OS Choice
• For production: Use a 64 bit OS and a 64 bit
  MongoDB Build
  – 32 Bit has a 2 gig limit; imposed by the operating
    systems for memory mapped files
  – Clients can be 32 bit
• MongoDB Supports (little endian only)
  – Linux, FreeBSD, OS X (on Intel, not PowerPC)
  – Windows
  – Solaris (Intel only, Joyent offers a cloud service
    which works for Mongo)
Sharding for caching

              96 GB Mem
              3:1 Data/Mem




                 a-i
300 GB Data




                j-r
              shard01

                s-z


                300 GB

                             39
Aggregate Horizontal Resources

              96 GB Mem      96 GB Mem      96 GB Mem
              1:1 Data/Mem   1:1 Data/Mem   1:1 Data/Mem




                 a-i            j-r           s-z
300 GB Data




                 j-r         shard02        shard03

                s-z


                100 GB        100 GB         100 GB

                                 40
Sharding Features

• Shard data without no downtime
• Automatic balancing as data is written
• Commands routed (switched) to correct node
  • Inserts - must have the Shard Key
  • Updates - can have the Shard Key
  • Queries
      • With Shard Key - routed to nodes
      • Without Shard Key - scatter gather
  • Indexed / Sorted Queries
      • With Shard Key - routed in order
      • Without Shard Key - distributed sort merge


                                 41
Summary
Relational Database Challenges

 Data Types                              Agile Development
 • Unstructured data                     • Iterative
 • Semi-structured data                  • Short development
                                           cycles
 • Polymorphic data
                                         • New workloads




Volume of Data                            New Architectures
• Petabytes of data                       • Horizontal scaling
• Trillions of records                    • Commodity servers
• Tens of millions of queries per         • Cloud computing
  second


                                    43
mongoDB Adoption

Resource           User Data Management




              44
Global MongoDB Community
41,000+
Monthly Unique Downloads
24,000+
Online Education Registrants
12,000+
MongoDB User Group Members
10,000+
Annual MongoDB Days Attendees
Leading Organizations Rely on
MongoDB




                  46
Questions

• 10Gen Services
  –   Development Support
  –   Consultancy
  –   TAM
  –   Production Support


• Free online MongoDB
  training
  – Develop
  – Deploy
  – Classes start Oct. 2012
                              47
Building a Cross Channel Content Delivery Platform with MongoDB

More Related Content

What's hot (20)

PDF
MongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right Way
MongoDB
 
PPTX
First app online conf
MongoDB
 
ODP
2012 07-24 dnssec-og_open_dnssec_-_martin_toft_og_georg_sluyterman_slideshow
sman_dk
 
PDF
Introduction to Mongodb
Harun Yardımcı
 
PPTX
MongoDB - Back to Basics - La tua prima Applicazione
Massimo Brignoli
 
PPTX
Text Mining of Twitter in Data Mining
Meghaj Mallick
 
PPTX
MongoDB 3.2 - Analytics
Massimo Brignoli
 
PPTX
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
MongoDB
 
TXT
Books
flaglio
 
PPTX
Choosing a Shard key
MongoDB
 
PDF
Real-time Location Based Social Discovery using MongoDB
Fredrik Björk
 
PPTX
Back to Basics Webinar 2: Your First MongoDB Application
MongoDB
 
PDF
NoSQL databases
Marc Seeger
 
PDF
Sharding with MongoDB -- MongoDC 2012
Tyler Brock
 
PPTX
Building a Scalable Inbox System with MongoDB and Java
antoinegirbal
 
PDF
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
MongoDB
 
PPTX
Conceptos básicos. Seminario web 5: Introducción a Aggregation Framework
MongoDB
 
PDF
Inside MongoDB: the Internals of an Open-Source Database
Mike Dirolf
 
PPTX
MongoDB San Francisco 2013: Hash-based Sharding in MongoDB 2.4 presented by B...
MongoDB
 
PDF
はじめてのMongoDB
Takahiro Inoue
 
MongoDB Europe 2016 - ETL for Pros – Getting Data Into MongoDB The Right Way
MongoDB
 
First app online conf
MongoDB
 
2012 07-24 dnssec-og_open_dnssec_-_martin_toft_og_georg_sluyterman_slideshow
sman_dk
 
Introduction to Mongodb
Harun Yardımcı
 
MongoDB - Back to Basics - La tua prima Applicazione
Massimo Brignoli
 
Text Mining of Twitter in Data Mining
Meghaj Mallick
 
MongoDB 3.2 - Analytics
Massimo Brignoli
 
Back to Basics Webinar 4: Advanced Indexing, Text and Geospatial Indexes
MongoDB
 
Books
flaglio
 
Choosing a Shard key
MongoDB
 
Real-time Location Based Social Discovery using MongoDB
Fredrik Björk
 
Back to Basics Webinar 2: Your First MongoDB Application
MongoDB
 
NoSQL databases
Marc Seeger
 
Sharding with MongoDB -- MongoDC 2012
Tyler Brock
 
Building a Scalable Inbox System with MongoDB and Java
antoinegirbal
 
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
MongoDB
 
Conceptos básicos. Seminario web 5: Introducción a Aggregation Framework
MongoDB
 
Inside MongoDB: the Internals of an Open-Source Database
Mike Dirolf
 
MongoDB San Francisco 2013: Hash-based Sharding in MongoDB 2.4 presented by B...
MongoDB
 
はじめてのMongoDB
Takahiro Inoue
 

Viewers also liked (9)

PPTX
2014 it - app dev series - 03 - interagire con il database
MongoDB
 
PPTX
Sharding morning session
MongoDB
 
PPTX
Webinar: Position and Trade Management with MongoDB
MongoDB
 
PPTX
MongoDB at Carahsoft Big Data Forum
MongoDB
 
PPTX
Deployment Preparedness
MongoDB
 
PPTX
MongoDB Roadmap
MongoDB
 
PDF
Querying Mongo Without Programming Using Funql
MongoDB
 
PDF
Introduction to Sharding
MongoDB
 
PPT
MongoDB Basic Concepts
MongoDB
 
2014 it - app dev series - 03 - interagire con il database
MongoDB
 
Sharding morning session
MongoDB
 
Webinar: Position and Trade Management with MongoDB
MongoDB
 
MongoDB at Carahsoft Big Data Forum
MongoDB
 
Deployment Preparedness
MongoDB
 
MongoDB Roadmap
MongoDB
 
Querying Mongo Without Programming Using Funql
MongoDB
 
Introduction to Sharding
MongoDB
 
MongoDB Basic Concepts
MongoDB
 
Ad

Similar to Building a Cross Channel Content Delivery Platform with MongoDB (20)

PPTX
Tim Marston.
PatrickCrompton
 
PPTX
Tim marston
PatrickCrompton
 
PPTX
Webinar: Building Your First Application with MongoDB
MongoDB
 
PPTX
mongoDB: Driving a data revolution
MongoDB
 
KEY
Managing Social Content with MongoDB
MongoDB
 
PDF
MongoDB in FS
MongoDB
 
PPT
Welcome and Introduction to A Morning with MongoDB Petah Tikvah
MongoDB
 
PPTX
An Evening with MongoDB Detroit 2013
MongoDB
 
KEY
2012 phoenix mug
Paul Pedersen
 
ODP
Morningwithmongodbisrael 121217184113-phpapp02
Andrei Colta
 
PPT
A Morning with MongoDB - Helsinki
MongoDB
 
KEY
Discover MongoDB - Israel
Michael Fiedler
 
PPTX
MediaGlu and Mongo DB
Sundar Nathikudi
 
PDF
Using Spring with NoSQL databases (SpringOne China 2012)
Chris Richardson
 
PDF
SQL? NoSQL? NewSQL?!? What's a Java developer to do? - PhillyETE 2012
Chris Richardson
 
PDF
10gen MongoDB Video Presentation at WebGeek DevCup
WebGeek Philippines
 
PPT
Building web applications with mongo db presentation
Murat Çakal
 
PDF
MongoDB: a gentle, friendly overview
Antonio Pintus
 
PPTX
Realtime Analytics with MongoDB Counters (mongonyc 2012)
Scott Hernandez
 
PDF
Building your first app with MongoDB
Norberto Leite
 
Tim Marston.
PatrickCrompton
 
Tim marston
PatrickCrompton
 
Webinar: Building Your First Application with MongoDB
MongoDB
 
mongoDB: Driving a data revolution
MongoDB
 
Managing Social Content with MongoDB
MongoDB
 
MongoDB in FS
MongoDB
 
Welcome and Introduction to A Morning with MongoDB Petah Tikvah
MongoDB
 
An Evening with MongoDB Detroit 2013
MongoDB
 
2012 phoenix mug
Paul Pedersen
 
Morningwithmongodbisrael 121217184113-phpapp02
Andrei Colta
 
A Morning with MongoDB - Helsinki
MongoDB
 
Discover MongoDB - Israel
Michael Fiedler
 
MediaGlu and Mongo DB
Sundar Nathikudi
 
Using Spring with NoSQL databases (SpringOne China 2012)
Chris Richardson
 
SQL? NoSQL? NewSQL?!? What's a Java developer to do? - PhillyETE 2012
Chris Richardson
 
10gen MongoDB Video Presentation at WebGeek DevCup
WebGeek Philippines
 
Building web applications with mongo db presentation
Murat Çakal
 
MongoDB: a gentle, friendly overview
Antonio Pintus
 
Realtime Analytics with MongoDB Counters (mongonyc 2012)
Scott Hernandez
 
Building your first app with MongoDB
Norberto Leite
 
Ad

More from MongoDB (20)

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

Recently uploaded (20)

PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 

Building a Cross Channel Content Delivery Platform with MongoDB

  • 1. Building a Cross Channel Content Delivery Platform with MongoDB Webinar Building a Cross Channel Content Delivery Platform with MongoDB will begin at 6:00 AM EDT / 4:00 AM PDT / 11:00 AM UTC Audio should start immediately when you log into the event via Audio Broadcast. You will need a Voip headset and reliable internet connection for Audio Broadcast. If you are having issues connecting, please dial 1-877-668-4493; Access code: 666 687 901. There is a Q&A following the webinar. A recording of the webinar will be available 24 hours after the event is complete.
  • 2. 10gen Overview 10gen is the company behind MongoDB – the leading NoSQL database 2
  • 3. 10gen Overview 170+ employees 3
  • 4. 10gen Overview 500+ customers 4
  • 5. 10gen Overview $73M in funding from top investors 5
  • 7. Media Company Change Application RDBMS 7
  • 8. Media Company Change Application RDBMS 8
  • 9. Media Company Change Application RDBMS 9
  • 10. Media Company Change Application RDBMS 10
  • 11. Media Company Change Application RDBMS 11
  • 12. So What? 1. Slow onboard of each channel due to complex schema changes. 2. Unable to scale database to understand our customer! 3. Reduce in user experience due to performance 12
  • 13. Schema 1. Slow onboard of each channel due to complex schema changes. 13
  • 14. Example? Real Twitter { "_id" : ObjectId("4f47b268fb1c80e141e9888c"), "user" : { "friends_count" : 73, "location" : "Brazil", "screen_name" : "Bia_cunha1", "name" : "Beatriz Helena Cunha", "followers_count" : 102, } } 14
  • 15. Media Company Change JSON Application RDBMS 15
  • 16. Media Company Change JSON JSON JSON JSON Application SQL! RDBMS 16
  • 17. Media Company Change JSON JSON JSON JSON Application JSON 17
  • 18. Example Tracker click = {user: "Chris", date: new Date(), url: "http://www.mongodb.org"} > db.tracker.save(click) 18
  • 19. Example Tracker db.click.update( {url: "http://www.mongodb.org" }, {$push: {tags: [“MongoDB”, “NoSQL”]}} ) 19
  • 20. Example Tracker click = {user: "Chris", date: new Date(), url: "http://www.mongodb.org", tags : [“MongoDB”, “NoSQL”]} 20
  • 21. Now we can answer... What are our customers doing? 21
  • 22. Example - twitter Real Twitter { "_id" : ObjectId("4f47b268fb1c80e141e9888c"), "user" : { "friends_count" : 73, "location" : "Brazil", "screen_name" : "Bia_cunha1", "name" : "Beatriz Helena Cunha", "followers_count" : 102, } } 22
  • 23. Example - twitter db.tweets.aggregate( {$match: {"user.friends_count": { $gt: 0 }, "user.followers_count": { $gt: 0 } } }, {$project: { location: "$user.location", friends: "$user.friends_count", followers: "$user.followers_count" } }, {$group: {_id: "$location", friends: {$sum: "$friends"}, followers: {$sum: "$followers"} } } ); 23
  • 24. Example - twitter db.tweets.aggregate( {$match: {"user.friends_count": { $gt: 0 }, Predicate "user.followers_count": { $gt: 0 } } }, {$project: { location: "$user.location", friends: "$user.friends_count", followers: "$user.followers_count" } }, {$group: {_id: "$location", friends: {$sum: "$friends"}, followers: {$sum: "$followers"} } } ); 24
  • 25. Example - twitter db.tweets.aggregate( {$match: {"user.friends_count": { $gt: 0 }, Predicate "user.followers_count": { $gt: 0 } } }, {$project: Parts of the { location: "$user.location", friends: "$user.friends_count", document you followers: "$user.followers_count" want to project } }, {$group: {_id: "$location", friends: {$sum: "$friends"}, followers: {$sum: "$followers"} } } ); 25
  • 26. Example - twitter db.tweets.aggregate( {$match: Predicate {"user.friends_count": { $gt: 0 }, "user.followers_count": { $gt: 0 } } }, {$project: { location: "$user.location", Parts of the friends: "$user.friends_count", document you followers: "$user.followers_count" want to project } }, {$group: {_id: "$location", friends: {$sum: "$friends"}, Function to apply followers: {$sum: "$followers"} } to the result set } ); 26
  • 27. Example - twitter { "result" :[ { "_id" : "Far Far Away", "friends" : 344, "followers" : 789 }, ... ], "ok" : 1 } 27
  • 28. Scale! Let’s scale our database to understand ALL our customer! 28
  • 29. Sharding - Range distribution sh.shardCollection("test.tweets", {_id: 1}) shard01 shard02 shard03 29
  • 30. Sharding - Range distribution a-i j-r s-z shard01 shard02 shard03 30
  • 31. Sharding - Splits a-i ja-jz s-z shard01 k-r shard02 shard03 31
  • 32. Sharding - Splits a-i ja-ji s-z shard01 ji-js shard02 shard03 js-jw jz-r 32
  • 33. Sharding - Auto Balancing a-i ja-ji s-z ji-js shard01 shard02 shard03 js-jw js-jw jz-r jz-r 33
  • 34. Sharding - Auto Balancing a-i ja-ji s-z shard01 ji-js shard02 shard03 js-jw jz-r 34
  • 35. Performance Improve user experience due to increased performance 35
  • 36. Memory MongoDB revolves around memory mapped files
  • 37. Operating System map files on the Filesystem to Virtual Memory • 200 gigs of MongoDB files creates 200 gigs of virtual memory • OS controls what data in RAM • When a piece of data isn't found in memory – OS goes to disk to fetch the data • Indexes are part of the Regular Database files • Deployment Trick: Pre-Warm your Database (PreWarming your cache) to prevent cold
  • 38. A Few Words on OS Choice • For production: Use a 64 bit OS and a 64 bit MongoDB Build – 32 Bit has a 2 gig limit; imposed by the operating systems for memory mapped files – Clients can be 32 bit • MongoDB Supports (little endian only) – Linux, FreeBSD, OS X (on Intel, not PowerPC) – Windows – Solaris (Intel only, Joyent offers a cloud service which works for Mongo)
  • 39. Sharding for caching 96 GB Mem 3:1 Data/Mem a-i 300 GB Data j-r shard01 s-z 300 GB 39
  • 40. Aggregate Horizontal Resources 96 GB Mem 96 GB Mem 96 GB Mem 1:1 Data/Mem 1:1 Data/Mem 1:1 Data/Mem a-i j-r s-z 300 GB Data j-r shard02 shard03 s-z 100 GB 100 GB 100 GB 40
  • 41. Sharding Features • Shard data without no downtime • Automatic balancing as data is written • Commands routed (switched) to correct node • Inserts - must have the Shard Key • Updates - can have the Shard Key • Queries • With Shard Key - routed to nodes • Without Shard Key - scatter gather • Indexed / Sorted Queries • With Shard Key - routed in order • Without Shard Key - distributed sort merge 41
  • 43. Relational Database Challenges Data Types Agile Development • Unstructured data • Iterative • Semi-structured data • Short development cycles • Polymorphic data • New workloads Volume of Data New Architectures • Petabytes of data • Horizontal scaling • Trillions of records • Commodity servers • Tens of millions of queries per • Cloud computing second 43
  • 44. mongoDB Adoption Resource User Data Management 44
  • 45. Global MongoDB Community 41,000+ Monthly Unique Downloads 24,000+ Online Education Registrants 12,000+ MongoDB User Group Members 10,000+ Annual MongoDB Days Attendees
  • 46. Leading Organizations Rely on MongoDB 46
  • 47. Questions • 10Gen Services – Development Support – Consultancy – TAM – Production Support • Free online MongoDB training – Develop – Deploy – Classes start Oct. 2012 47

Editor's Notes