SlideShare a Scribd company logo
1 of 49
Download to read offline
MongoDB Basic Concepts

                                    Norberto Leite

                            Senior Solutions Architect, EMEA
                                 norberto@10gen.com
                                         @nleite




Thursday, 8 November 12
Agenda

       •Overview
       •Replication
       •Scalability
       •Consistency & Durability
       •Flexibility, Developer Experience
       •Roadmap




Thursday, 8 November 12
Your data needs started here...




                                  http://bit.ly/OT71M4
Thursday, 8 November 12
...but soon you had to be here




                                  http://bit.ly/Oxcsis

Thursday, 8 November 12
Basic Concepts
                           Application    Document
                                          Oriented
         High                             { author : “steve”,
                                            date : new Date(),
                                            text : “About MongoDB...”,
     Performance                            tags : [“tech”, “database”]}




                                            Fully
                                          Consistent

                  Horizontally Scalable

Thursday, 8 November 12
Tradeoff: Scale vs Functionality

                                    • memcached
        scalability & performance




                                       •key/value



                                                                     • RDBMS



                                            depth of functionality
Thursday, 8 November 12
Replication




Thursday, 8 November 12
Why do we need replication

       •Failover
       •Backups
       •Secondary batch jobs
       •High availability




Thursday, 8 November 12
Replica Sets
       Data Availability across nodes
       • Data Protection
         • Multiple copies of the data
         • Spread across Data Centers, AZs
       • High Availability
         • Automated Failover
         • Automated Recovery




Thursday, 8 November 12
Replica Sets


                App       Write
                                   Primary
                                              Asynchronous
                          Read                 Replication

                                  Secondary
                          Read


                                  Secondary
                          Read




Thursday, 8 November 12
Replica Sets


                App       Write
                                   Primary
                          Read

                                  Secondary
                          Read


                                  Secondary
                          Read




Thursday, 8 November 12
Replica Sets


                App
                                   Primary

                          Write
                                   Primary    Automatic Election of
                                                  new Primary
                          Read

                                  Secondary
                          Read




Thursday, 8 November 12
Replica Sets


                App
                                  Recovering

                          Write                New primary serves
                                   Primary            data
                          Read

                                  Secondary
                          Read




Thursday, 8 November 12
Replica Sets


                App
                                  Secondary
                          Read

                          Write
                                   Primary
                          Read

                                  Secondary
                          Read




Thursday, 8 November 12
Scalability




Thursday, 8 November 12
Horizontal Scalability




Thursday, 8 November 12
Sharding
       Data Distribution across nodes
       • Data location transparent to your code
       • Data distribution is automatic
       • Data re-distribution is automatic
       • Aggregate system resources horizontally
       • No code changes




Thursday, 8 November 12
Sharding - Range distribution

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


                      shard01                    shard02                   shard03




Thursday, 8 November 12
Sharding - Range distribution


                      shard01   shard02   shard03

                          a-i     j-r      s-z




Thursday, 8 November 12
Sharding - Splits


                      shard01   shard02   shard03

                          a-i   ja-jz      s-z
                                 k-r




Thursday, 8 November 12
Sharding - Splits


                      shard01   shard02   shard03

                          a-i    ja-ji     s-z
                                 ji-js
                                js-jw
                                 jz-r

Thursday, 8 November 12
Sharding - Auto Balancing


                      shard01   shard02   shard03

                          a-i    ja-ji     s-z
                                 ji-js
                      js-jw     js-jw
                                 jz-r      jz-r

Thursday, 8 November 12
Sharding - Auto Balancing


                      shard01   shard02   shard03

                          a-i    ja-ji     n-z
                                 ji-js
                      js-jw
                                           jz-r

Thursday, 8 November 12
Sharding - Routed Query
                                          find({_id: "norberto"})




                      shard01   shard02                  shard03

                          a-i    ja-ji                     n-z
                                 ji-js
                      js-jw
                                                           jz-r

Thursday, 8 November 12
Sharding - Routed Query
                                          find({_id: "norberto"})




                      shard01   shard02                  shard03

                          a-i    ja-ji                     n-z
                                 ji-js
                      js-jw
                                                           jz-r

Thursday, 8 November 12
Sharding - Scatter Gather
                                     find({email: "norberto@10gen.com"})




                      shard01   shard02                shard03

                          a-i    ja-ji                  n-z
                                 ji-js
                      js-jw
                                                        jz-r

