SlideShare a Scribd company logo
1 of 37
Download to read offline
Everyday


                   Open-source, high-performance,
                   schema-free, document-oriented
                             database.

Monday, December 7, 2009
Basic Terms
                              Document
                                BSON
                              Collection
                               GridFS


Monday, December 7, 2009
Basic


                           Document
             { “definition”: “Basic unit of storage in
             MongoDB.”,
             “relational analog” : “record”,
             “sample types” : [ “utf-8 string”,
                                    “integer”,
                                    “object”],
             “special types”: [“utc date”,
                                  “binary”,
                                   /regular expression/],
             “storage format”: “BSON”}

Monday, December 7, 2009
Basic


                           BSON
             Binary JSON
             •Efficient, fast, rich in types
             •Client serializes to BSON
             •Data stored at BSON in MongoDB
             •MongoDB fluent in BSON
             General-purpose
             •RPC / Custom protocols
Monday, December 7, 2009
Basic


                           Collection
             Group of Documents
             •Analogous to Relational Tables.
             •Supports up to 40 indexes.
             •Informal namespacing:
               •blog.posts, blog.authors
             •Schema-free.
Monday, December 7, 2009
Basic


                           GridFS
             Storing large files in MongoDB
             • GridFS: specification for chunking
             files.
             • Chunked for performing range
             operations.
             • File metadata stored in a files
Monday, December 7, 2009
Technical Bits
                            Administration / Drivers
                               Javascript Shell
                                 Replication
                                   Sharding


Monday, December 7, 2009
Technical


                     Administration
           Socket / Wire Protocol
           • Drivers for
             •Java
             •Perl
             •PHP
             •Python
             •Ruby

Monday, December 7, 2009
Technical

                     Javascript Shell




Monday, December 7, 2009
Technical

                           Replication
             Master - Slave            M


                               S       S       S
             Replica Pairs

                               M (S)   S (M)

Monday, December 7, 2009
Technical

                           Auto Sharding




Monday, December 7, 2009
Features
                     Sophisticated, Dynamic Queries
                              Map/Reduce
                                 Upserts
                           Capped Collections


