SlideShare uma empresa Scribd logo
1 de 45
Baixar para ler offline
Frankfurt NoSQL User Group
                                    Chris Harris
                            Email : charris@10gen.com
                               Twitter : cj_harris5



Wednesday, 22 February 12
As simple as possible,
                                        but no simpler
                                 Memcached
                                    Key / Value
     Scalability & Performance




                                                                    RDBMS




                                           Depth of functionality



Wednesday, 22 February 12
Key/Value Store
                            MongoDB
                            Relational Database




Wednesday, 22 February 12
Terminology

               RDBMS            MongoDB
               Table            Collection
               Row(s)           JSON Document
               Index            Index
               Join             Embedding & Linking
               Partition        Shard
               Partition Key    Shard Key


Wednesday, 22 February 12
Here is a “simple” SQL Model
       mysql> select * from book;
       +----+----------------------------------------------------------+
       | id | title                            |
       +----+----------------------------------------------------------+
       | 1 | The Demon-Haunted World: Science as a Candle in the Dark |
       | 2 | Cosmos                               |
       | 3 | Programming in Scala                     |
       +----+----------------------------------------------------------+
       3 rows in set (0.00 sec)

       mysql> select * from bookauthor;
       +---------+-----------+
       | book_id | author_id |
       +---------+-----------+
       |    1|       1|
       |    2|       1|
       |    3|       2|
       |    3|       3|
       |    3|       4|
       +---------+-----------+
       5 rows in set (0.00 sec)

       mysql> select * from author;
       +----+-----------+------------+-------------+-------------+---------------+
       | id | last_name | first_name | middle_name | nationality | year_of_birth |
       +----+-----------+------------+-------------+-------------+---------------+
       | 1 | Sagan    | Carl     | Edward    | NULL    | 1934         |
       | 2 | Odersky | Martin       | NULL     | DE     | 1958         |
       | 3 | Spoon    | Lex      | NULL     | NULL    | NULL         |
       | 4 | Venners | Bill      | NULL    | NULL     | NULL        |
       +----+-----------+------------+-------------+-------------+---------------+
       4 rows in set (0.00 sec)




Wednesday, 22 February 12
Flexible “Schemas”

              { “author”: “brendan”,
                “text”: “...” }

                                       { “author”: “brendan”,
                                         “text”: “...”,
                                         “tags”: [“mongodb”,
                                                “nosql”] }




Wednesday, 22 February 12
The Same Data in MongoDB

             {
           "_id" : ObjectId("4dfa6baa9c65dae09a4bbda5"),
           "title" : "Programming in Scala",
           "author" : [
               {
                  "first_name" : "Martin",
                  "last_name" : "Odersky",
                  "nationality" : "DE",
                  "year_of_birth" : 1958
               },
               {
                  "first_name" : "Lex",
                  "last_name" : "Spoon"
               },
               {
                  "first_name" : "Bill",
                  "last_name" : "Venners"
               }
           ]
       }




Wednesday, 22 February 12
CRUD Operations




Wednesday, 22 February 12
db.test.insert({fn: “Chris”, ln: “Harris”})




Wednesday, 22 February 12
db.test.find({fn: “Chris”})




Wednesday, 22 February 12
Cursors

                                 $gt, $lt, $gte, $lte, $ne, $all, $in, $nin, $or,
                               $not, $mod, $size, $exists, $type, $elemMatch


                       > var c = db.test.find({x: 20}).skip(20).limit(10)> c.next()
                       > c.next()
                       ...

                                                       query
                                             first N results + cursor id


                                               getMore w/ cursor id
                                           next N results + cursor id or 0
                                                         ...


Wednesday, 22 February 12
Creating Indexes
        An index on _id is automatic.
        For more use ensureIndex:


                     db.blogs.ensureIndex({author: 1})

                     1 = ascending
                     -1 = descending




Wednesday, 22 February 12
Compound Indexes


          db.blogs.save({
            author: "James",
            ts: new Date()
            ...
          });

          db.blogs.ensureIndex({author: 1, ts: -1})




Wednesday, 22 February 12
Unique Indexes


          db.blogs.save({
            author: "James",
            title: "My first blog"
            ...
          });

          db.blogs.ensureIndex({title: 1}, {unique: true})




Wednesday, 22 February 12
Indexing Embedded Documents
          db.blogs.save({
            title: "My First blog",
            stats : { views: 0,
                    followers: 0 }
          });

          db.blogs.ensureIndex({"stats.followers": -1})

          db.blogs.find({"stats.followers": {$gt: 500}})




Wednesday, 22 February 12
Indexing Embedded Arrays
          db.blogs.save({
            title: "My First blog",
            comments: [
              {author: "James", ts : new Date()} ]
          });

          db.blogs.ensureIndex({"comments.author": 1})

          db.blogs.find({"comments.author": "James"})