Thursday, 8 November 12
Sharding - Scatter Gather
                                     find({email: "norberto@10gen.com"})




                      shard01   shard02                shard03

                          a-i    ja-ji                  n-z
                                 ji-js
                      js-jw
                                                        jz-r

Thursday, 8 November 12
Sharding - Caching
                      96 GB Mem
                     3:1 Data/Mem


                      shard01

                          a-i
     300 GB Data




                          j-r
                          n-z

                          300 GB



Thursday, 8 November 12
Aggregate Horizontal Resources
                      96 GB Mem      96 GB Mem      96 GB Mem
                     1:1 Data/Mem   1:1 Data/Mem   1:1 Data/Mem


                      shard01       shard02        shard03

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




                          100 GB      100 GB        100 GB


Thursday, 8 November 12
Consistency & Durability




Thursday, 8 November 12
Two choices for consistency

       •Eventual consistency
                •Allow updates when a system has been partitioned
                •Resolve conflicts later
                •Example: CouchDB, Cassandra

       •Immediate consistency
                •Limit the application of updates to a single master
                node for a given slice of data
                          •Another node can take over after a failure is detected
                •Avoids the possibility of conflicts
                •Example: MongoDB



Thursday, 8 November 12
Durability

       •For how long is my data available?
       •When do I now that my data is safe?
       •Where?
       •Mongodb style
                •Fire and Forget
                •Get Last Error
                •Journal Sync
                •Replica Safe



Thursday, 8 November 12
Data Durability




Thursday, 8 November 12
Flexibility




Thursday, 8 November 12
Data Model

       • Why JSON?
                • Provides a simple, well understood
                encapsulation of data
                • Maps simply to the object in your OO language
                • Linking & Embedding to describe relationships




Thursday, 8 November 12
Json




       place1 = {
       
 name : "10gen HQ",
       
 address : "578 Broadway 7th Floor",
       
 city : "New York",
       
   zip : "10011",
          tags : [ "business", "tech" ]
       }
Thursday, 8 November 12
Schema Design
       Relational Database




Thursday, 8 November 12
Schema Design
       MongoDB                      embedding




                          linking
Thursday, 8 November 12
Schemas in MongoDB

     Design documents that simply map to
     your application
     post = {author: "Hergé",
          date: new Date(),
          text: "Destination Moon",
          tags: ["comic", "adventure"]}

     > db.posts.save(post)


Thursday, 8 November 12
Embedding
       > db.blogs.find( { author: "Hergé"} )

         { _id : ObjectId("4c4ba5c0672c685e5e8aabf3"),
           author : "Hergé",
           date : ISODate("2011-09-18T09:56:06.298Z"),
           text : "Destination Moon",
           tags : [ "comic", "adventure" ],
           comments : [
   !         {
   !       !    author : "Kyle",
   !       !    date : ISODate("2011-09-19T09:56:06.298Z"),
   !       !    text : "great book"
   !         }
           ]
         }




Thursday, 8 November 12
JSON & Scaleout

       • Embedding removes need for
                • Distributed Joins
                • Two Phase commit
       • Enables data to be distributed across many nodes
       without penalty




Thursday, 8 November 12
Roadmap




Thursday, 8 November 12
2.4 Roadmap

       Must
       • Kerberos integration
       • LDAP/AD integration
       Nice To Have
       • Hash Shard Key
       • Background Index Build on Secondaries
       • V8 for Map/Reduce (replaces Spider Monkey)
       • Geo: intersecting polygons, Geo shard key
       • Agg: $out, more functions, speed improvements



Thursday, 8 November 12
And beyond

       • Full Text Search
       • Collection / Extent level locking
       • Field level security
       • Audit




Thursday, 8 November 12
http://bit.ly/UmUnsU
Thursday, 8 November 12
http://bit.ly/cnP77L
Thursday, 8 November 12
http://bit.ly/ODoMhh
Thursday, 8 November 12
http://bit.ly/uW2nk
Thursday, 8 November 12
download at mongodb.org!
                                     norberto@10gen.com

                          Support, Training, Consulting, Events, Meetups
                                     http://www.10gen.com


                                  We are Hiring!!!

       Facebook!                             Twitter!                     LinkedIn!
  http://bit.ly/mongofb!              http://twitter.com/mongodb!   http://linkd.in/joinmongo!


Thursday, 8 November 12

More Related Content

Viewers also liked

MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)Uwe Printz
 
Pp glob bus11_abinbev_brewing
Pp glob bus11_abinbev_brewingPp glob bus11_abinbev_brewing
Pp glob bus11_abinbev_brewingLucas Abrantes
 
