SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
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
 
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
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
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
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 

Kürzlich hochgeladen (20)

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
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
 
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"
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
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
 
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
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
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
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 

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