Wednesday, 22 February 12
Multikeys
          db.blogs.save({
            title: "My Second blog",
            tags: ["mongodb", "NoSQL"]
          });

          db.blogs.ensureIndex({tags: 1})

          db.blogs.find({tags: "NoSQL"})




Wednesday, 22 February 12
Covered Indexes
          • From 1.8.0
          • Query resolved in index only
          • Need to exclude _id from items projected
          db.blogs.save({
            author: "James",
            title: "My first blog"
          });

          db.blogs.ensureIndex({author: 1})

          db.blogs.find({author: "James"},
                   {author: 1, _id:0}))


Wednesday, 22 February 12
Sparse Indexes
          • From 1.8.0
          • Key value included if and only if the value is present
          • Reduces size of index
          • Limited to a single field
         db.blogs.ensureIndex({loc: 1}, {sparse: true})

         // loc key stored for Ben & Sarah only
         db.blogs.save({author: "Jim"})
         db.blogs.save({author: "Ben", loc: null})
         db.blogs.save({author: "Sarah", loc: "CA"})




Wednesday, 22 February 12
Geospatial
       • Geo hash stored in B-Tree
       • First two values indexed
          db.blogs.save({
            loc: { long: 40.739037, lat: 40.739037 }
          });

          db.blogs.save({
            loc: [40.739037, 40.739037]
          });

          db.blogs.ensureIndex({"loc": "2d"})




Wednesday, 22 February 12
Replication




Wednesday, 22 February 12
Types of outage

       • Planned
               • Hardware upgrade
               • O/S or file-system tuning
               • Relocation of data to new file-system / storage
               • Software upgrade

       • Unplanned
               • Hardware failure
               • Data center failure
               • Region outage
               • Human error
               • Application corruption
Wednesday, 22 February 12
Replica Set features
           • A cluster of N servers
           • Any (one) node can be primary
           • Consensus election of primary
           • Automatic failover
           • Automatic recovery
           • All writes to primary
           • Reads can be to primary (default) or a secondary




Wednesday, 22 February 12
How MongoDB Replication works

                            Member
                              1               Member
                                                3




                                     Member
                                       2



    •Set is made up of 2 or more nodes


Wednesday, 22 February 12
How MongoDB Replication works

                            Member
                              1                Member
                                                 3




                                     Member
                                        2
                                     PRIMARY


    •Election establishes the PRIMARY
    •Data replication from PRIMARY to SECONDARY

Wednesday, 22 February 12
How MongoDB Replication works
                                        negotiate
                                       new master
                            Member
                              1                     Member
                                                      3




                                     Member
                                       2
                                     DOWN


    •PRIMARY may fail
    •Automatic election of new PRIMARY if majority
    exists
Wednesday, 22 February 12
How MongoDB Replication works

                            Member
                              1               Member
                                                 3
                                              PRIMARY




                                     Member
                                       2
                                     DOWN


    •New PRIMARY elected
    •Replication Set re-established

Wednesday, 22 February 12
How MongoDB Replication works

                            Member
                              1                   Member
                                                     3
                                                  PRIMARY




                                     Member 2
                                     RECOVERING




    •Automatic recovery


Wednesday, 22 February 12
How MongoDB Replication works

                            Member
                              1               Member
                                                 3
                                              PRIMARY




                                     Member
                                       2



    •Replication Set re-established


Wednesday, 22 February 12
Sharding




Wednesday, 22 February 12
http://community.qlikview.com/cfs-filesystemfile.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/
                           theqlikviewblog/Cutting-Grass-with-Scissors-_2D00_-2.jpg


Wednesday, 22 February 12
http://www.bitquill.net/blog/wp-content/uploads/2008/07/pack_of_harvesters.jpg

Wednesday, 22 February 12
MongoDB Scaling - Single Node
        read




                            node_a1




                                      write


Wednesday, 22 February 12
Write scaling - add Shards
        read


                            shard1    shard2


                            node_c1   node_c2


                            node_b1   node_b2


                            node_a1   node_a2




                                                write


Wednesday, 22 February 12
Write scaling - add Shards
        read


                            shard1    shard2    shard3


                            node_c1   node_c2   node_c3


                            node_b1   node_b2   node_b3


                            node_a1   node_a2   node_a3




                                                          write


Wednesday, 22 February 12
MongoDB Sharding

       • Automatic partitioning and management
       • Range based
       • Convert to sharded system with no downtime
       • Fully consistent




Wednesday, 22 February 12
How MongoDB Sharding works

       > db.posts.save( {age:40} )



                            -∞   +∞  

             -∞   40              41 +∞  



    •Data in inserted
    •Ranges are split into more “chunks”
Wednesday, 22 February 12
How MongoDB Sharding works

       > db.posts.save( {age:40} )
       > db.posts.save( {age:50} )


                            -∞   +∞  

             -∞   40              41 +∞  

                             41   50    51 +∞  

    •More Data in inserted
    •Ranges are split into more“chunks”