Performance Tuning and Optimization
Performance Tuning and OptimizationPerformance Tuning and Optimization
Performance Tuning and OptimizationMongoDB
 
Sql vs NoSQL
Sql vs NoSQLSql vs NoSQL
Sql vs NoSQLRTigger
 
UX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and ArchivesUX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and ArchivesNed Potter
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging ChallengesAaron Irizarry
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with DataSeth Familian
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017Drift
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheLeslie Samuel
 
Big data analytics beyond beer and diapers
Big data analytics   beyond beer and diapersBig data analytics   beyond beer and diapers
Big data analytics beyond beer and diapersKai Zhao
 
Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Kai Zhao
 
Kylo为企业级的数据湖赋能 赵锴 kai_zhao_大数据_数据湖_datalake
Kylo为企业级的数据湖赋能 赵锴 kai_zhao_大数据_数据湖_datalakeKylo为企业级的数据湖赋能 赵锴 kai_zhao_大数据_数据湖_datalake
Kylo为企业级的数据湖赋能 赵锴 kai_zhao_大数据_数据湖_datalakeKai Zhao
 
物联网IoT用例 赵锴_kaizhao_大数据_物联网_云计算2
物联网IoT用例 赵锴_kaizhao_大数据_物联网_云计算2物联网IoT用例 赵锴_kaizhao_大数据_物联网_云计算2
物联网IoT用例 赵锴_kaizhao_大数据_物联网_云计算2Kai Zhao
 
DATA WAREHOUSING
DATA WAREHOUSINGDATA WAREHOUSING
DATA WAREHOUSINGKing Julian
 
GE Predix 新手入门 赵锴 物联网_IoT
GE Predix 新手入门 赵锴 物联网_IoTGE Predix 新手入门 赵锴 物联网_IoT
GE Predix 新手入门 赵锴 物联网_IoTKai Zhao
 
Ways of Seeing Data: Towards a Critical Literacy for Data Visualisations as R...
Ways of Seeing Data: Towards a Critical Literacy for Data Visualisations as R...Ways of Seeing Data: Towards a Critical Literacy for Data Visualisations as R...
Ways of Seeing Data: Towards a Critical Literacy for Data Visualisations as R...Jonathan Gray
 
Introduction to Data Warehousing
Introduction to Data WarehousingIntroduction to Data Warehousing
Introduction to Data WarehousingJason S
 

Viewers also liked (18)

MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)
 
Pp glob bus11_abinbev_brewing
Pp glob bus11_abinbev_brewingPp glob bus11_abinbev_brewing
Pp glob bus11_abinbev_brewing
 
Performance Tuning and Optimization
Performance Tuning and OptimizationPerformance Tuning and Optimization
Performance Tuning and Optimization
 
Sql vs NoSQL
Sql vs NoSQLSql vs NoSQL
Sql vs NoSQL
 
UX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and ArchivesUX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and Archives
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 
Big data analytics beyond beer and diapers
Big data analytics   beyond beer and diapersBig data analytics   beyond beer and diapers
Big data analytics beyond beer and diapers
 
Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)Mongodb introduction and_internal(simple)
Mongodb introduction and_internal(simple)
 
Beer industry
Beer industry Beer industry
Beer industry
 
Kylo为企业级的数据湖赋能 赵锴 kai_zhao_大数据_数据湖_datalake
Kylo为企业级的数据湖赋能 赵锴 kai_zhao_大数据_数据湖_datalakeKylo为企业级的数据湖赋能 赵锴 kai_zhao_大数据_数据湖_datalake
Kylo为企业级的数据湖赋能 赵锴 kai_zhao_大数据_数据湖_datalake
 
物联网IoT用例 赵锴_kaizhao_大数据_物联网_云计算2
物联网IoT用例 赵锴_kaizhao_大数据_物联网_云计算2物联网IoT用例 赵锴_kaizhao_大数据_物联网_云计算2
物联网IoT用例 赵锴_kaizhao_大数据_物联网_云计算2
 
DATA WAREHOUSING
DATA WAREHOUSINGDATA WAREHOUSING
DATA WAREHOUSING
 
GE Predix 新手入门 赵锴 物联网_IoT
GE Predix 新手入门 赵锴 物联网_IoTGE Predix 新手入门 赵锴 物联网_IoT
GE Predix 新手入门 赵锴 物联网_IoT
 
