SlideShare una empresa de Scribd logo
1 de 37
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Destacado

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
 

Destacado (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 a 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 a 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
 

Más de 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
 

Más de 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
 

Último

Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 

Último (20)

Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 

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