open-source, high-performance, document-oriented database Aaron Staple [email_address]
Version 1.6 comes out in 2 weeks
Production Examples
RDBMS (Oracle, MySQL) New Gen. OLAP (vertica, aster, greenplum) Non-relational Operational Stores (“NoSQL”)
<ul><li>non-relational, next-generation operational datastores and databases </li></ul>NoSQL Really Means:
Horizontally Scalable Architectures no joins no complex transactions +
New Data Models no joins no complex transactions +
New Data Models more natural ways to develop applications?
JSON-style Documents { “hello” :   “world” } x16x00x00x00 x02 hellox00 x06x00x00x00worldx00 x00 http://bsonspec.org repres...
Flexible “Schemas” {“author”: “mike”, “ links”: 3 , “ date”: &quot;Sun Jul 18 2010 14:40:20 GMT-0700 (PDT)&quot; “ text”: ...
Flexible “Schemas” <ul><li>{“author”: “eliot”, </li></ul><ul><li>“ date”: &quot;Sun Jul 18 2010 14:40:22 GMT-0700 (PDT)&qu...
Dynamic Queries
Posts by Author db.posts.find({author: “mike”})
Last 10 Posts db.posts.find() .sort({date: -1}) .limit(10)
Posts Since April 1 april_1 = new Date(2010, 3, 1) db.posts.find({date: {$gt: april_1}})
Index any combination of fields, including embedded fields
Indexes {“author”: “mike”, “ links”: 3 , “ date”: &quot;Sun Jul 18 2010 14:40:20 GMT-0700 (PDT)&quot; “ text”: “...”} db.p...
Indexes {author: “mike”, … , comments: [ {author: “eliot”, date: new Date(), text: “great post!”} }, … ] } db.posts.ensure...
Advanced Queries and Map/Reduce Support
Posts Ending With ‘Tech’ db.posts.find({text: /Tech$/})
Posts With a Tag <ul><li>(multi-key indexes) </li></ul>db.posts.find({tags: “mongodb”}) ...and Fast db.posts.ensureIndex({...
Variety of Operators db.posts.find( {$or: [{a:1}, {b:{$mod:[5,2]}} ]})
Map/Reduce > m = function() { emit(this.user_id, 1); } > r = function(k,vals) { return 1; } > res = db.events.mapReduce(m,...
Atomic Updates, Unique Key Constraints
Embedding a Comment c =  {author: “eliot”, date: new Date(), text: “great post!”} db.posts.update({_id: post._id},  {$push...
Many Supported Platforms / Languages with Native Drivers
Focus on Performance
Focus on performance depth of functionality scalability & performance <ul><li>memcached </li></ul><ul><li>key/value </li><...
Replication and Replica Sets I II III master slave slave master slave master slave master slave
Auto Sharding client mongos ... mongos mongod ... Shards mongod mongod mongod Config Servers mongod mongod mongod mongod m...
Auto Sharding at bit.ly <ul><li>Sharding used for bit.ly user history </li></ul><ul><ul><li>~50M users (as of late May) </...
 
Features you guys care about
Geospatial Indexing db.places.ensureIndex( { loc : &quot;2d&quot; } ) db.places.find(  { loc : { $near :[50,50] } } ).limi...
Geospatial Indexing db.places.ensureIndex(  { location : &quot;2d&quot; , category : 1 } ); db.places.find(  { location : ...
Geospatial Indexing <ul><li>Also support matching within a spatial box </li></ul><ul><li>And within a a circle </li></ul>
Geospatial Indexing at Foursquare <ul><li>~1.3M registered users.  ~615k checkins/day. Nearly 50M checkins total (as of la...
Geospatial Indexing at Foursquare <ul><li>“ Who’s here” service – tracks last 3 hours for every user – uses mongo exclusiv...
GridFS <ul><li>Store large files by splitting them into smaller documents  </li></ul><ul><li>Leverages existing sharding a...
A Note on Security <ul><li>Mongo supports basic per database authentication </li></ul><ul><li>No encryption </li></ul><ul>...
Wordnik Configuration <ul><li>1000 requests of various types / second </li></ul><ul><li>5 billion documents (1.2TB) </li><...
Best Use Cases The (Mobile) Web <ul><li>High Volume </li></ul><ul><li>User comments, voting </li></ul><ul><li>Real time an...
<ul><li>Commercial support </li></ul><ul><ul><li>Production support, 24x7 </li></ul></ul><ul><li>Consulting </li></ul><ul>...
let us know what you think @mongodb get free support groups.google.com/group/mongodb-user request features jira.mongodb.or...
Upcoming SlideShare
Loading in...5
×

MongoDB at the Silicon Valley iPhone and iPad Developers' Meetup

11,134

Published on

Aaron Staple's presentation at the Silicon Valley iPhone and iPad Developers' Meetup on July 19: http://www.meetup.com/sviphone/calendar/13248809/

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

No Downloads
Views
Total Views
11,134
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
106
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide
  • 4 quad core cpus 72 gigs of ram 1.6 TB of RAID10 data storage
  • MongoDB at the Silicon Valley iPhone and iPad Developers' Meetup

    1. 1. open-source, high-performance, document-oriented database Aaron Staple [email_address]
    2. 2. Version 1.6 comes out in 2 weeks
    3. 3. Production Examples
    4. 4. RDBMS (Oracle, MySQL) New Gen. OLAP (vertica, aster, greenplum) Non-relational Operational Stores (“NoSQL”)
    5. 5. <ul><li>non-relational, next-generation operational datastores and databases </li></ul>NoSQL Really Means:
    6. 6. Horizontally Scalable Architectures no joins no complex transactions +
    7. 7. New Data Models no joins no complex transactions +
    8. 8. New Data Models more natural ways to develop applications?
    9. 9. JSON-style Documents { “hello” : “world” } x16x00x00x00 x02 hellox00 x06x00x00x00worldx00 x00 http://bsonspec.org represented as BSON
    10. 10. Flexible “Schemas” {“author”: “mike”, “ links”: 3 , “ date”: &quot;Sun Jul 18 2010 14:40:20 GMT-0700 (PDT)&quot; “ text”: “...”}
    11. 11. Flexible “Schemas” <ul><li>{“author”: “eliot”, </li></ul><ul><li>“ date”: &quot;Sun Jul 18 2010 14:40:22 GMT-0700 (PDT)&quot; </li></ul><ul><li>“ text”: “...”, </li></ul><ul><ul><li>“ tags”: [“mongodb”] } </li></ul></ul>
    12. 12. Dynamic Queries
    13. 13. Posts by Author db.posts.find({author: “mike”})
    14. 14. Last 10 Posts db.posts.find() .sort({date: -1}) .limit(10)
    15. 15. Posts Since April 1 april_1 = new Date(2010, 3, 1) db.posts.find({date: {$gt: april_1}})
    16. 16. Index any combination of fields, including embedded fields
    17. 17. Indexes {“author”: “mike”, “ links”: 3 , “ date”: &quot;Sun Jul 18 2010 14:40:20 GMT-0700 (PDT)&quot; “ text”: “...”} db.posts.ensureIndex({links: 1})
    18. 18. Indexes {author: “mike”, … , comments: [ {author: “eliot”, date: new Date(), text: “great post!”} }, … ] } db.posts.ensureIndex({‘comments.author’: 1, ‘ comments.date’: -1 })
    19. 19. Advanced Queries and Map/Reduce Support
    20. 20. Posts Ending With ‘Tech’ db.posts.find({text: /Tech$/})
    21. 21. Posts With a Tag <ul><li>(multi-key indexes) </li></ul>db.posts.find({tags: “mongodb”}) ...and Fast db.posts.ensureIndex({tags: 1})
    22. 22. Variety of Operators db.posts.find( {$or: [{a:1}, {b:{$mod:[5,2]}} ]})
    23. 23. Map/Reduce > m = function() { emit(this.user_id, 1); } > r = function(k,vals) { return 1; } > res = db.events.mapReduce(m, r, { query : {type:'sale'} }); > db[res.result].find().limit(2) { &quot;_id&quot; : 8321073716060 , &quot;value&quot; : 1 } { &quot;_id&quot; : 7921232311289 , &quot;value&quot; : 1 }
    24. 24. Atomic Updates, Unique Key Constraints
    25. 25. Embedding a Comment c = {author: “eliot”, date: new Date(), text: “great post!”} db.posts.update({_id: post._id}, {$push: {comments: c}})
    26. 26. Many Supported Platforms / Languages with Native Drivers
    27. 27. Focus on Performance
    28. 28. Focus on performance depth of functionality scalability & performance <ul><li>memcached </li></ul><ul><li>key/value </li></ul><ul><li>RDBMS </li></ul>
    29. 29. Replication and Replica Sets I II III master slave slave master slave master slave master slave
    30. 30. Auto Sharding client mongos ... mongos mongod ... Shards mongod mongod mongod Config Servers mongod mongod mongod mongod mongod mongod mongod mongod ...
    31. 31. Auto Sharding at bit.ly <ul><li>Sharding used for bit.ly user history </li></ul><ul><ul><li>~50M users (as of late May) </li></ul></ul><ul><li>Shard on user id </li></ul><ul><li>Three secondary indexes </li></ul>
    32. 33. Features you guys care about
    33. 34. Geospatial Indexing db.places.ensureIndex( { loc : &quot;2d&quot; } ) db.places.find( { loc : { $near :[50,50] } } ).limit(20)
    34. 35. Geospatial Indexing db.places.ensureIndex( { location : &quot;2d&quot; , category : 1 } ); db.places.find( { location : { $near : [50,50] }, category : 'coffee' } );
    35. 36. Geospatial Indexing <ul><li>Also support matching within a spatial box </li></ul><ul><li>And within a a circle </li></ul>
    36. 37. Geospatial Indexing at Foursquare <ul><li>~1.3M registered users. ~615k checkins/day. Nearly 50M checkins total (as of late May). Very rapid growth. </li></ul>
    37. 38. Geospatial Indexing at Foursquare <ul><li>“ Who’s here” service – tracks last 3 hours for every user – uses mongo exclusively </li></ul><ul><li>All checkins, tips, venues written to mongo , reads a mix of mongo / legacy postgres (as of late May) </li></ul><ul><ul><li>Migrating geo related reads to mongo first </li></ul></ul>
    38. 39. GridFS <ul><li>Store large files by splitting them into smaller documents </li></ul><ul><li>Leverages existing sharding and replication configuration </li></ul><ul><li>Store metadata along with files </li></ul><ul><li>Works well behind a cdn </li></ul>
    39. 40. A Note on Security <ul><li>Mongo supports basic per database authentication </li></ul><ul><li>No encryption </li></ul><ul><li>Not security hardened (designed to work in a safe environment behind a firewall) </li></ul><ul><ul><li>Consider ssh tunnel from app server </li></ul></ul>
    40. 41. Wordnik Configuration <ul><li>1000 requests of various types / second </li></ul><ul><li>5 billion documents (1.2TB) </li></ul><ul><li>Single 2x4 core server 32gb ram, FC SAN non virtualized </li></ul><ul><li>NOTE: Virtualized storage tends to perform poorly, for example if you are on EC2 you should run several EBS volumes striped </li></ul>
    41. 42. Best Use Cases The (Mobile) Web <ul><li>High Volume </li></ul><ul><li>User comments, voting </li></ul><ul><li>Real time analytics </li></ul><ul><li>Scaling Out </li></ul><ul><li>User profile, session data </li></ul><ul><li>Content management </li></ul><ul><li>Caching </li></ul><ul><li>Fast, in-memory caching tier </li></ul><ul><li>Simplify Development </li></ul><ul><li>No ORM or fixed schema </li></ul><ul><li>Easy to install and maintain </li></ul>
    42. 43. <ul><li>Commercial support </li></ul><ul><ul><li>Production support, 24x7 </li></ul></ul><ul><li>Consulting </li></ul><ul><ul><li>Supercharge your app development </li></ul></ul><ul><li>Training </li></ul><ul><ul><li>Learn from the experts </li></ul></ul><ul><li>10gen.com </li></ul>
    43. 44. let us know what you think @mongodb get free support groups.google.com/group/mongodb-user request features jira.mongodb.org (grab some friends and manipulate our voting system  ) Download MongoDB mongodb.org
    1. Gostou de algum slide específico?

      Recortar slides é uma maneira fácil de colecionar informações para acessar mais tarde.

    ×