• Like

MongoDB at the Silicon Valley iPhone and iPad Developers' Meetup

  • 9,178 views
Uploaded on

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

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

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
9,178
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
105
Comments
0
Likes
5

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • 4 quad core cpus 72 gigs of ram 1.6 TB of RAID10 data storage

Transcript

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