Académique Documents
Professionnel Documents
Culture Documents
^
Hands on with MongoDB
Austin on Rails ★ October 27, 2009
WYNNNETHERLAND
Wednesday, October 28, 2009
Wednesday, October 28, 2009
x
No SQL?
http://www.metabrew.com/article/anti-rdbms-a-list-of-distributed-key-value-stores/
ve r y c o o l
e
Ringo
Scalaris
So m sp a ce
t s i n t h i s
j e c
Kai
Dynomite
pr o
MemcacheDB
ThruDB
CouchDB
Cassandra
HBase
Hypertable
Redis
Tokyo Cabinet/Tyrant
http://www.metabrew.com/article/anti-rdbms-a-list-of-distributed-key-value-stores/
★ Lightning fast
★ Works best for flat objects
★ Tokyo Tyrant for network access
http://www.igvita.com/2009/02/13/tokyo-cabinet-beyond-key-value-store/
http://couchdb.apache.org/
CouchRest
Basic model
e
RelaxDB
Fr o m t h k
CouchPotato
a i l s t a l
u st i n o n R
CouchFoo A
ActiveCouch
http://www.slideshare.net/brianthecoder/couchdb
Normalized. Objects spread across tables. Denormalized. Docs usually self contained. Data
Duplication reduced. often duplicated.
http://damienkatz.net/files/What is CouchDB.pdf
http://damienkatz.net/files/What is CouchDB.pdf
http://damienkatz.net/files/What is CouchDB.pdf
http://damienkatz.net/files/What is CouchDB.pdf
database
database database
database database
Well that one isn't new...
collection
collection table
document
http://www.mongodb.org/display/DOCS/BSON
Wednesday, October 28, 2009
Document Storage (BSON)
{ author: 'joe',
created: Date('03-28-2009'),
title: 'Yet another blog post',
text: 'Here is the text...',
tags: [ 'example', 'joe' ],
comments: [ { author: 'jim', comment: 'I disagree' },
{ author: 'nancy', comment: 'Good post' }
]
}
http://www.mongodb.org/display/DOCS/BSON
Wednesday, October 28, 2009
Document Storage (BSON) B is for Binary
{ author: 'joe',
created: Date('03-28-2009'),
title: 'Yet another blog post',
text: 'Here is the text...',
tags: [ 'example', 'joe' ],
comments: [ { author: 'jim', comment: 'I disagree' },
{ author: 'nancy', comment: 'Good post' }
]
}
http://www.mongodb.org/display/DOCS/BSON
Wednesday, October 28, 2009
That looks like JSON
jason.to_json
Wednesday, October 28, 2009
Where's the Ruby?
db.collection.find({'author.first_name':'John'}) # subdocument
db.collection.mapReduce(mapfunction,reducefunction[,options]);
one :address
many :articles
end
Included as module, not subclassed
(this may change soon).
class Address
include MongoMapper::Document
key :street, String
key :city, String
key :state, String, :length => 2
key :zip, Integer, :numeric => true, :length => 5
end
http://mongodb.org
http://www.10gen.com the very cool company behind MongoDB
http://groups.google.com/group/mongomapper
http://groups.google.com/group/mongodb-user
http://squeejee.com
http://wynnnetherland.com