Ways of Seeing Data: Towards a Critical Literacy for Data Visualisations as R...
Ways of Seeing Data: Towards a Critical Literacy for Data Visualisations as R...Ways of Seeing Data: Towards a Critical Literacy for Data Visualisations as R...
Ways of Seeing Data: Towards a Critical Literacy for Data Visualisations as R...
 
Introduction to Data Warehousing
Introduction to Data WarehousingIntroduction to Data Warehousing
Introduction to Data Warehousing
 

Similar to MongoDB Basic Concepts Overview

Enterprise javascriptsession2
Enterprise javascriptsession2Enterprise javascriptsession2
Enterprise javascriptsession2Troy Miles
 
Performance test - YaJUG Octobre 2012
Performance test - YaJUG Octobre 2012Performance test - YaJUG Octobre 2012
Performance test - YaJUG Octobre 2012Claude Falguiere
 
TorqueBox - When Java meets Ruby
TorqueBox - When Java meets RubyTorqueBox - When Java meets Ruby
TorqueBox - When Java meets RubyBruno Oliveira
 
Duspviz sketchup
Duspviz sketchupDuspviz sketchup
Duspviz sketchupDUSPviz
 
Pinterest的数据库分片架构
Pinterest的数据库分片架构Pinterest的数据库分片架构
Pinterest的数据库分片架构Tommy Chiu
 
Municipal Government Meets NoSQL
Municipal Government Meets NoSQLMunicipal Government Meets NoSQL
Municipal Government Meets NoSQLMongoDB
 
HOW TO DO AI IN 2013 from Roadmap 2012
HOW TO DO AI IN 2013 from Roadmap 2012HOW TO DO AI IN 2013 from Roadmap 2012
HOW TO DO AI IN 2013 from Roadmap 2012Gigaom
 
Modern HTML & CSS Coding: Speed, Semantics & Structure
Modern HTML & CSS Coding: Speed, Semantics & StructureModern HTML & CSS Coding: Speed, Semantics & Structure
Modern HTML & CSS Coding: Speed, Semantics & StructureRaven Tools
 
[JVMLS 12] Kotlin / Java Interop
[JVMLS 12] Kotlin / Java Interop[JVMLS 12] Kotlin / Java Interop
[JVMLS 12] Kotlin / Java InteropAndrey Breslav
 
Hadoop: A Hands-on Introduction
Hadoop: A Hands-on IntroductionHadoop: A Hands-on Introduction
Hadoop: A Hands-on IntroductionClaudio Martella
 
Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDBYnon Perek
 
Connect and Collaborate B: Version 3
Connect and Collaborate B: Version 3Connect and Collaborate B: Version 3
Connect and Collaborate B: Version 3Terri Sallee
 
Software Libraries And Numbers
Software Libraries And NumbersSoftware Libraries And Numbers
Software Libraries And NumbersRobert Reiz
 
Localizing iOS Apps
Localizing iOS AppsLocalizing iOS Apps
Localizing iOS Appsweissazool
 
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
 
Cloud Messaging With Cloud Foundry
Cloud Messaging With Cloud FoundryCloud Messaging With Cloud Foundry
Cloud Messaging With Cloud FoundryAlvaro Videla
 
Enterprise javascriptsession1
Enterprise javascriptsession1Enterprise javascriptsession1
Enterprise javascriptsession1Troy Miles
 
What's New in the PHP Driver
What's New in the PHP DriverWhat's New in the PHP Driver
What's New in the PHP DriverMongoDB
 
Active Record Introduction - 3
Active Record Introduction - 3Active Record Introduction - 3
Active Record Introduction - 3Blazing Cloud
 

Similar to MongoDB Basic Concepts Overview (20)

Enterprise javascriptsession2
Enterprise javascriptsession2Enterprise javascriptsession2
Enterprise javascriptsession2
 
Performance test - YaJUG Octobre 2012
Performance test - YaJUG Octobre 2012Performance test - YaJUG Octobre 2012
Performance test - YaJUG Octobre 2012
 
TorqueBox - When Java meets Ruby
TorqueBox - When Java meets RubyTorqueBox - When Java meets Ruby
TorqueBox - When Java meets Ruby
 
Duspviz sketchup
Duspviz sketchupDuspviz sketchup
Duspviz sketchup
 
Pinterest的数据库分片架构
Pinterest的数据库分片架构Pinterest的数据库分片架构
Pinterest的数据库分片架构
 
Municipal Government Meets NoSQL
Municipal Government Meets NoSQLMunicipal Government Meets NoSQL
Municipal Government Meets NoSQL
 