Monday, December 7, 2009
Features |


                Sample Document
             {“title”: “NoSQL Database Internals”,
               “date”: “Tue Oct 27 2009 17:24:18
             GMT-0400 (EDT)”
               “tags”: [“nosql”, “databases”, “c++”],
               “comments”: [{“author”: “Fred”,
                                  “text”: “Quite

Monday, December 7, 2009
Features |


                    Dynamic Queries
     db.posts.find({“author”:
     “Kyle”})
     db.posts.find(“tags”: “nosql”)
     db.posts.find(
               {“date”: {“$lte”: Date.now})
Monday, December 7, 2009
Features |
                      Queries / Indexes on
                       Nested Documents
          db.posts.ensureIndex(“comments.aut
          hor”: 1)
          db.posts.find(“comments.author”:
          “fred”)
          db.posts
          .find({}, {“comments”:1})
Monday, December 7, 2009
Features |


                           Query Operators
         • $gt, $lt, $gte, $lte, $ne, $all, $in, $nin
         • where()
         • db.posts.find({“$where”: this.author == “kyle” ||
                this.author === nil})




Monday, December 7, 2009
Features |


                           And...
         • Map/Reduce
         • Count
         • Group
         • Distinct
         • Regex queries
         • Upserts
         • Capped Collections
Monday, December 7, 2009
MongoDB in
                            Production
                               BusinessInsider.com
                           TweetCongress.org / Squeejee
                                 SourceForge.net




Monday, December 7, 2009
BusinessInsider.co




Monday, December 7, 2009
Production MongoDB |


                               Overview
                   •       MongoDB since Jan,
                           2008
                   •       12M page views /
                           month
                   •       2.2M uniques / month

Monday, December 7, 2009
Production MongoDB |




                           Data Modeling
                    • 10 Collections
                    • Posts with embedded comments
                    • Settings
                    • Real-time analytics (heat maps)
                    • Users with Facebook connect.
Monday, December 7, 2009
Production MongoDB |



                                   Analytics
                   • Page views, real-time statistics
                           panel

                   • Dynamic queries ease data analysis
                   • Fast updates: non-locking inserts
                   • Sailthru for click tracking

Monday, December 7, 2009
Production MongoDB |



                  Images with GridFS
                   • All data, images included, in db.
                   • Meta-data alongside images.
                   • On-the-fly sizing.
                   • Possible con: database large.

Monday, December 7, 2009
Production MongoDB |


                                 Migrations
                                 Mitigated
                • Simplifies schema changes.
                 • No “alter” statements.
                • Easily create new fields, collections.
                • Certain data migration still
                           necessary.



Monday, December 7, 2009
Production MongoDB |

                 {"_id" : 
                 ObjectId( "f4b9b9146c65f647af..."),
                 "name" : "2008/4/flixster-can-t-sell-
                 to-i..." ,
               "title" : "Flixster Can't Sell To IAC, Raises
               $5 M..." ,
               "commentsEnabled" : true ,
               "ts" : "Fri Apr 04 2008 13:43:00 GMT-0400
               (EDT)" , "cls" : "entry" ,
               "content" : "<p>Movie rating site/social
               network... "
               "author" : "Dan Frommer" ,
               "excerpt" : "Who wants to pay $150
               million..." ,
               "channel" : "alleyinsider" ,
Monday, December 7, 2009
Production MongoDB |

                   "comments" :
                 [{"author" : "Alphanaliste" ,
                 "email" :
                 "harderwisdom@aol.com" , "url" :
                 "" ,
                 "ts" : "Fri Apr 04 2008 15:18:31 GMT-0400
                 (EDT)" ,
                 "text" : "This junk won't
                 survive..." ,
                 "cid" : 
                 ObjectId( "f4b9b91407...") },
                 {"author" : "jenkins" ,
Monday, December 7, 2009
Production MongoDB |



                              Deployment
                   • Single database server, 16GB,
                           15-30%.

                   • 3 Apache/PHP servers.
                   • MongoDB for caching.
                   • Exception: memcached for
                           homepage.


Monday, December 7, 2009
Tweetcongress.org
                           Floxee.com (Squeejee)




Monday, December 7, 2009
Production MongoDB | Squeejee




                                Overview

                   •       MongoDB since May, 2009
                   •Mash-up millions of tweets
                   •Ruby Driver, MongoMapper

Monday, December 7, 2009
Production MongoDB | Squeejee


                               Data Modeling

                   •       Version-controlled
                           schema
                           •Code defines the
                            schema
                   •       Migrations simplified

Monday, December 7, 2009
Production MongoDB | Squeejee


                  Advantages of MongoDB

                   •        Good for API
                           Integration
                           •Upserts, fast writes
                           • API data to
                            documents

Monday, December 7, 2009
Production MongoDB | Squeejee


                  Advantages of MongoDB

                   •Modeling associations
                    •Embedded document vs
                            Separate Collection
                           • Embedded arrays for
                            tagging, simple
                            associations.

Monday, December 7, 2009
Production MongoDB | Squeejee


                                Deployment

                   •       64-bit EC2, Rackspace
                           Cloud
                   •       Single master, snapshots
                   •Heroku with MongoHQ
                           for smaller, internal

Monday, December 7, 2009
SourceForge.net




Monday, December 7, 2009
Production MongoDB |



                                  Overview
                   • Goal: Front pages, project pages,
                           download pages stored in single
                           MongoDB document.

                   • Master / 5-6 Read-only slaves
                    • Scaling for reads, reliability.
                    • 10x current traffic, with 100x
                            linearly.

                   • Python Driver with Turbogears
Monday, December 7, 2009
Why Use
               Document Model
               Powerful, Dynamic Queries
               Binary Storage
               Scalability

               Pre-compiled binaries
               Great documentation
               Multi-language support

Monday, December 7, 2009
• http://www.mongodb.org
                   • irc.freenode.net#mongodb
                   • mongodb-user on google groups
                   • kyle@10gen.com

Monday, December 7, 2009

More Related Content

What's hot

High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Javasunnygleason
 
MongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overviewMongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overviewAntonio Pintus
 
Using MongoDB and a Relational Database at MongoDB Day
Using MongoDB and a Relational Database at MongoDB DayUsing MongoDB and a Relational Database at MongoDB Day
Using MongoDB and a Relational Database at MongoDB Dayhayesdavis
 
Scaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLScaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLOSInet
 
MongoDB : The Definitive Guide
MongoDB : The Definitive GuideMongoDB : The Definitive Guide
MongoDB : The Definitive GuideWildan Maulana
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBSean Laurent
 
Big data for the rest of us
Big data for the rest of usBig data for the rest of us
Big data for the rest of usSteven Francia
 
Python-CouchDB Training at PyCon PL 2012
Python-CouchDB Training at PyCon PL 2012Python-CouchDB Training at PyCon PL 2012
Python-CouchDB Training at PyCon PL 2012Stefan Kögl
 
MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012Sean Laurent
 
Chris Lea - What does NoSQL Mean for You
Chris Lea - What does NoSQL Mean for YouChris Lea - What does NoSQL Mean for You
Chris Lea - What does NoSQL Mean for YouCarsonified Team
 
I Have a NoSQL Toaster - Troy .NET User Group - July 2017
I Have a NoSQL Toaster - Troy .NET User Group - July 2017I Have a NoSQL Toaster - Troy .NET User Group - July 2017
I Have a NoSQL Toaster - Troy .NET User Group - July 2017Matthew Groves
 
NoSQL into E-Commerce: lessons learned
NoSQL into E-Commerce: lessons learnedNoSQL into E-Commerce: lessons learned
NoSQL into E-Commerce: lessons learnedLa FeWeb
 
NoSql-YesSQL mickey alon
NoSql-YesSQL mickey alon NoSql-YesSQL mickey alon
NoSql-YesSQL mickey alon Mickey Alon
 
I Have a NoSQL toaster - DC - August 2017
I Have a NoSQL toaster - DC - August 2017I Have a NoSQL toaster - DC - August 2017
I Have a NoSQL toaster - DC - August 2017Matthew Groves
 
Find your data - using GraphDB capabilities in XPages applications - ICS.UG 2016
Find your data - using GraphDB capabilities in XPages applications - ICS.UG 2016Find your data - using GraphDB capabilities in XPages applications - ICS.UG 2016
Find your data - using GraphDB capabilities in XPages applications - ICS.UG 2016ICS User Group
 
Databases for Storage Engineers
Databases for Storage EngineersDatabases for Storage Engineers
Databases for Storage EngineersThomas Kejser
 

What's hot (19)

High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Java
 
MongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overviewMongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overview
 
Using MongoDB and a Relational Database at MongoDB Day
Using MongoDB and a Relational Database at MongoDB DayUsing MongoDB and a Relational Database at MongoDB Day
Using MongoDB and a Relational Database at MongoDB Day
 
Scaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLScaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQL
 
MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB : The Definitive Guide
MongoDB : The Definitive GuideMongoDB : The Definitive Guide
MongoDB : The Definitive Guide
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Big data for the rest of us
Big data for the rest of usBig data for the rest of us
Big data for the rest of us
 
Python-CouchDB Training at PyCon PL 2012
Python-CouchDB Training at PyCon PL 2012Python-CouchDB Training at PyCon PL 2012
Python-CouchDB Training at PyCon PL 2012
 
No sql findings
No sql findingsNo sql findings
No sql findings
 
MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012MongoDB Case Study at NoSQL Now 2012
MongoDB Case Study at NoSQL Now 2012
 
Chris Lea - What does NoSQL Mean for You
Chris Lea - What does NoSQL Mean for YouChris Lea - What does NoSQL Mean for You
Chris Lea - What does NoSQL Mean for You
 
I Have a NoSQL Toaster - Troy .NET User Group - July 2017
I Have a NoSQL Toaster - Troy .NET User Group - July 2017I Have a NoSQL Toaster - Troy .NET User Group - July 2017
I Have a NoSQL Toaster - Troy .NET User Group - July 2017
 
About Haystack
About HaystackAbout Haystack
About Haystack
 
NoSQL into E-Commerce: lessons learned
NoSQL into E-Commerce: lessons learnedNoSQL into E-Commerce: lessons learned
NoSQL into E-Commerce: lessons learned
 
NoSql-YesSQL mickey alon
NoSql-YesSQL mickey alon NoSql-YesSQL mickey alon
NoSql-YesSQL mickey alon
 
I Have a NoSQL toaster - DC - August 2017
I Have a NoSQL toaster - DC - August 2017I Have a NoSQL toaster - DC - August 2017
I Have a NoSQL toaster - DC - August 2017
 
Find your data - using GraphDB capabilities in XPages applications - ICS.UG 2016
Find your data - using GraphDB capabilities in XPages applications - ICS.UG 2016Find your data - using GraphDB capabilities in XPages applications - ICS.UG 2016
Find your data - using GraphDB capabilities in XPages applications - ICS.UG 2016
 
Databases for Storage Engineers
Databases for Storage EngineersDatabases for Storage Engineers
Databases for Storage Engineers
 

Viewers also liked

Working with disconnected data in Windows Store apps
Working with disconnected data in Windows Store appsWorking with disconnected data in Windows Store apps
Working with disconnected data in Windows Store appsAlex Casquete
 
Eficientizarea IT - Temperfield
Eficientizarea IT - TemperfieldEficientizarea IT - Temperfield
Eficientizarea IT - TemperfieldTemperfield
 
тезисы к докладу по электронной аутентификации в государственных системах
тезисы к докладу по электронной аутентификации в государственных системахтезисы к докладу по электронной аутентификации в государственных системах
тезисы к докладу по электронной аутентификации в государственных системахMikhail Vanin
 
Nuxeo World Session: Nuxeo Distributions
Nuxeo World Session: Nuxeo DistributionsNuxeo World Session: Nuxeo Distributions
Nuxeo World Session: Nuxeo DistributionsNuxeo
 

Viewers also liked (6)

Working with disconnected data in Windows Store apps
Working with disconnected data in Windows Store appsWorking with disconnected data in Windows Store apps
Working with disconnected data in Windows Store apps
 
Eficientizarea IT - Temperfield
Eficientizarea IT - TemperfieldEficientizarea IT - Temperfield
Eficientizarea IT - Temperfield
 
OAuth 2.0
OAuth 2.0OAuth 2.0
OAuth 2.0
 
тезисы к докладу по электронной аутентификации в государственных системах
тезисы к докладу по электронной аутентификации в государственных системахтезисы к докладу по электронной аутентификации в государственных системах
тезисы к докладу по электронной аутентификации в государственных системах
 
Nuxeo World Session: Nuxeo Distributions
Nuxeo World Session: Nuxeo DistributionsNuxeo World Session: Nuxeo Distributions
Nuxeo World Session: Nuxeo Distributions
 
Sso every where
Sso every whereSso every where
Sso every where
 

Similar to Everyday - mongodb

Morning with MongoDB Paris 2012 - Accueil et Introductions
Morning with MongoDB Paris 2012 - Accueil et IntroductionsMorning with MongoDB Paris 2012 - Accueil et Introductions
Morning with MongoDB Paris 2012 - Accueil et IntroductionsMongoDB
 
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heavenCloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heavenPatrick Chanezon
 
Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDBYnon Perek
 
MongoDB at FrozenRails
MongoDB at FrozenRailsMongoDB at FrozenRails
MongoDB at FrozenRailsMike Dirolf
 
Mongodb intro
Mongodb introMongodb intro
Mongodb introchristkv
 
MongoDB NYC Python
MongoDB NYC PythonMongoDB NYC Python
MongoDB NYC PythonMike Dirolf
 
10gen MongoDB Video Presentation at WebGeek DevCup
10gen MongoDB Video Presentation at WebGeek DevCup10gen MongoDB Video Presentation at WebGeek DevCup
10gen MongoDB Video Presentation at WebGeek DevCupWebGeek Philippines
 
Build and Deploy Sites Using Features
Build and Deploy Sites Using Features Build and Deploy Sites Using Features
Build and Deploy Sites Using Features Phase2
 
MongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouchMongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouchWynn Netherland
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBMike Dirolf
 
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
 
Building businesspost.ie using Node.js
Building businesspost.ie using Node.jsBuilding businesspost.ie using Node.js
Building businesspost.ie using Node.jsRichard Rodger
 
MongoDB Use Cases and Roadmap
MongoDB Use Cases and RoadmapMongoDB Use Cases and Roadmap
MongoDB Use Cases and RoadmapMongoDB
 
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012kennethaliu
 
Drupal and the rise of the documents
Drupal and the rise of the documentsDrupal and the rise of the documents
Drupal and the rise of the documentsClaudio Beatrice
 

Similar to Everyday - mongodb (20)

Morning with MongoDB Paris 2012 - Accueil et Introductions
Morning with MongoDB Paris 2012 - Accueil et IntroductionsMorning with MongoDB Paris 2012 - Accueil et Introductions
Morning with MongoDB Paris 2012 - Accueil et Introductions
 
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heavenCloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
 
Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDB
 
MongoDB at FrozenRails
MongoDB at FrozenRailsMongoDB at FrozenRails
MongoDB at FrozenRails
 
Mongodb my
Mongodb myMongodb my
Mongodb my
 
MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
 
MongoDB NYC Python
MongoDB NYC PythonMongoDB NYC Python
MongoDB NYC Python
 
10gen MongoDB Video Presentation at WebGeek DevCup
10gen MongoDB Video Presentation at WebGeek DevCup10gen MongoDB Video Presentation at WebGeek DevCup
10gen MongoDB Video Presentation at WebGeek DevCup
 
HTML5 and Sencha Touch
HTML5 and Sencha TouchHTML5 and Sencha Touch
HTML5 and Sencha Touch
 
Build and Deploy Sites Using Features
Build and Deploy Sites Using Features Build and Deploy Sites Using Features
Build and Deploy Sites Using Features
 
MongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouchMongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouch
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
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
 
Building businesspost.ie using Node.js
Building businesspost.ie using Node.jsBuilding businesspost.ie using Node.js
Building businesspost.ie using Node.js
 
MongoDB Use Cases and Roadmap
MongoDB Use Cases and RoadmapMongoDB Use Cases and Roadmap
MongoDB Use Cases and Roadmap
 
Node at artsy
Node at artsyNode at artsy
Node at artsy
 
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
 
Drupal and the rise of the documents
Drupal and the rise of the documentsDrupal and the rise of the documents
Drupal and the rise of the documents
 

More from elliando dias

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando dias
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScriptelliando dias
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structureselliando dias
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de containerelliando dias
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agilityelliando dias
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Librarieselliando dias
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!elliando dias
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Webelliando dias
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduinoelliando dias
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorceryelliando dias
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Designelliando dias
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makeselliando dias
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.elliando dias
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebookelliando dias
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Studyelliando dias
 

More from elliando dias (20)

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
 
Geometria Projetiva
Geometria ProjetivaGeometria Projetiva
Geometria Projetiva
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
 
Ragel talk
Ragel talkRagel talk
Ragel talk
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
 
Minicurso arduino
Minicurso arduinoMinicurso arduino
Minicurso arduino
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
 
Rango
RangoRango
Rango
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makes
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 

Recently uploaded (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 

Everyday - mongodb

  • 1. Everyday Open-source, high-performance, schema-free, document-oriented database. Monday, December 7, 2009
  • 2. Basic Terms Document BSON Collection GridFS Monday, December 7, 2009
  • 3. Basic Document { “definition”: “Basic unit of storage in MongoDB.”, “relational analog” : “record”, “sample types” : [ “utf-8 string”, “integer”, “object”], “special types”: [“utc date”, “binary”, /regular expression/], “storage format”: “BSON”} Monday, December 7, 2009
  • 4. Basic BSON Binary JSON •Efficient, fast, rich in types •Client serializes to BSON •Data stored at BSON in MongoDB •MongoDB fluent in BSON General-purpose •RPC / Custom protocols Monday, December 7, 2009
  • 5. Basic Collection Group of Documents •Analogous to Relational Tables. •Supports up to 40 indexes. •Informal namespacing: •blog.posts, blog.authors •Schema-free. Monday, December 7, 2009
  • 6. Basic GridFS Storing large files in MongoDB • GridFS: specification for chunking files. • Chunked for performing range operations. • File metadata stored in a files Monday, December 7, 2009
  • 7. Technical Bits Administration / Drivers Javascript Shell Replication Sharding Monday, December 7, 2009
  • 8. Technical Administration Socket / Wire Protocol • Drivers for •Java •Perl •PHP •Python •Ruby Monday, December 7, 2009
  • 9. Technical Javascript Shell Monday, December 7, 2009
  • 10. Technical Replication Master - Slave M S S S Replica Pairs M (S) S (M) Monday, December 7, 2009
  • 11. Technical Auto Sharding Monday, December 7, 2009
  • 12. Features Sophisticated, Dynamic Queries Map/Reduce Upserts Capped Collections Monday, December 7, 2009
  • 13. Features | Sample Document {“title”: “NoSQL Database Internals”, “date”: “Tue Oct 27 2009 17:24:18 GMT-0400 (EDT)” “tags”: [“nosql”, “databases”, “c++”], “comments”: [{“author”: “Fred”, “text”: “Quite Monday, December 7, 2009
  • 14. Features | Dynamic Queries db.posts.find({“author”: “Kyle”}) db.posts.find(“tags”: “nosql”) db.posts.find( {“date”: {“$lte”: Date.now}) Monday, December 7, 2009
  • 15. Features | Queries / Indexes on Nested Documents db.posts.ensureIndex(“comments.aut hor”: 1) db.posts.find(“comments.author”: “fred”) db.posts .find({}, {“comments”:1}) Monday, December 7, 2009
  • 16. Features | Query Operators • $gt, $lt, $gte, $lte, $ne, $all, $in, $nin • where() • db.posts.find({“$where”: this.author == “kyle” || this.author === nil}) Monday, December 7, 2009
  • 17. Features | And... • Map/Reduce • Count • Group • Distinct • Regex queries • Upserts • Capped Collections Monday, December 7, 2009
  • 18. MongoDB in Production BusinessInsider.com TweetCongress.org / Squeejee SourceForge.net Monday, December 7, 2009
  • 20. Production MongoDB | Overview • MongoDB since Jan, 2008 • 12M page views / month • 2.2M uniques / month Monday, December 7, 2009
  • 21. Production MongoDB | Data Modeling • 10 Collections • Posts with embedded comments • Settings • Real-time analytics (heat maps) • Users with Facebook connect. Monday, December 7, 2009
  • 22. Production MongoDB | Analytics • Page views, real-time statistics panel • Dynamic queries ease data analysis • Fast updates: non-locking inserts • Sailthru for click tracking Monday, December 7, 2009
  • 23. Production MongoDB | Images with GridFS • All data, images included, in db. • Meta-data alongside images. • On-the-fly sizing. • Possible con: database large. Monday, December 7, 2009
  • 24. Production MongoDB | Migrations Mitigated • Simplifies schema changes. • No “alter” statements. • Easily create new fields, collections. • Certain data migration still necessary. Monday, December 7, 2009
  • 25. Production MongoDB | {"_id" :  ObjectId( "f4b9b9146c65f647af..."), "name" : "2008/4/flixster-can-t-sell- to-i..." , "title" : "Flixster Can't Sell To IAC, Raises $5 M..." , "commentsEnabled" : true , "ts" : "Fri Apr 04 2008 13:43:00 GMT-0400 (EDT)" , "cls" : "entry" , "content" : "<p>Movie rating site/social network... " "author" : "Dan Frommer" , "excerpt" : "Who wants to pay $150 million..." , "channel" : "alleyinsider" , Monday, December 7, 2009
  • 26. Production MongoDB | "comments" : [{"author" : "Alphanaliste" , "email" : "harderwisdom@aol.com" , "url" : "" , "ts" : "Fri Apr 04 2008 15:18:31 GMT-0400 (EDT)" , "text" : "This junk won't survive..." , "cid" :  ObjectId( "f4b9b91407...") }, {"author" : "jenkins" , Monday, December 7, 2009
  • 27. Production MongoDB | Deployment • Single database server, 16GB, 15-30%. • 3 Apache/PHP servers. • MongoDB for caching. • Exception: memcached for homepage. Monday, December 7, 2009
  • 28. Tweetcongress.org Floxee.com (Squeejee) Monday, December 7, 2009
  • 29. Production MongoDB | Squeejee Overview • MongoDB since May, 2009 •Mash-up millions of tweets •Ruby Driver, MongoMapper Monday, December 7, 2009
  • 30. Production MongoDB | Squeejee Data Modeling • Version-controlled schema •Code defines the schema • Migrations simplified Monday, December 7, 2009
  • 31. Production MongoDB | Squeejee Advantages of MongoDB • Good for API Integration •Upserts, fast writes • API data to documents Monday, December 7, 2009
  • 32. Production MongoDB | Squeejee Advantages of MongoDB •Modeling associations •Embedded document vs Separate Collection • Embedded arrays for tagging, simple associations. Monday, December 7, 2009
  • 33. Production MongoDB | Squeejee Deployment • 64-bit EC2, Rackspace Cloud • Single master, snapshots •Heroku with MongoHQ for smaller, internal Monday, December 7, 2009
  • 35. Production MongoDB | Overview • Goal: Front pages, project pages, download pages stored in single MongoDB document. • Master / 5-6 Read-only slaves • Scaling for reads, reliability. • 10x current traffic, with 100x linearly. • Python Driver with Turbogears Monday, December 7, 2009
  • 36. Why Use Document Model Powerful, Dynamic Queries Binary Storage Scalability Pre-compiled binaries Great documentation Multi-language support Monday, December 7, 2009
  • 37. • http://www.mongodb.org • irc.freenode.net#mongodb • mongodb-user on google groups • kyle@10gen.com Monday, December 7, 2009