retrieved mainly by primary key, without complex joins. ★You have a non-trivial amount of data, and the thought of managing lots of RDBMS shards and replication failure scenarios gives you the fear. http://www.metabrew.com/article/anti-rdbms-a-list-of-distributed-key-value-stores/ Wednesday, October 28, 2009
ThruDB CouchDB Cassandra HBase Hypertable Redis Tokyo Cabinet/Tyrant http://www.metabrew.com/article/anti-rdbms-a-list-of-distributed-key-value-stores/ Some very cool projects in this space Wednesday, October 28, 2009
★Works best for at objects ★Tokyo Tyrant for network access http://www.igvita.com/2009/02/13/tokyo-cabinet-beyond-key-value-store/ Wednesday, October 28, 2009
tables of data Collection of named documents with varying structure Normalized. Objects spread across tables. Duplication reduced. Denormalized. Docs usually self contained. Data often duplicated. Must know schema to read/write a complete object Must know only document name Dynamic queries of static schemas Static queries of dynamic schemas http://damienkatz.net/files/What is CouchDB.pdf http://damienkatz.net/files/What is CouchDB.pdf Wednesday, October 28, 2009
tables of data Collection of named documents with varying structure Normalized. Objects spread across tables. Duplication reduced. Denormalized. Docs usually self contained. Data often duplicated. Must know schema to read/write a complete object Must know only document name Dynamic queries of static schemas Static queries of dynamic schemas http://damienkatz.net/files/What is CouchDB.pdf http://damienkatz.net/files/What is CouchDB.pdf The devil's in the details Wednesday, October 28, 2009
the JavaScript interactive shell ★mongoexport - export data as JSON or csv ★mongoimport - As advertised ★mongodump - Like mysqldump ★mongorestore - Restore from mongodump les ★mongos - Auto-sharding module (getting better with every build) what's in the box? why? What did you think it was? Wednesday, October 28, 2009
sets (speed) ★Indexable by one or more key ★Are created on-the- y when rst referenced ★Capped collections: Fixed size, older records dropped after limit reached but typed! Wednesday, October 28, 2009
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 Sure wish JSON did this... B is for Binary Wednesday, October 28, 2009
$where :fields (like :select in active record) :limit, :offset for pagination :sort ascending or descending [['foo', 1], ['bar', -1]] count and group (uses map/reduce) db.collection.mapReduce(mapfunction,reducefunction[,options]); More Wednesday, October 28, 2009
differ per document ★Create and Update with single or multiple ★Delete and Destroy and _all counterparts ★Find: id, ids, :all, : rst, :last ★Associations Be careful. Ordering can be tricky. Wednesday, October 28, 2009
★Upserts db.collection.update({'_id':1}, {'$inc': {'views':1}}) ★Multikeys (think tagging and full text search) ★GridFS and auto-sharding Wednesday, October 28, 2009
in effect ★Indexes are important no matter what the salesman told ya about performance ★Data modeling. Deep or Wide? ★MongoDB and MongoMapper are in active development the fine print The answer is yes! Very responsive yet very volatile changes! Wednesday, October 28, 2009