Slide 1

Slide 1 text

Ross Lawley - [email protected] twitter: @RossC0 Born in the cloud

Slide 2

Slide 2 text

origins of The mongoDB

Slide 3

Slide 3 text

10gen Dwight Merriman and Eliot Horowitz Double Click & Shopwiki -30 billion ads a day -Built multiple database caching layers

Slide 4

Slide 4 text

Scaling RDMS kills productivity Project start Denormalize Stop using joins Custom caching layer Custom sharding

Slide 5

Slide 5 text

2007 10gen formed Originally to create a PAAS service Open sourced MongoDB in 2009 0.8 February 2009 First standalone release 1.0 August 2009 Simple, but used in production 1.2 December 2009 map/reduce, external sort index building 1.4 March 2010 Background indexing, geo 1.6 August 2010 Sharding, replica sets 1.8 March 2011 Journalling, sparse/covered indexes 2.0 September 2012 Compact, concurrency 2.2 July 2012 Concurrency, aggregation framework

Slide 6

Slide 6 text

Design goals of The mongoDB

Slide 7

Slide 7 text

JSON Documents Rich data models Seamlessly map to native programming language Flexible for dynamic data Better data locality

Slide 8

Slide 8 text

Json document { _id : ObjectId("4c4ba5c0672c685e5e8aabf3"), author : "Ross", title : "mongoDB Born in the cloud", body : "All about mongoDB...", date : ISODate("2012-06-28T11:30:27.442Z"), tags : [ "tech", "databases" ], comments : [{ author : "Fred", date : ISODate("2012-06-28T11:40:27.442Z"), body : "mongoDB looks great" }] }

Slide 9

Slide 9 text

Scaling Scale linearly Increase capacity with no downtime Transparent to the application

Slide 10

Slide 10 text

General Purpose DBMS Dynamic queries Rich updates, upserts Sophisticated secondary indexes Sorting Easy aggregation

Slide 11

Slide 11 text

Examples // find posts matching a regular expression > db.posts.find({author: /^ro*/i }) // find inside sub documents > db.posts.find({comments.author: "Ross" }}) // Add a comment to the post > db.posts.update({ _id: "..." }, {"$push": {comments: new_comment}, "$inc": {comments_count: 1}});

Slide 12

Slide 12 text

features for the mongoDB Cloud

Slide 13

Slide 13 text

High availability Single master system - Primary always consistent Automatic failover if a Primary fails Automatic recovery when a node joins the set Full control over writes using write concerns Easy to administer and manage

Slide 14

Slide 14 text

Replica set is made up of 2 or more nodes A B C

Slide 15

Slide 15 text

Election establishes the PRIMARY Data replication from PRIMARY to SECONDARY S P S

Slide 16

Slide 16 text

S S negotiate new master DOWN PRIMARY may fail Automatic election of new PRIMARY if majority exists

Slide 17

Slide 17 text

S P DOWN New PRIMARY elected Replica set re-established

Slide 18

Slide 18 text

S P RECOVERING Automatic recovery

Slide 19

Slide 19 text

S P S Replica set re-established

Slide 20

Slide 20 text

Advanced features Durability via write concerns - On a connection, database, collection and query level - Tag nodes and direct writes to specific nodes / data centres Prioritisation - Prefer specific nodes to be primary - Ensure certain nodes are never primary Scaling reads - Not applicable for all applications - Secondaries can be used for backups, analytics, data processing

Slide 21

Slide 21 text

EU LOCAL p:10 p:10 Backups / Analytics Server Primary Data Centre Example Cloud Setup USA p:5 p:0 p:1

Slide 22

Slide 22 text

BIG with Growing mongoDB

Slide 23

Slide 23 text

Primary shard1 Horizontal scale out write read MongoD shard2 MongoD MongoD MongoD shard3 MongoD MongoD MongoD Secondary Secondary

Slide 24

Slide 24 text

Sharding features Range based Automatic partitioning and management Fully consistent Easy to setup and manage

Slide 25

Slide 25 text

Sharding in the cloud priority: 10 priority: 5 priority: 5 AZ-1 config server priority: 5 priority: 10 priority: 5 AZ-2 config server priority: 5 priority: 5 priority: 10 AZ-3 config server

Slide 26

Slide 26 text

cloud mongoDB in the Using

Slide 27

Slide 27 text

Infrastructure as a service Platform as a service Database as a service

Slide 28

Slide 28 text

@mongodb conferences, appearances, and meetups http://www.10gen.com/events http://bit.ly/mongofb Facebook | Twitter | LinkedIn http://linkd.in/joinmongo download at mongodb.org support, training, and this talk brought to you by

Slide 29

Slide 29 text

No content