MongoDB at the Silicon Valley iPhone and iPad Developers' Meetup
 

MongoDB at the Silicon Valley iPhone and iPad Developers' Meetup

on

  • 9,471 views

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/

Statistics

Views

Total Views
9,471
Views on SlideShare
5,128
Embed Views
4,343

Actions

Likes
5
Downloads
104
Comments
0

11 Embeds 4,343

http://www.mongodb.org 4274
http://ru.wiki.mongodb.org 20
http://pt.wiki.mongodb.org 16
http://es.wiki.mongodb.org 11
http://wiki.mongodb.org 10
http://htmledit.squarefree.com 4
http://mongodb.onconfluence.com 3
http://api.mongodb.org 2
http://10gen.com 1
http://translate.googleusercontent.com 1
https://wiki.10gen.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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 MongoDB at the Silicon Valley iPhone and iPad Developers' Meetup Presentation Transcript

  • 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”)
    • non-relational, next-generation operational datastores and databases
    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 represented as BSON
  • Flexible “Schemas” {“author”: “mike”, “ links”: 3 , “ date”: "Sun Jul 18 2010 14:40:20 GMT-0700 (PDT)" “ text”: “...”}
  • Flexible “Schemas”
    • {“author”: “eliot”,
    • “ date”: "Sun Jul 18 2010 14:40:22 GMT-0700 (PDT)"
    • “ text”: “...”,
      • “ tags”: [“mongodb”] }
  • 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”: "Sun Jul 18 2010 14:40:20 GMT-0700 (PDT)" “ text”: “...”} db.posts.ensureIndex({links: 1})
  • Indexes {author: “mike”, … , comments: [ {author: “eliot”, date: new Date(), text: “great post!”} }, … ] } db.posts.ensureIndex({‘comments.author’: 1, ‘ comments.date’: -1 })
  • Advanced Queries and Map/Reduce Support
  • Posts Ending With ‘Tech’ db.posts.find({text: /Tech$/})
  • Posts With a Tag
    • (multi-key indexes)
    db.posts.find({tags: “mongodb”}) ...and Fast db.posts.ensureIndex({tags: 1})
  • 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, r, { query : {type:'sale'} }); > db[res.result].find().limit(2) { "_id" : 8321073716060 , "value" : 1 } { "_id" : 7921232311289 , "value" : 1 }
  • Atomic Updates, Unique Key Constraints
  • Embedding a Comment c = {author: “eliot”, date: new Date(), text: “great post!”} db.posts.update({_id: post._id}, {$push: {comments: c}})
  • Many Supported Platforms / Languages with Native Drivers
  • Focus on Performance
  • Focus on performance depth of functionality scalability & performance
    • memcached
    • key/value
    • RDBMS
  • 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 mongod mongod mongod mongod ...
  • 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
  •  
  • Features you guys care about
  • Geospatial Indexing db.places.ensureIndex( { loc : "2d" } ) db.places.find( { loc : { $near :[50,50] } } ).limit(20)
  • Geospatial Indexing db.places.ensureIndex( { location : "2d" , category : 1 } ); db.places.find( { location : { $near : [50,50] }, category : 'coffee' } );
  • Geospatial Indexing
    • Also support matching within a spatial box
    • And within a a circle
  • Geospatial Indexing at Foursquare
    • ~1.3M registered users. ~615k checkins/day. Nearly 50M checkins total (as of late May). Very rapid growth.
  • 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
  • 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
  • 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
  • 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
  • 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
    • Commercial support
      • Production support, 24x7
    • Consulting
      • Supercharge your app development
    • Training
      • Learn from the experts
    • 10gen.com
  • 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