mongoDB It’s not just about big data 08.09.2011
what is mongoDB?
<ul><li>“ Scalable, open-source, high-performance, document-oriented database ”  -  10gen </li></ul>
Storage model <ul><li>relational </li></ul><ul><ul><li>database </li></ul></ul><ul><ul><li>table </li></ul></ul><ul><ul><l...
{   _id: 1234,   author: { name:  “Bob Davis”, email :  [email_address]  },   post: “In these troubled times I like to …“,...
{   _id: 1234,   author: { name:  “Bob Davis”, email :  [email_address]  },   post: “In these troubled times I like to …“,...
dynamic queries db.posts.find({ author.name:  “mike” }) db.posts.find({ rating: { $gt: 2 }}) db.posts.find({ tags:  “Softw...
query language <ul><li>Predicates </li></ul><ul><ul><li><, <=, >, >= </li></ul></ul><ul><ul><li>$all </li></ul></ul><ul><u...
indexes db.posts.ensureIndex({ author.name : 1 } db.posts.find({ author.name:  “mike” })
geospatial indexing and queries <ul><li>db.places.ensureIndex( { loc:  “2d” } ) </li></ul><ul><li>db.places.find({ loc: { ...
atomic updates Comment c = {author:  “will@objectlabs.com”,    date: new Date(),    text: “great post!”}  db.posts.update(...
atomic updates <ul><li>operators </li></ul><ul><ul><li>$set </li></ul></ul><ul><ul><li>$unset </li></ul></ul><ul><ul><li>$...
aggregation and map/reduce
Native drivers in almost every language <ul><li>Java </li></ul><ul><li>Javascript </li></ul><ul><li>Python </li></ul><ul><...
Built for scalability reliability from the ground up
High performance, fault tolerant clusters made easy <ul><li>Replica sets </li></ul><ul><li>Auto-sharding </li></ul>
But, mongoDB is not just about big data
Blog Post
<ul><li>&quot;Object-Relational mapping is the Vietnam of our industry”  -  Ted Neward </li></ul>
{   _id: 1234,   author: { name:  “Bob Davis”, email :  [email_address]  },   post: “In these troubled times I like to …“,...
mongoDB is a great general purpose database
Good uses for MongoDB <ul><li>accounts / user profiles </li></ul><ul><li>form data </li></ul><ul><li>CMS </li></ul><ul><li...
Q&A
More info <ul><li>MongoDB / 10Gen </li></ul><ul><ul><li>http://mongodb.org </li></ul></ul><ul><ul><li>http://10gen.com </l...
Upcoming SlideShare
Loading in …5
×

MongoDB, it's not just about big data

4,413 views
4,266 views

Published on

This is a presentation I gave at a NoSQL meetup in San Francisco on 08.09.11.

Published in: Technology
0 Comments
8 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,413
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
73
Comments
0
Likes
8
Embeds 0
No embeds

No notes for slide
  • Market Product Business Model Team [Plan]
  • nosql started bc bd but also revisit ds
  • MongoDB, it's not just about big data

    1. 1. mongoDB It’s not just about big data 08.09.2011
    2. 2. what is mongoDB?
    3. 3. <ul><li>“ Scalable, open-source, high-performance, document-oriented database ” - 10gen </li></ul>
    4. 4. Storage model <ul><li>relational </li></ul><ul><ul><li>database </li></ul></ul><ul><ul><li>table </li></ul></ul><ul><ul><li>row </li></ul></ul><ul><li>mongoDB </li></ul><ul><ul><li>database </li></ul></ul><ul><ul><li>collection </li></ul></ul><ul><ul><li>document / object </li></ul></ul>
    5. 5. { _id: 1234, author: { name: “Bob Davis”, email : [email_address] }, post: “In these troubled times I like to …“, date: { $date: “2010-07-12 13:23UTC” }, location: [ -121.2322, 42.1223222 ], rating: 2.2, comments: [ { user: “jgs32@hotmail.com”, upVotes: 22, downVotes: 14, text: “Great point! I agree” }, { user: “holly.davidson@gmail.com”, upVotes: 421, downVotes: 22, text: “You are a moron” } ] } Documents (a.k.a. Objects)
    6. 6. { _id: 1234, author: { name: “Bob Davis”, email : [email_address] }, post: “In these troubled times I like to …“, date: { $date: “2010-07-12 13:23UTC” }, location: [ -121.2322, 42.1223222 ], rating: 2.2, comments: [ { user: “jgs32@hotmail.com”, upVotes: 22, downVotes: 14, text: “Great point! I agree” }, { user: “holly.davidson@gmail.com”, upVotes: 421, downVotes: 22, text: “You are a moron” } ], tags: [ “Politics”, “Virginia” ] } Flexible “Schemas”
    7. 7. dynamic queries db.posts.find({ author.name: “mike” }) db.posts.find({ rating: { $gt: 2 }}) db.posts.find({ tags: “Software” }) db.posts.find().sort({date: -1}).limit(10)
    8. 8. query language <ul><li>Predicates </li></ul><ul><ul><li><, <=, >, >= </li></ul></ul><ul><ul><li>$all </li></ul></ul><ul><ul><li>$exists </li></ul></ul><ul><ul><li>$ne </li></ul></ul><ul><ul><li>$in </li></ul></ul><ul><ul><li>$nin </li></ul></ul><ul><ul><li>$nor </li></ul></ul><ul><ul><li>$not </li></ul></ul><ul><ul><li>$or </li></ul></ul><ul><ul><li>$and </li></ul></ul><ul><li>regular expressions </li></ul><ul><li>$where (js exps) </li></ul><ul><li>group() </li></ul><ul><li>** no joins ** </li></ul>
    9. 9. indexes db.posts.ensureIndex({ author.name : 1 } db.posts.find({ author.name: “mike” })
    10. 10. geospatial indexing and queries <ul><li>db.places.ensureIndex( { loc: “2d” } ) </li></ul><ul><li>db.places.find({ loc: { $near : [50, 50] } }).limit(10) </li></ul><ul><li>db.places.find({loc: {$within : {$box : [[40,40],[60,60]]}}}) </li></ul><ul><li>db.places.find({loc: {$within : {$center : [[40,40],10]}}}) </li></ul>
    11. 11. atomic updates Comment c = {author: “will@objectlabs.com”, date: new Date(), text: “great post!”} db.posts.update({_id: post._id}, {$push: {comments: c}})
    12. 12. atomic updates <ul><li>operators </li></ul><ul><ul><li>$set </li></ul></ul><ul><ul><li>$unset </li></ul></ul><ul><ul><li>$inc </li></ul></ul><ul><ul><li>$push </li></ul></ul><ul><ul><li>$pushAll </li></ul></ul><ul><ul><li>$pull </li></ul></ul><ul><ul><li>$pullAll </li></ul></ul><ul><ul><li>$bit </li></ul></ul>
    13. 13. aggregation and map/reduce
    14. 14. Native drivers in almost every language <ul><li>Java </li></ul><ul><li>Javascript </li></ul><ul><li>Python </li></ul><ul><li>Ruby </li></ul><ul><li>C# </li></ul><ul><li>PHP </li></ul><ul><li>and more… </li></ul>
    15. 15. Built for scalability reliability from the ground up
    16. 16. High performance, fault tolerant clusters made easy <ul><li>Replica sets </li></ul><ul><li>Auto-sharding </li></ul>
    17. 17. But, mongoDB is not just about big data
    18. 18. Blog Post
    19. 19. <ul><li>&quot;Object-Relational mapping is the Vietnam of our industry” - Ted Neward </li></ul>
    20. 20. { _id: 1234, author: { name: “Bob Davis”, email : [email_address] }, post: “In these troubled times I like to …“, date: { $date: “2010-07-12 13:23UTC” }, location: [ -121.2322, 42.1223222 ], rating: 2.2, comments: [ { user: “jgs32@hotmail.com”, upVotes: 22, downVotes: 14, text: “Great point! I agree” }, { user: “holly.davidson@gmail.com”, upVotes: 421, downVotes: 22, text: “You are a moron” } ], tags: [ “Politics”, “Virginia” ] } … vs. this loveliness
    21. 21. mongoDB is a great general purpose database
    22. 22. Good uses for MongoDB <ul><li>accounts / user profiles </li></ul><ul><li>form data </li></ul><ul><li>CMS </li></ul><ul><li>storing geo-data </li></ul><ul><li>application configuration </li></ul><ul><li>application logging </li></ul><ul><li>… </li></ul>
    23. 23. Q&A
    24. 24. More info <ul><li>MongoDB / 10Gen </li></ul><ul><ul><li>http://mongodb.org </li></ul></ul><ul><ul><li>http://10gen.com </li></ul></ul><ul><li>MongoLab </li></ul><ul><ul><li>http://mongolab.com </li></ul></ul><ul><ul><li>[email_address] </li></ul></ul>

    ×