Wednesday, 22 February 12
How MongoDB Sharding works

       > db.posts.save( {age:40} )
       > db.posts.save( {age:50} )
       > db.posts.save( {age:60} )

                            -∞   +∞  

             -∞   40              41 +∞  

                             41   50    51 +∞  

                                   51   60   61 +∞  


Wednesday, 22 February 12
Balancing
                                                          mongos
                                                                                                      config
                                                          balancer
                                                                                                      config
              Chunks!
                                                                                                      config




                  1         2   3    4    13    14   15   16         25    26   27   28   37    38   39   40

                  5         6   7    8    17    18   19   20         29    30   31   32   41    42   43   44

                  9     10      11   12   21    22   23   24         33    34   35   36   45    46   47   48


                      Shard 1                  Shard 2                    Shard 3              Shard 4




Wednesday, 22 February 12
Balancing
                                                            mongos
                                                                                                        config
                                                            balancer
                                                                                                        config


                                          Imbalance
                                           Imbalance                                                    config




                  1         2   3    4

                  5         6   7    8

                  9     10      11   12     21    22   23   24         33    34   35   36   45    46   47   48


                      Shard 1                    Shard 2                    Shard 3              Shard 4




Wednesday, 22 February 12
Balancing
                                                          mongos
                                                                                                      config
                                                          balancer
                                                                                                      config

                                                 Move chunk 1 to                                      config
                                                 Shard 2




                  1         2   3    4

                  5         6   7    8

                  9     10      11   12   21    22   23   24         33    34   35   36   45    46   47   48


                      Shard 1                  Shard 2                    Shard 3              Shard 4




Wednesday, 22 February 12
Balancing
                                                          mongos
                                                                                                      config
                                                          balancer
                                                                                                      config

                                                                                                      config




                  1         2   3    4

                  5         6   7    8

                  9     10      11   12   21    22   23   24         33    34   35   36   45    46   47   48


                      Shard 1                  Shard 2                    Shard 3              Shard 4




Wednesday, 22 February 12
Balancing
                                                          mongos
                                                                                                      config
                                                          balancer
                                                                                                      config

                                                                                                      config




                            2   3    4

                  5         6   7    8    1

                  9     10      11   12   21    22   23   24         33    34   35   36   45    46   47   48


                      Shard 1                  Shard 2                    Shard 3              Shard 4




Wednesday, 22 February 12
Balancing
                                                          mongos
                                                                                                      config
                                                          balancer
                                                                                                      config
                                                               Chunk 1 now lives on
                                                                    Shard 2
                                                                                                      config




                            2   3    4

                  5         6   7    8    1

                  9     10      11   12   21    22   23   24         33    34   35   36   45    46   47   48


                      Shard 1                  Shard 2                    Shard 3              Shard 4




Wednesday, 22 February 12

Mais conteúdo relacionado

Mais procurados

Indexing Strategies to Help You Scale
Indexing Strategies to Help You ScaleIndexing Strategies to Help You Scale
Indexing Strategies to Help You ScaleMongoDB
 
Webinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in DocumentsWebinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in DocumentsMongoDB
 
Pinterest的数据库分片架构
Pinterest的数据库分片架构Pinterest的数据库分片架构
Pinterest的数据库分片架构Tommy Chiu
 
Building a Scalable Inbox System with MongoDB and Java
Building a Scalable Inbox System with MongoDB and JavaBuilding a Scalable Inbox System with MongoDB and Java
Building a Scalable Inbox System with MongoDB and Javaantoinegirbal
 
MongoDB .local Chicago 2019: Using Client Side Encryption in MongoDB 4.2
MongoDB .local Chicago 2019: Using Client Side Encryption in MongoDB 4.2MongoDB .local Chicago 2019: Using Client Side Encryption in MongoDB 4.2
MongoDB .local Chicago 2019: Using Client Side Encryption in MongoDB 4.2MongoDB
 
Building Apps with MongoDB
Building Apps with MongoDBBuilding Apps with MongoDB
Building Apps with MongoDBNate Abele
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance TuningMongoDB
 
MongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMike Friedman
 
MongoDB Schema Design
MongoDB Schema DesignMongoDB Schema Design
MongoDB Schema DesignAlex Litvinok
 
Webinar: Schema Design
Webinar: Schema DesignWebinar: Schema Design
Webinar: Schema DesignMongoDB
 
Building a Social Network with MongoDB
  Building a Social Network with MongoDB  Building a Social Network with MongoDB
Building a Social Network with MongoDBFred Chu
 
Dev Jumpstart: Schema Design Best Practices
Dev Jumpstart: Schema Design Best PracticesDev Jumpstart: Schema Design Best Practices
Dev Jumpstart: Schema Design Best PracticesMongoDB
 
Schema Design with MongoDB
Schema Design with MongoDBSchema Design with MongoDB
Schema Design with MongoDBrogerbodamer
 
Storing tree structures with MongoDB
Storing tree structures with MongoDBStoring tree structures with MongoDB
Storing tree structures with MongoDBVyacheslav
 
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...MongoDB
 
