MongoDB SF Ruby
Upcoming SlideShare
Loading in...5
×
 

MongoDB SF Ruby

on

  • 4,779 views

MongoDB presentation for SF Ruby's June meetup. Review of non-relational databases for the first half, focus on MongoDB for the second.

MongoDB presentation for SF Ruby's June meetup. Review of non-relational databases for the first half, focus on MongoDB for the second.

Statistics

Views

Total Views
4,779
Views on SlideShare
4,756
Embed Views
23

Actions

Likes
10
Downloads
85
Comments
0

2 Embeds 23

http://www.slideshare.net 22
http://127.0.0.1 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

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

MongoDB SF Ruby MongoDB SF Ruby Presentation Transcript

  • open-source, high-performance, schema-free, document-oriented database
  • RDBMS • Great for many applications • Shortcomings • Scalability • Flexibility
  • CAP Theorem • Consistency • Availability • Tolerance to network Partitions • Pick two http://www.cs.berkeley.edu/~brewer/cs262b-2004/PODC-keynote.pdf
  • ACID vs BASE • Atomicity • Basically Available • Consistency • Soft state • Isolation • Eventually consistent • Durability
  • Schema-free • Loosening constraints - added flexibility • Dynamically typed languages • Migrations
  • BigTable • Single master node • Row / Column hybrid • Versioned
  • BigTable • Open-source clones: • HBase • Hypertable
  • Dynamo • Simple Key/Value store • No master node • Write to any (many) nodes • Read from one or more nodes (balance speed vs. consistency) • Read repair
  • Dynamo • Open-source clones • Project Voldemort • Cassandra - data model more like BigTable • Dynomite
  • memcached • Used as a caching layer • Essentially a key/value store • RAM only - fast • Does away with ACID
  • Redis • Like memcached • Different • Values can be strings, lists, sets • Non-volatile
  • Tokyo Cabinet + Tyrant • Key/value store with focus on speed • Some more advanced queries • Sorting, range or prefix matching • Multiple storage engines • Hash, B-Tree, Fixed length and Table
  • • A lot in common with MongoDB: • Document-oriented • Schema-free • JSON-style documents
  • • Differences • MVCC based • Replication as path to scalability • Query through predefined views • ACID • REST
  • • Focus on performance • Rich dynamic queries • Secondary indexes • Replication / failover • Auto-sharding • Many platforms / languages supported
  • Good at • The web • Caching • High volume / low value • Scalability
  • Less good at • Highly transactional • Ad-hoc business intelligence • Problems that require SQL
  • Ruby support • mongo-ruby-driver • Pure Ruby, with optional C extension • MongoRecord • ORM like functionality • Other mappers
  • Basics • Connect: • db = Mongo.new.db(‘my-database’) • coll = db.collection(‘players’) • Insert: • coll.insert (“name” => “mike”, “age” => ... • Query: • coll.find (“age” => 35)
  • Advanced queries • Sorting • Limit • $gt, $lt, $gte, $lte, $ne, $all, $in, $nin • where() • count() • group()
  • GridFS • File storage in MongoDB • IO-like API for Ruby
  • Other cool stuff • Capped collections • Upserts • Multikeys
  • Demo
  • • Download MongoDB http://www.mongodb.org • Install the Ruby driver • Try it out!
  • • http://www.mongodb.org • irc.freenode.net#mongodb • mongodb-user on google groups • @mongodb • mike@10gen.com