HOW TO DO AI IN 2013 from Roadmap 2012
HOW TO DO AI IN 2013 from Roadmap 2012HOW TO DO AI IN 2013 from Roadmap 2012
HOW TO DO AI IN 2013 from Roadmap 2012
 
Modern HTML & CSS Coding: Speed, Semantics & Structure
Modern HTML & CSS Coding: Speed, Semantics & StructureModern HTML & CSS Coding: Speed, Semantics & Structure
Modern HTML & CSS Coding: Speed, Semantics & Structure
 
[JVMLS 12] Kotlin / Java Interop
[JVMLS 12] Kotlin / Java Interop[JVMLS 12] Kotlin / Java Interop
[JVMLS 12] Kotlin / Java Interop
 
Hadoop: A Hands-on Introduction
Hadoop: A Hands-on IntroductionHadoop: A Hands-on Introduction
Hadoop: A Hands-on Introduction
 
Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDB
 
Connect and Collaborate B: Version 3
Connect and Collaborate B: Version 3Connect and Collaborate B: Version 3
Connect and Collaborate B: Version 3
 
Software Libraries And Numbers
Software Libraries And NumbersSoftware Libraries And Numbers
Software Libraries And Numbers
 
Localizing iOS Apps
Localizing iOS AppsLocalizing iOS Apps
Localizing iOS Apps
 
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
 
Cloud Messaging With Cloud Foundry
Cloud Messaging With Cloud FoundryCloud Messaging With Cloud Foundry
Cloud Messaging With Cloud Foundry
 
Enterprise javascriptsession1
Enterprise javascriptsession1Enterprise javascriptsession1
Enterprise javascriptsession1
 
What's New in the PHP Driver
What's New in the PHP DriverWhat's New in the PHP Driver
What's New in the PHP Driver
 
Active Record Introduction - 3
Active Record Introduction - 3Active Record Introduction - 3
Active Record Introduction - 3
 
StORM preview
StORM previewStORM preview
StORM preview
 

More from MongoDB

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

More from MongoDB (20)

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