Choosing a Shard key
Choosing a Shard keyChoosing a Shard key
Choosing a Shard keyMongoDB
 
MongoDB .local Houston 2019: Using Client Side Encryption in MongoDB 4.2
MongoDB .local Houston 2019: Using Client Side Encryption in MongoDB 4.2MongoDB .local Houston 2019: Using Client Side Encryption in MongoDB 4.2
MongoDB .local Houston 2019: Using Client Side Encryption in MongoDB 4.2MongoDB
 
5 Pitfalls to Avoid with MongoDB
5 Pitfalls to Avoid with MongoDB5 Pitfalls to Avoid with MongoDB
5 Pitfalls to Avoid with MongoDBTim Callaghan
 

Mais procurados (20)

Indexing Strategies to Help You Scale
Indexing Strategies to Help You ScaleIndexing Strategies to Help You Scale
Indexing Strategies to Help You Scale
 
Webinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in DocumentsWebinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in Documents
 
Pinterest的数据库分片架构
Pinterest的数据库分片架构Pinterest的数据库分片架构
Pinterest的数据库分片架构
 
Building a Scalable Inbox System with MongoDB and Java
Building a Scalable Inbox System with MongoDB and JavaBuilding a Scalable Inbox System with MongoDB and Java
Building a Scalable Inbox System with MongoDB and Java
 
MongoDB .local Chicago 2019: Using Client Side Encryption in MongoDB 4.2
MongoDB .local Chicago 2019: Using Client Side Encryption in MongoDB 4.2MongoDB .local Chicago 2019: Using Client Side Encryption in MongoDB 4.2
MongoDB .local Chicago 2019: Using Client Side Encryption in MongoDB 4.2
 
Building Apps with MongoDB
Building Apps with MongoDBBuilding Apps with MongoDB
Building Apps with MongoDB
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance Tuning
 
MongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World ExamplesMongoDB Schema Design: Four Real-World Examples
MongoDB Schema Design: Four Real-World Examples
 
MongoDB Schema Design
MongoDB Schema DesignMongoDB Schema Design
MongoDB Schema Design
 
Webinar: Schema Design
Webinar: Schema DesignWebinar: Schema Design
Webinar: Schema Design
 
Building a Social Network with MongoDB
  Building a Social Network with MongoDB  Building a Social Network with MongoDB
Building a Social Network with MongoDB
 
Dev Jumpstart: Schema Design Best Practices
Dev Jumpstart: Schema Design Best PracticesDev Jumpstart: Schema Design Best Practices
Dev Jumpstart: Schema Design Best Practices
 
Indexing
IndexingIndexing
Indexing
 
Schema Design with MongoDB
Schema Design with MongoDBSchema Design with MongoDB
Schema Design with MongoDB
 
Storing tree structures with MongoDB
Storing tree structures with MongoDBStoring tree structures with MongoDB
Storing tree structures with MongoDB
 
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
MongoDB .local Munich 2019: Best Practices for Working with IoT and Time-seri...
 
Choosing a Shard key
Choosing a Shard keyChoosing a Shard key
Choosing a Shard key
 
MongoDB .local Houston 2019: Using Client Side Encryption in MongoDB 4.2
MongoDB .local Houston 2019: Using Client Side Encryption in MongoDB 4.2MongoDB .local Houston 2019: Using Client Side Encryption in MongoDB 4.2
MongoDB .local Houston 2019: Using Client Side Encryption in MongoDB 4.2
 
5 Pitfalls to Avoid with MongoDB
5 Pitfalls to Avoid with MongoDB5 Pitfalls to Avoid with MongoDB
5 Pitfalls to Avoid with MongoDB
 
MongoDB dessi-codemotion
MongoDB dessi-codemotionMongoDB dessi-codemotion
MongoDB dessi-codemotion
 

Destaque

How to install the zwave plugin switch controller
How to install the zwave plugin switch controllerHow to install the zwave plugin switch controller
How to install the zwave plugin switch controllerLeolaHuffman
 
Don eppelheimer, trane
Don eppelheimer, traneDon eppelheimer, trane
Don eppelheimer, traneSarah El Akkad
 
How to Infuse Your Media Planning with Social Data - by Forrester & Networked...
How to Infuse Your Media Planning with Social Data - by Forrester & Networked...How to Infuse Your Media Planning with Social Data - by Forrester & Networked...
How to Infuse Your Media Planning with Social Data - by Forrester & Networked...Networked Insights
 
Ovos trabalhados arte na casca de ovos
Ovos trabalhados   arte na casca de ovosOvos trabalhados   arte na casca de ovos
Ovos trabalhados arte na casca de ovosSel Selmha
 
Fraudes digitais no mundo pós-SPED - ENECON - 17.6.2011
Fraudes digitais no mundo pós-SPED - ENECON - 17.6.2011Fraudes digitais no mundo pós-SPED - ENECON - 17.6.2011
Fraudes digitais no mundo pós-SPED - ENECON - 17.6.2011Roberto Dias Duarte
 
