MongoDB The Highly Scalable, Enterprise Grade, Open Source Database
NoSQL: A New Era of Databases Big Data, Big Problem Scaling for the Demands of Modern Applications
Starting from Scratch 10gen as an open source  ‘ app engine ’  cloud platform Backend storage needs Agility Scalability Feature-richness Performance Ease of use
Agility MongoDB is document-oriented.  JSON-like objects ‘ Documents ’  are organized into  ‘ Collections ’ Schema is not enforced > a  = { name:  “ mongo ”  }; { “ name ”  :  “ mongo ” } >b = { x : 3 }; {  “ x ”  : 3  } > c = { x : 4 , j : 1 }; {  “ x ”  : 4 ,  “ j ”  : 1 } >db.things.save(a) >db.things.save(b) >db.things.save(c) >db.things.find() { "_id" : ObjectId("4c2209f9f3924d31102bd84a"), "name" : "mongo" } { "_id" : ObjectId("4c2209fef3924d31102bd84b"), "x" : 3 } { "_id" : ObjectId("4c220a42f3924d31102bd856"), "x" : 4, "j" : 1 }
Deep Data { _id : ObjectId("4c4ba5c0672c685e5e8aabf3"),  author :  ” roger", date : "Sat Jul 24 2010 19:47:11 GMT-0700 (PDT)",  text : " I love J.Biebs... ", tags : [  ” rockstar",  ” puppy-love" ], comments_count: 1,  comments : [ { author :  ” Gretchen", date : "Sat Jul 24 2010 20:51:03 GMT-0700 (PDT)", text :  ”  Biebs is Toll!!!!" } ]}
Replication Replication for high availability Replica Sets Auto-failover Primary fails, secondary elected primary Primary repaired, becomes secondary Single-write node Great for higher read volume
Replication Primary Secondary Secondary Secondary Secondary Client
Scalability MongoDB features autosharding for horizontal scalability mongod mongod mongod mongos mongod mongod mongod Config Servers Shard Shard Shard Client
Sharding with Replica Sets mongod mongos mongod mongod mongod Config Servers Shard Shard Shard mongod mongod mongod mongod mongod mongod mongod mongod Client
Performance Data Model Dynamic Deep data In-place updates Simplicity
Performance milancermak.posterous.com
Performance MongoDB test results: siege -f ./stress_urls.txt -c 300 -r 10 -d1 -i Transactions: 2994 hits Availability: 99.80 % Elapsed time: 11.95 secs Data transferred: 3.19 MB Response time: 0.26 secs Transaction rate: 250.54 trans/sec Throughput: 0.27 MB/sec Concurrency: 65.03 Successful transactions: 2994 Failed transactions: 6 Longest transaction: 1.47 Shortest transaction: 0.00 MySQL test results: siege -f ./stress_urls_mysql.txt -c 300 -r 10 -d1 -i Transactions: 2832 hits Availability: 94.40 % Elapsed time: 23.53 secs Data transferred: 2.59 MB Response time: 0.74 secs Transaction rate: 120.36 trans/sec Throughput: 0.11 MB/sec Concurrency: 89.43 Successful transactions: 2832 Failed transactions: 168 Longest transaction: 16.36 Shortest transaction: 0.00 obvioushints.blogspot.com
Performance bcbio.wordpress.com
Recent MongoDB Conferences
MongoDB Downloads
Production + Deployments
Thank you @mongodb [email_address] ; adam@10gen.com Mongo France, March 23 MongoSF, May 24 http://www.10gen.com/events http://bit.ly/mongofb  Facebook  |  Twitter  |  LinkedIn http://linkd.in/joinmongo download at  mongodb.org
(SQL vs MongoDB) SQL Statement  Mongo Query Language Statement  CREATE TABLE USERS (a Number, b Number) implicit; can be done  explicitly INSERT INTO USERS VALUES(1,1) db.users.insert({a:1,b:1}) SELECT a,b FROM users db.users.find({}, {a:1,b:1}) SELECT * FROM users db.users.find() SELECT * FROM users WHERE age=33 db.users.find({age:33}) SELECT a,b FROM users WHERE age=33 db.users.find({age:33}, {a:1,b:1}) SELECT * FROM users WHERE age=33 ORDER BY name db.users.find({age:33}).sort({name:1}) SELECT * FROM users WHERE age>33 db.users.find({'age':{$gt:33}})}) SELECT * FROM users WHERE age<33 db.users.find({'age':{$lt:33}})}) SELECT * FROM users WHERE name LIKE &quot;%Joe%&quot; db.users.find({name:/Joe/}) SELECT * FROM users WHERE name LIKE &quot;Joe%&quot; db.users.find({name:/^Joe/}) CREATE INDEX myindexname ON users(name,ts DESC) db.users.ensureIndex({name:1,ts:-1}) SELECT * FROM users WHERE a=1 and b='q' db.users.find({a:1,b:'q'}) SELECT * FROM users LIMIT 10 SKIP 20 db.users.find().limit(10).skip(20) SELECT * FROM users WHERE a=1 or b=2 db.users.find( { $or : [ { a : 1 } , { b : 2 } ] } ) SELECT * FROM users LIMIT 1 db.users.findOne() EXPLAIN SELECT * FROM users WHERE z=3 db.users.find({z:3}).explain() SELECT DISTINCT last_name FROM users db.users.distinct('last_name') SELECT COUNT(*y) FROM users db.users.count() SELECT COUNT(*y) FROM users where AGE > 30 db.users.find({age: {'$gt': 30}}).count()

