SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

MongoDB : The Definitive Guide
MongoDB : The Definitive GuideMongoDB : The Definitive Guide
MongoDB : The Definitive Guide
Wildan Maulana
 
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
Stefan 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 2012
Sean Laurent
 

Tendances (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
 

En vedette

En vedette (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
 

Similaire à Everyday - mongodb

Building businesspost.ie using Node.js
Building businesspost.ie using Node.jsBuilding businesspost.ie using Node.js
Building businesspost.ie using Node.js
Richard Rodger
 
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
kennethaliu
 

Similaire à 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
 

Plus de elliando 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 ClojureScript
elliando dias
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
elliando 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 Agility
elliando dias
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
elliando 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 Web
elliando dias
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
elliando dias
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
elliando 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 Design
elliando 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 Facebook
elliando 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 Study
elliando dias
 

Plus 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
 

Dernier

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
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
PECB
 

Dernier (20)

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
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
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
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.
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
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
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
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
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 

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