• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
MongoDB For Rubyists - DCRUG
 

MongoDB For Rubyists - DCRUG

on

  • 2,130 views

Presentation on MongoDB and Ruby at DCRUG, Washington DC Ruby User Group -- 12/10/09

Presentation on MongoDB and Ruby at DCRUG, Washington DC Ruby User Group -- 12/10/09

Statistics

Views

Total Views
2,130
Views on SlideShare
2,129
Embed Views
1

Actions

Likes
4
Downloads
35
Comments
0

1 Embed 1

http://www.slideshare.net 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

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 For Rubyists - DCRUG MongoDB For Rubyists - DCRUG Presentation Transcript

    • Intro Friday, December 11, 2009
    • Q. Why do we love Ruby? Friday, December 11, 2009
    • A. “Ruby is designed to be human-oriented. It reduces the burden of programming. It tries to push jobs back to machines. You can accomplish more tasks with less work, in smaller yet readable code.” - Matz Friday, December 11, 2009
    • 01001000011101010110 11010110000101101110 0111011001110011 01001101011000010110 00110110100001101001 0110111001100101 Friday, December 11, 2009
    • Human vs Machine Friday, December 11, 2009
    • Q. Why do I love MongoDB? Friday, December 11, 2009
    • A. “MongoDB is designed to be human-oriented. It reduces the burden of programming. It tries to push jobs back to machines. You can accomplish more tasks with less work, in smaller yet readable code.” - Banker (indebted to Matz) Friday, December 11, 2009
    • MongoDB (is) for Rubyists * * and all human-oriented programmers Friday, December 11, 2009
    • 1. SQL (or No) Friday, December 11, 2009
    • Key/Value Stores Dynamo, Voldemort, Redis, Memcached (keyword: “stores”) Friday, December 11, 2009
    • Column-Oriented Cassandra, BigTable Friday, December 11, 2009
    • Document Databases MongoDB, CouchDB Friday, December 11, 2009
    • RDBMS Transactional Normalized Rigorous Queryable (deeply) Friday, December 11, 2009
    • Friday, December 11, 2009
    • Why build MongoDB? Friday, December 11, 2009
    • Fast & Queryable Key-Value MongoDB Relational Friday, December 11, 2009
    • MongoDB open-source high-performance built for scale document-oriented schema-free Friday, December 11, 2009
    • high performance relaxed acid document model memory-mapped Friday, December 11, 2009
    • built for scale master-slave replica pairs sharding Friday, December 11, 2009
    • master-slave M S S S Friday, December 11, 2009
    • replica-pairs M (S) S (M) M (S) S (M) M (S) S (M) Friday, December 11, 2009
    • Friday, December 11, 2009
    • client Friday, December 11, 2009
    • mongos client Friday, December 11, 2009
    • Shards mongod mongod mongod mongod mongod mongod mongos client Friday, December 11, 2009
    • Shards mongod mongod mongod Config mongod mongod mongod Servers mongod mongod mongod mongos client Friday, December 11, 2009
    • Shards mongod mongod mongod ... Config mongod mongod mongod Servers mongod mongod mongod mongos mongos ... client Friday, December 11, 2009
    • document-oriented {:sku => ‘637636’, :name => ‘Linen tailored pant’, :about => [{:title => ‘fabric & care’, :content => [‘Dry clean’, ‘Imported’]}, {:title => ‘overview’, :content => [‘Tailored fit’, ‘Yarn dyed’]} ] } Friday, December 11, 2009
    • schema-free {:sku => ‘637636’, :note => ‘Added this with no migration!” :name => ‘Linen tailored pant’, :about => [{:title => ‘fabric & care’, :content => [‘Dry clean’, ‘Imported’]}, {:title => ‘overview’, :content => [‘Tailored fit’, ‘Yarn dyed’]} ] Friday, December 11, 2009
    • Q. How many times have you typed this? Friday, December 11, 2009
    • Q. How many times have you typed this? rake db:migrate Friday, December 11, 2009
    • Q. How do you make an RDBMS dynamic? Friday, December 11, 2009
    • A. Hundreds of little tables. Friday, December 11, 2009
    • Friday, December 11, 2009
    • Simulating a flexible schema Friday, December 11, 2009
    • Simulating a flexible schema What’s the join like? Friday, December 11, 2009
    • Simulating a flexible schema What’s the join like? Can we reason about it? Friday, December 11, 2009
    • Q. What % of these tables could be better represented as documents? Friday, December 11, 2009
    • Machine Friday, December 11, 2009
    • Friday, December 11, 2009
    • human Friday, December 11, 2009
    • {:sku => ‘637636’, :name => ‘Linen tailored pant’, :about => [{:title => ‘fabric & care’, :content => [‘Dry clean’, ‘Imported’]}, {:title => ‘overview’, :content => [‘Tailored fit’, ‘Yarn dyed’]} ] }* * Admittedly simplified, but not far-fetched. Friday, December 11, 2009
    • 2. Ruby to MongoDB Friday, December 11, 2009
    • Anatomy of an Insert Friday, December 11, 2009
    • Friday, December 11, 2009
    • Connection mongod (or mongos) Database a database Collection a schema-free table Friday, December 11, 2009
    • Friday, December 11, 2009
    • ObjectID Generation BSON Serialization Fire and Forget Friday, December 11, 2009
    • Dynamic Queries * * like sql Friday, December 11, 2009
    • Friday, December 11, 2009
    • Friday, December 11, 2009
    • b-tree Indexes * * up to 40 per collection Friday, December 11, 2009
    • Friday, December 11, 2009
    • Friday, December 11, 2009
    • Flexible & Fast Updates * * and upserts, too Friday, December 11, 2009
    • Friday, December 11, 2009
    • Friday, December 11, 2009
    • Friday, December 11, 2009
    • Friday, December 11, 2009
    • Elegant Operators * * document keywords Friday, December 11, 2009
    • for queries $ne $in $nin $mod $all $size $exists Friday, December 11, 2009
    • for updates $inc $set $push $pushAll $pop $pull $pullAll Friday, December 11, 2009
    • for everything else: Javascript * * yes, MongoDB speaks JS Friday, December 11, 2009
    • group where map-reduce Friday, December 11, 2009
    • 3. Design Patterns Friday, December 11, 2009
    • One to y Many Many Many Man any Many Many Many any Many Many Many M Many Many Many Many Friday, December 11, 2009
    • comments has_many votes Friday, December 11, 2009
    • relation comments votes comment_id user_id Friday, December 11, 2009
    • document comments Friday, December 11, 2009
    • post has_many comments Friday, December 11, 2009
    • relation post comments post_id user_id tree attrs Friday, December 11, 2009
    • 1. embedded document {:title => ‘a life unexamined’, :comments => [ {:author => ‘socrates’, :text => ‘is not worthwhile’}, {:author => ‘epicurus’, :text => ‘leads to bliss’} ] } Friday, December 11, 2009
    • 2. embedded & nested {:comments => [ {:author => ‘socrates’, :text => ‘is not worthwhile’, :comments => [ {:author => ‘epicurus’, :text => ‘leads to bliss’}]}, ] } Friday, December 11, 2009
    • 3. normalized [{:author => ‘socrates’, :text => ‘is not worthwhile’, :post_id => ‘4c4fa6d000002’}, {:author => ‘epicurus’, :text => ‘leads to bliss’, :post_id => ‘4c4fa6d000002’} ] Friday, December 11, 2009
    • Embed relationships tightly-bound concepts tradeoffs Break out first-class docs independent concepts Friday, December 11, 2009
    • any Many Many Many any Many Many Many M Many Many Many Many to y Many Many Many Man any Many Many Many ny Many Many Many M Many Many Many Many Friday, December 11, 2009
    • relation clients join client_id address_id addresses Friday, December 11, 2009
    • document Friday, December 11, 2009
    • Den o malization r { :username => ‘socrates’, :text => ‘...be as you wish’, :user_id => ‘4c4fa6d000002’ } Friday, December 11, 2009
    • Exercises for the coder Friday, December 11, 2009
    • Capped Collections GridFS for images, videos, music, large binary objects Friday, December 11, 2009
    • MongoDB JS Shell MongoMapper Friday, December 11, 2009
    • MongoDB JS Shell MongoMapper Pre-compiled binaries Thorough documentation Multi-language support Friday, December 11, 2009
    • Q. What is MongoDB good for? Friday, December 11, 2009
    • A. the web real-time logging analytics Friday, December 11, 2009
    • A. the web real-time logging analytics clear path to scalability comprehensible data models speed Friday, December 11, 2009
    • A. the web real-time logging analytics clear path to scalability comprehensible data models speed human-oriented programmers Friday, December 11, 2009
    • google groups: mongodb-user freenode: #mongodb docs & download: mongodb.org github.com/banker/newsmonger newsmonger.heroku.com twitter.com/hwaet kyle@10gen.com inspired by slideshare.net/timanglade/tin Friday, December 11, 2009