MongoDB Basic Concepts Overview

  • 1. MongoDB Basic Concepts Norberto Leite Senior Solutions Architect, EMEA norberto@10gen.com @nleite Thursday, 8 November 12
  • 2. Agenda •Overview •Replication •Scalability •Consistency & Durability •Flexibility, Developer Experience •Roadmap Thursday, 8 November 12
  • 3. Your data needs started here... http://bit.ly/OT71M4 Thursday, 8 November 12
  • 4. ...but soon you had to be here http://bit.ly/Oxcsis Thursday, 8 November 12
  • 5. Basic Concepts Application Document Oriented High { author : “steve”, date : new Date(), text : “About MongoDB...”, Performance tags : [“tech”, “database”]} Fully Consistent Horizontally Scalable Thursday, 8 November 12
  • 6. Tradeoff: Scale vs Functionality • memcached scalability & performance •key/value • RDBMS depth of functionality Thursday, 8 November 12
  • 8. Why do we need replication •Failover •Backups •Secondary batch jobs •High availability Thursday, 8 November 12
  • 9. Replica Sets Data Availability across nodes • Data Protection • Multiple copies of the data • Spread across Data Centers, AZs • High Availability • Automated Failover • Automated Recovery Thursday, 8 November 12
  • 10. Replica Sets App Write Primary Asynchronous Read Replication Secondary Read Secondary Read Thursday, 8 November 12
  • 11. Replica Sets App Write Primary Read Secondary Read Secondary Read Thursday, 8 November 12
  • 12. Replica Sets App Primary Write Primary Automatic Election of new Primary Read Secondary Read Thursday, 8 November 12
  • 13. Replica Sets App Recovering Write New primary serves Primary data Read Secondary Read Thursday, 8 November 12
  • 14. Replica Sets App Secondary Read Write Primary Read Secondary Read Thursday, 8 November 12
  • 17. Sharding Data Distribution across nodes • Data location transparent to your code • Data distribution is automatic • Data re-distribution is automatic • Aggregate system resources horizontally • No code changes Thursday, 8 November 12
  • 18. Sharding - Range distribution sh.shardCollection("test.tweets", {_id: 1} , false) shard01 shard02 shard03 Thursday, 8 November 12
  • 19. Sharding - Range distribution shard01 shard02 shard03 a-i j-r s-z Thursday, 8 November 12
  • 20. Sharding - Splits shard01 shard02 shard03 a-i ja-jz s-z k-r Thursday, 8 November 12
  • 21. Sharding - Splits shard01 shard02 shard03 a-i ja-ji s-z ji-js js-jw jz-r Thursday, 8 November 12
  • 22. Sharding - Auto Balancing shard01 shard02 shard03 a-i ja-ji s-z ji-js js-jw js-jw jz-r jz-r Thursday, 8 November 12
  • 23. Sharding - Auto Balancing shard01 shard02 shard03 a-i ja-ji n-z ji-js js-jw jz-r Thursday, 8 November 12
  • 24. Sharding - Routed Query find({_id: "norberto"}) shard01 shard02 shard03 a-i ja-ji n-z ji-js js-jw jz-r Thursday, 8 November 12
  • 25. Sharding - Routed Query find({_id: "norberto"}) shard01 shard02 shard03 a-i ja-ji n-z ji-js js-jw jz-r Thursday, 8 November 12
  • 26. Sharding - Scatter Gather find({email: "norberto@10gen.com"}) shard01 shard02 shard03 a-i ja-ji n-z ji-js js-jw jz-r Thursday, 8 November 12
  • 27. Sharding - Scatter Gather find({email: "norberto@10gen.com"}) shard01 shard02 shard03 a-i ja-ji n-z ji-js js-jw jz-r Thursday, 8 November 12
  • 28. Sharding - Caching 96 GB Mem 3:1 Data/Mem shard01 a-i 300 GB Data j-r n-z 300 GB Thursday, 8 November 12
  • 29. Aggregate Horizontal Resources 96 GB Mem 96 GB Mem 96 GB Mem 1:1 Data/Mem 1:1 Data/Mem 1:1 Data/Mem shard01 shard02 shard03 a-i j-r n-z 300 GB Data 100 GB 100 GB 100 GB Thursday, 8 November 12
  • 31. Two choices for consistency •Eventual consistency •Allow updates when a system has been partitioned •Resolve conflicts later •Example: CouchDB, Cassandra •Immediate consistency •Limit the application of updates to a single master node for a given slice of data •Another node can take over after a failure is detected •Avoids the possibility of conflicts •Example: MongoDB Thursday, 8 November 12
  • 32. Durability •For how long is my data available? •When do I now that my data is safe? •Where? •Mongodb style •Fire and Forget •Get Last Error •Journal Sync •Replica Safe Thursday, 8 November 12
  • 35. Data Model • Why JSON? • Provides a simple, well understood encapsulation of data • Maps simply to the object in your OO language • Linking & Embedding to describe relationships Thursday, 8 November 12
  • 36. Json place1 = { name : "10gen HQ", address : "578 Broadway 7th Floor", city : "New York", zip : "10011", tags : [ "business", "tech" ] } Thursday, 8 November 12
  • 37. Schema Design Relational Database Thursday, 8 November 12
  • 38. Schema Design MongoDB embedding linking Thursday, 8 November 12
  • 39. Schemas in MongoDB Design documents that simply map to your application post = {author: "Hergé", date: new Date(), text: "Destination Moon", tags: ["comic", "adventure"]} > db.posts.save(post) Thursday, 8 November 12
  • 40. Embedding > db.blogs.find( { author: "Hergé"} ) { _id : ObjectId("4c4ba5c0672c685e5e8aabf3"), author : "Hergé", date : ISODate("2011-09-18T09:56:06.298Z"), text : "Destination Moon", tags : [ "comic", "adventure" ], comments : [ ! { ! ! author : "Kyle", ! ! date : ISODate("2011-09-19T09:56:06.298Z"), ! ! text : "great book" ! } ] } Thursday, 8 November 12
  • 41. JSON & Scaleout • Embedding removes need for • Distributed Joins • Two Phase commit • Enables data to be distributed across many nodes without penalty Thursday, 8 November 12
  • 43. 2.4 Roadmap Must • Kerberos integration • LDAP/AD integration Nice To Have • Hash Shard Key • Background Index Build on Secondaries • V8 for Map/Reduce (replaces Spider Monkey) • Geo: intersecting polygons, Geo shard key • Agg: $out, more functions, speed improvements Thursday, 8 November 12
  • 44. And beyond • Full Text Search • Collection / Extent level locking • Field level security • Audit Thursday, 8 November 12
  • 49. download at mongodb.org! norberto@10gen.com Support, Training, Consulting, Events, Meetups http://www.10gen.com We are Hiring!!! Facebook! Twitter! LinkedIn! http://bit.ly/mongofb! http://twitter.com/mongodb! http://linkd.in/joinmongo! Thursday, 8 November 12