A Brief MongoDB Intro

  • 1.
    MongoDB The HighlyScalable, Enterprise Grade, Open Source Database
  • 2.
    NoSQL: A NewEra of Databases Big Data, Big Problem Scaling for the Demands of Modern Applications
  • 3.
    Starting from Scratch10gen as an open source ‘ app engine ’ cloud platform Backend storage needs Agility Scalability Feature-richness Performance Ease of use
  • 4.
    Agility MongoDB isdocument-oriented. JSON-like objects ‘ Documents ’ are organized into ‘ Collections ’ Schema is not enforced > a = { name: “ mongo ” }; { “ name ” : “ mongo ” } >b = { x : 3 }; { “ x ” : 3 } > c = { x : 4 , j : 1 }; { “ x ” : 4 , “ j ” : 1 } >db.things.save(a) >db.things.save(b) >db.things.save(c) >db.things.find() { &quot;_id&quot; : ObjectId(&quot;4c2209f9f3924d31102bd84a&quot;), &quot;name&quot; : &quot;mongo&quot; } { &quot;_id&quot; : ObjectId(&quot;4c2209fef3924d31102bd84b&quot;), &quot;x&quot; : 3 } { &quot;_id&quot; : ObjectId(&quot;4c220a42f3924d31102bd856&quot;), &quot;x&quot; : 4, &quot;j&quot; : 1 }
  • 5.
    Deep Data {_id : ObjectId(&quot;4c4ba5c0672c685e5e8aabf3&quot;), author : ” roger&quot;, date : &quot;Sat Jul 24 2010 19:47:11 GMT-0700 (PDT)&quot;, text : &quot; I love J.Biebs... &quot;, tags : [ ” rockstar&quot;, ” puppy-love&quot; ], comments_count: 1, comments : [ { author : ” Gretchen&quot;, date : &quot;Sat Jul 24 2010 20:51:03 GMT-0700 (PDT)&quot;, text : ” Biebs is Toll!!!!&quot; } ]}
  • 6.
    Replication Replication forhigh availability Replica Sets Auto-failover Primary fails, secondary elected primary Primary repaired, becomes secondary Single-write node Great for higher read volume
  • 7.
    Replication Primary SecondarySecondary Secondary Secondary Client
  • 8.
    Scalability MongoDB featuresautosharding for horizontal scalability mongod mongod mongod mongos mongod mongod mongod Config Servers Shard Shard Shard Client
  • 9.
    Sharding with ReplicaSets mongod mongos mongod mongod mongod Config Servers Shard Shard Shard mongod mongod mongod mongod mongod mongod mongod mongod Client
  • 10.
    Performance Data ModelDynamic Deep data In-place updates Simplicity
  • 11.
  • 12.
    Performance MongoDB testresults: siege -f ./stress_urls.txt -c 300 -r 10 -d1 -i Transactions: 2994 hits Availability: 99.80 % Elapsed time: 11.95 secs Data transferred: 3.19 MB Response time: 0.26 secs Transaction rate: 250.54 trans/sec Throughput: 0.27 MB/sec Concurrency: 65.03 Successful transactions: 2994 Failed transactions: 6 Longest transaction: 1.47 Shortest transaction: 0.00 MySQL test results: siege -f ./stress_urls_mysql.txt -c 300 -r 10 -d1 -i Transactions: 2832 hits Availability: 94.40 % Elapsed time: 23.53 secs Data transferred: 2.59 MB Response time: 0.74 secs Transaction rate: 120.36 trans/sec Throughput: 0.11 MB/sec Concurrency: 89.43 Successful transactions: 2832 Failed transactions: 168 Longest transaction: 16.36 Shortest transaction: 0.00 obvioushints.blogspot.com
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
    Thank you @mongodb[email_address] ; adam@10gen.com Mongo France, March 23 MongoSF, May 24 http://www.10gen.com/events http://bit.ly/mongofb Facebook | Twitter | LinkedIn http://linkd.in/joinmongo download at mongodb.org
  • 18.
    (SQL vs MongoDB)SQL Statement Mongo Query Language Statement CREATE TABLE USERS (a Number, b Number) implicit; can be done explicitly INSERT INTO USERS VALUES(1,1) db.users.insert({a:1,b:1}) SELECT a,b FROM users db.users.find({}, {a:1,b:1}) SELECT * FROM users db.users.find() SELECT * FROM users WHERE age=33 db.users.find({age:33}) SELECT a,b FROM users WHERE age=33 db.users.find({age:33}, {a:1,b:1}) SELECT * FROM users WHERE age=33 ORDER BY name db.users.find({age:33}).sort({name:1}) SELECT * FROM users WHERE age>33 db.users.find({'age':{$gt:33}})}) SELECT * FROM users WHERE age<33 db.users.find({'age':{$lt:33}})}) SELECT * FROM users WHERE name LIKE &quot;%Joe%&quot; db.users.find({name:/Joe/}) SELECT * FROM users WHERE name LIKE &quot;Joe%&quot; db.users.find({name:/^Joe/}) CREATE INDEX myindexname ON users(name,ts DESC) db.users.ensureIndex({name:1,ts:-1}) SELECT * FROM users WHERE a=1 and b='q' db.users.find({a:1,b:'q'}) SELECT * FROM users LIMIT 10 SKIP 20 db.users.find().limit(10).skip(20) SELECT * FROM users WHERE a=1 or b=2 db.users.find( { $or : [ { a : 1 } , { b : 2 } ] } ) SELECT * FROM users LIMIT 1 db.users.findOne() EXPLAIN SELECT * FROM users WHERE z=3 db.users.find({z:3}).explain() SELECT DISTINCT last_name FROM users db.users.distinct('last_name') SELECT COUNT(*y) FROM users db.users.count() SELECT COUNT(*y) FROM users where AGE > 30 db.users.find({age: {'$gt': 30}}).count()