Introduction to Ext JS 4
Introduction to Ext JS 4Introduction to Ext JS 4
Introduction to Ext JS 4Stefan Gehrig
 
Pesquisa AvançAda Na Internet 2009
Pesquisa AvançAda Na Internet 2009Pesquisa AvançAda Na Internet 2009
Pesquisa AvançAda Na Internet 2009Luis Vidigal
 
Curso de marketing em mídias sociais
Curso de marketing em mídias sociaisCurso de marketing em mídias sociais
Curso de marketing em mídias sociaisEdney Souza
 
Adobe Digital Publishing Suite by dualpixel
Adobe Digital Publishing Suite by dualpixelAdobe Digital Publishing Suite by dualpixel
Adobe Digital Publishing Suite by dualpixeldualpixel
 
Comparative analysis on E-Gov web sites
Comparative analysis on E-Gov web sitesComparative analysis on E-Gov web sites
Comparative analysis on E-Gov web sitesAndrea Tino
 
Web Application Hacking 2004
Web Application Hacking 2004Web Application Hacking 2004
Web Application Hacking 2004Mike Spaulding
 

Destaque (20)

How to install the zwave plugin switch controller
How to install the zwave plugin switch controllerHow to install the zwave plugin switch controller
How to install the zwave plugin switch controller
 
Don eppelheimer, trane
Don eppelheimer, traneDon eppelheimer, trane
Don eppelheimer, trane
 
How to Infuse Your Media Planning with Social Data - by Forrester & Networked...
How to Infuse Your Media Planning with Social Data - by Forrester & Networked...How to Infuse Your Media Planning with Social Data - by Forrester & Networked...
How to Infuse Your Media Planning with Social Data - by Forrester & Networked...
 
Ovos trabalhados arte na casca de ovos
Ovos trabalhados   arte na casca de ovosOvos trabalhados   arte na casca de ovos
Ovos trabalhados arte na casca de ovos
 
Fraudes digitais no mundo pós-SPED - ENECON - 17.6.2011
Fraudes digitais no mundo pós-SPED - ENECON - 17.6.2011Fraudes digitais no mundo pós-SPED - ENECON - 17.6.2011
Fraudes digitais no mundo pós-SPED - ENECON - 17.6.2011
 
Quinto a
Quinto aQuinto a
Quinto a
 
Introduction to Ext JS 4
Introduction to Ext JS 4Introduction to Ext JS 4
Introduction to Ext JS 4
 
Pesquisa AvançAda Na Internet 2009
Pesquisa AvançAda Na Internet 2009Pesquisa AvançAda Na Internet 2009
Pesquisa AvançAda Na Internet 2009
 
Infolitigpart1
Infolitigpart1Infolitigpart1
Infolitigpart1
 
Curso de marketing em mídias sociais
Curso de marketing em mídias sociaisCurso de marketing em mídias sociais
Curso de marketing em mídias sociais
 
Adobe Digital Publishing Suite by dualpixel
Adobe Digital Publishing Suite by dualpixelAdobe Digital Publishing Suite by dualpixel
Adobe Digital Publishing Suite by dualpixel
 
00 a linguagem html
00 a linguagem html00 a linguagem html
00 a linguagem html
 
Daron Yöndem - ie8 Ebook Tr
Daron Yöndem - ie8 Ebook TrDaron Yöndem - ie8 Ebook Tr
Daron Yöndem - ie8 Ebook Tr
 
Ijm 06 10_012
Ijm 06 10_012Ijm 06 10_012
Ijm 06 10_012
 
Comparative analysis on E-Gov web sites
Comparative analysis on E-Gov web sitesComparative analysis on E-Gov web sites
Comparative analysis on E-Gov web sites
 
Java E
Java EJava E
Java E
 
Web Application Hacking 2004
Web Application Hacking 2004Web Application Hacking 2004
Web Application Hacking 2004
 
Unemployment
UnemploymentUnemployment
Unemployment
 
JSF2 and JSP
JSF2 and JSPJSF2 and JSP
JSF2 and JSP
 
document
documentdocument
document
 

Semelhante a MongoDB @ Frankfurt NoSql User Group

Mongodb intro
Mongodb introMongodb intro
Mongodb introchristkv
 
2012 mongo db_bangalore_roadmap_new
2012 mongo db_bangalore_roadmap_new2012 mongo db_bangalore_roadmap_new
2012 mongo db_bangalore_roadmap_newMongoDB
 
Starting with MongoDB
Starting with MongoDBStarting with MongoDB
Starting with MongoDBDoThinger
 
De normalised london aggregation framework overview
De normalised london  aggregation framework overview De normalised london  aggregation framework overview
De normalised london aggregation framework overview Chris Harris
 
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
 
MongoSV Schema Workshop
MongoSV Schema WorkshopMongoSV Schema Workshop
MongoSV Schema WorkshopMongoDB
 
Managing Social Content with MongoDB
Managing Social Content with MongoDBManaging Social Content with MongoDB
Managing Social Content with MongoDBMongoDB
 
Use Your MySQL Knowledge to Become a MongoDB Guru
Use Your MySQL Knowledge to Become a MongoDB GuruUse Your MySQL Knowledge to Become a MongoDB Guru
Use Your MySQL Knowledge to Become a MongoDB GuruTim Callaghan
 
Webinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev TeamsWebinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev TeamsMongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBAlex Bilbie
 
MongoDB - A Document NoSQL Database
MongoDB - A Document NoSQL DatabaseMongoDB - A Document NoSQL Database
MongoDB - A Document NoSQL DatabaseRuben Inoto Soto
 
10gen Presents Schema Design and Data Modeling
10gen Presents Schema Design and Data Modeling10gen Presents Schema Design and Data Modeling
10gen Presents Schema Design and Data ModelingDATAVERSITY
 
Webscale PostgreSQL - JSONB and Horizontal Scaling Strategies
Webscale PostgreSQL - JSONB and Horizontal Scaling StrategiesWebscale PostgreSQL - JSONB and Horizontal Scaling Strategies
Webscale PostgreSQL - JSONB and Horizontal Scaling StrategiesJonathan Katz
 
Getting Started with MongoDB (TCF ITPC 2014)
Getting Started with MongoDB (TCF ITPC 2014)Getting Started with MongoDB (TCF ITPC 2014)
Getting Started with MongoDB (TCF ITPC 2014)Michael Redlich
 

Semelhante a MongoDB @ Frankfurt NoSql User Group (20)

Mongodb intro
Mongodb introMongodb intro
Mongodb intro
 
2012 mongo db_bangalore_roadmap_new
2012 mongo db_bangalore_roadmap_new2012 mongo db_bangalore_roadmap_new
2012 mongo db_bangalore_roadmap_new
 
Starting with MongoDB
Starting with MongoDBStarting with MongoDB
Starting with MongoDB
 
De normalised london aggregation framework overview
De normalised london  aggregation framework overview De normalised london  aggregation framework overview
De normalised london aggregation framework overview
 
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)
 
MongoSV Schema Workshop
MongoSV Schema WorkshopMongoSV Schema Workshop
MongoSV Schema Workshop
 
Managing Social Content with MongoDB
Managing Social Content with MongoDBManaging Social Content with MongoDB
Managing Social Content with MongoDB
 
Use Your MySQL Knowledge to Become a MongoDB Guru
Use Your MySQL Knowledge to Become a MongoDB GuruUse Your MySQL Knowledge to Become a MongoDB Guru
Use Your MySQL Knowledge to Become a MongoDB Guru
 
Webinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev TeamsWebinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev Teams
 
Latinoware
LatinowareLatinoware
Latinoware
 
Grails 2.0 Update
Grails 2.0 UpdateGrails 2.0 Update
Grails 2.0 Update
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB - A Document NoSQL Database
MongoDB - A Document NoSQL DatabaseMongoDB - A Document NoSQL Database
MongoDB - A Document NoSQL Database
 
10gen Presents Schema Design and Data Modeling
10gen Presents Schema Design and Data Modeling10gen Presents Schema Design and Data Modeling
10gen Presents Schema Design and Data Modeling
 
Webscale PostgreSQL - JSONB and Horizontal Scaling Strategies
Webscale PostgreSQL - JSONB and Horizontal Scaling StrategiesWebscale PostgreSQL - JSONB and Horizontal Scaling Strategies
Webscale PostgreSQL - JSONB and Horizontal Scaling Strategies
 
MySQL 开发
MySQL 开发MySQL 开发
MySQL 开发
 
2012 phoenix mug
2012 phoenix mug2012 phoenix mug
2012 phoenix mug
 
MongoDB at GUL
MongoDB at GULMongoDB at GUL
MongoDB at GUL
 
Getting Started with MongoDB (TCF ITPC 2014)
Getting Started with MongoDB (TCF ITPC 2014)Getting Started with MongoDB (TCF ITPC 2014)
Getting Started with MongoDB (TCF ITPC 2014)
 
Indexing In MongoDB
Indexing In MongoDBIndexing In MongoDB
Indexing In MongoDB
 

Último

COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 

Último (20)

COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 

MongoDB @ Frankfurt NoSql User Group

  • 1. Frankfurt NoSQL User Group Chris Harris Email : charris@10gen.com Twitter : cj_harris5 Wednesday, 22 February 12
  • 2. As simple as possible, but no simpler Memcached Key / Value Scalability & Performance RDBMS Depth of functionality Wednesday, 22 February 12
  • 3. Key/Value Store MongoDB Relational Database Wednesday, 22 February 12
  • 4. Terminology RDBMS MongoDB Table Collection Row(s) JSON Document Index Index Join Embedding & Linking Partition Shard Partition Key Shard Key Wednesday, 22 February 12
  • 5. Here is a “simple” SQL Model mysql> select * from book; +----+----------------------------------------------------------+ | id | title | +----+----------------------------------------------------------+ | 1 | The Demon-Haunted World: Science as a Candle in the Dark | | 2 | Cosmos | | 3 | Programming in Scala | +----+----------------------------------------------------------+ 3 rows in set (0.00 sec) mysql> select * from bookauthor; +---------+-----------+ | book_id | author_id | +---------+-----------+ | 1| 1| | 2| 1| | 3| 2| | 3| 3| | 3| 4| +---------+-----------+ 5 rows in set (0.00 sec) mysql> select * from author; +----+-----------+------------+-------------+-------------+---------------+ | id | last_name | first_name | middle_name | nationality | year_of_birth | +----+-----------+------------+-------------+-------------+---------------+ | 1 | Sagan | Carl | Edward | NULL | 1934 | | 2 | Odersky | Martin | NULL | DE | 1958 | | 3 | Spoon | Lex | NULL | NULL | NULL | | 4 | Venners | Bill | NULL | NULL | NULL | +----+-----------+------------+-------------+-------------+---------------+ 4 rows in set (0.00 sec) Wednesday, 22 February 12
  • 6. Flexible “Schemas” { “author”: “brendan”, “text”: “...” } { “author”: “brendan”, “text”: “...”, “tags”: [“mongodb”, “nosql”] } Wednesday, 22 February 12
  • 7. The Same Data in MongoDB { "_id" : ObjectId("4dfa6baa9c65dae09a4bbda5"), "title" : "Programming in Scala", "author" : [ { "first_name" : "Martin", "last_name" : "Odersky", "nationality" : "DE", "year_of_birth" : 1958 }, { "first_name" : "Lex", "last_name" : "Spoon" }, { "first_name" : "Bill", "last_name" : "Venners" } ] } Wednesday, 22 February 12
  • 9. db.test.insert({fn: “Chris”, ln: “Harris”}) Wednesday, 22 February 12
  • 11. Cursors $gt, $lt, $gte, $lte, $ne, $all, $in, $nin, $or, $not, $mod, $size, $exists, $type, $elemMatch > var c = db.test.find({x: 20}).skip(20).limit(10)> c.next() > c.next() ... query first N results + cursor id getMore w/ cursor id next N results + cursor id or 0 ... Wednesday, 22 February 12
  • 12. Creating Indexes An index on _id is automatic. For more use ensureIndex: db.blogs.ensureIndex({author: 1}) 1 = ascending -1 = descending Wednesday, 22 February 12
  • 13. Compound Indexes db.blogs.save({ author: "James", ts: new Date() ... }); db.blogs.ensureIndex({author: 1, ts: -1}) Wednesday, 22 February 12
  • 14. Unique Indexes db.blogs.save({ author: "James", title: "My first blog" ... }); db.blogs.ensureIndex({title: 1}, {unique: true}) Wednesday, 22 February 12
  • 15. Indexing Embedded Documents db.blogs.save({ title: "My First blog", stats : { views: 0, followers: 0 } }); db.blogs.ensureIndex({"stats.followers": -1}) db.blogs.find({"stats.followers": {$gt: 500}}) Wednesday, 22 February 12
  • 16. Indexing Embedded Arrays db.blogs.save({ title: "My First blog", comments: [ {author: "James", ts : new Date()} ] }); db.blogs.ensureIndex({"comments.author": 1}) db.blogs.find({"comments.author": "James"}) Wednesday, 22 February 12
  • 17. Multikeys db.blogs.save({ title: "My Second blog", tags: ["mongodb", "NoSQL"] }); db.blogs.ensureIndex({tags: 1}) db.blogs.find({tags: "NoSQL"}) Wednesday, 22 February 12
  • 18. Covered Indexes • From 1.8.0 • Query resolved in index only • Need to exclude _id from items projected db.blogs.save({ author: "James", title: "My first blog" }); db.blogs.ensureIndex({author: 1}) db.blogs.find({author: "James"}, {author: 1, _id:0})) Wednesday, 22 February 12
  • 19. Sparse Indexes • From 1.8.0 • Key value included if and only if the value is present • Reduces size of index • Limited to a single field db.blogs.ensureIndex({loc: 1}, {sparse: true}) // loc key stored for Ben & Sarah only db.blogs.save({author: "Jim"}) db.blogs.save({author: "Ben", loc: null}) db.blogs.save({author: "Sarah", loc: "CA"}) Wednesday, 22 February 12
  • 20. Geospatial • Geo hash stored in B-Tree • First two values indexed db.blogs.save({ loc: { long: 40.739037, lat: 40.739037 } }); db.blogs.save({ loc: [40.739037, 40.739037] }); db.blogs.ensureIndex({"loc": "2d"}) Wednesday, 22 February 12
  • 22. Types of outage • Planned • Hardware upgrade • O/S or file-system tuning • Relocation of data to new file-system / storage • Software upgrade • Unplanned • Hardware failure • Data center failure • Region outage • Human error • Application corruption Wednesday, 22 February 12
  • 23. Replica Set features • A cluster of N servers • Any (one) node can be primary • Consensus election of primary • Automatic failover • Automatic recovery • All writes to primary • Reads can be to primary (default) or a secondary Wednesday, 22 February 12
  • 24. How MongoDB Replication works Member 1 Member 3 Member 2 •Set is made up of 2 or more nodes Wednesday, 22 February 12
  • 25. How MongoDB Replication works Member 1 Member 3 Member 2 PRIMARY •Election establishes the PRIMARY •Data replication from PRIMARY to SECONDARY Wednesday, 22 February 12
  • 26. How MongoDB Replication works negotiate new master Member 1 Member 3 Member 2 DOWN •PRIMARY may fail •Automatic election of new PRIMARY if majority exists Wednesday, 22 February 12
  • 27. How MongoDB Replication works Member 1 Member 3 PRIMARY Member 2 DOWN •New PRIMARY elected •Replication Set re-established Wednesday, 22 February 12
  • 28. How MongoDB Replication works Member 1 Member 3 PRIMARY Member 2 RECOVERING •Automatic recovery Wednesday, 22 February 12
  • 29. How MongoDB Replication works Member 1 Member 3 PRIMARY Member 2 •Replication Set re-established Wednesday, 22 February 12
  • 31. http://community.qlikview.com/cfs-filesystemfile.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ theqlikviewblog/Cutting-Grass-with-Scissors-_2D00_-2.jpg Wednesday, 22 February 12
  • 33. MongoDB Scaling - Single Node read node_a1 write Wednesday, 22 February 12
  • 34. Write scaling - add Shards read shard1 shard2 node_c1 node_c2 node_b1 node_b2 node_a1 node_a2 write Wednesday, 22 February 12
  • 35. Write scaling - add Shards read shard1 shard2 shard3 node_c1 node_c2 node_c3 node_b1 node_b2 node_b3 node_a1 node_a2 node_a3 write Wednesday, 22 February 12
  • 36. MongoDB Sharding • Automatic partitioning and management • Range based • Convert to sharded system with no downtime • Fully consistent Wednesday, 22 February 12
  • 37. How MongoDB Sharding works > db.posts.save( {age:40} ) -∞   +∞   -∞   40 41 +∞   •Data in inserted •Ranges are split into more “chunks” Wednesday, 22 February 12
  • 38. How MongoDB Sharding works > db.posts.save( {age:40} ) > db.posts.save( {age:50} ) -∞   +∞   -∞   40 41 +∞   41 50 51 +∞   •More Data in inserted •Ranges are split into more“chunks” Wednesday, 22 February 12
  • 39. How MongoDB Sharding works > db.posts.save( {age:40} ) > db.posts.save( {age:50} ) > db.posts.save( {age:60} ) -∞   +∞   -∞   40 41 +∞   41 50 51 +∞   51 60 61 +∞   Wednesday, 22 February 12
  • 40. Balancing mongos config balancer config Chunks! config 1 2 3 4 13 14 15 16 25 26 27 28 37 38 39 40 5 6 7 8 17 18 19 20 29 30 31 32 41 42 43 44 9 10 11 12 21 22 23 24 33 34 35 36 45 46 47 48 Shard 1 Shard 2 Shard 3 Shard 4 Wednesday, 22 February 12
  • 41. Balancing mongos config balancer config Imbalance Imbalance config 1 2 3 4 5 6 7 8 9 10 11 12 21 22 23 24 33 34 35 36 45 46 47 48 Shard 1 Shard 2 Shard 3 Shard 4 Wednesday, 22 February 12
  • 42. Balancing mongos config balancer config Move chunk 1 to config Shard 2 1 2 3 4 5 6 7 8 9 10 11 12 21 22 23 24 33 34 35 36 45 46 47 48 Shard 1 Shard 2 Shard 3 Shard 4 Wednesday, 22 February 12
  • 43. Balancing mongos config balancer config config 1 2 3 4 5 6 7 8 9 10 11 12 21 22 23 24 33 34 35 36 45 46 47 48 Shard 1 Shard 2 Shard 3 Shard 4 Wednesday, 22 February 12
  • 44. Balancing mongos config balancer config config 2 3 4 5 6 7 8 1 9 10 11 12 21 22 23 24 33 34 35 36 45 46 47 48 Shard 1 Shard 2 Shard 3 Shard 4 Wednesday, 22 February 12
  • 45. Balancing mongos config balancer config Chunk 1 now lives on Shard 2 config 2 3 4 5 6 7 8 1 9 10 11 12 21 22 23 24 33 34 35 36 45 46 47 48 Shard 1 Shard 2 Shard 3 Shard 4 Wednesday, 22 February 12