Document-Oriented Databases
       A CouchDB Primer




Wednesday, March 17, 2010
jsiarto


                            jeff@loudpixel.com



Wednesday, March 17, 2010
SELECT * FROM reviews
       JOIN movies ON movies.id
       = reviews.movie_id WHERE
       movies.title = ‘Gigli’;


   ...
Name Jeff Siarto
                            Employee Number 0001
                            Titles President, Creative D...
{
              "_id": "1d62f8555188f1267a6fcbe81f9dc54b",
              "_rev": "5-1511a8ac9d5ad5512774545ae390201d",
   ...
Data APIs              YAML




                            JSON


       Native Browser              JavaScript
         ...
Futon



Wednesday, March 17, 2010
Wednesday, March 17, 2010
REST

       GET http://localhost:5984/loudpixel_employees/1d62f8...


       PUT http://localhost:5984/loudpixel_employee...
CouchDB Views




Wednesday, March 17, 2010
Map Function
       function(doc) {
         if (doc.type == "Full-time") {
           doc.titles.map(function(title) {
  ...
CouchREST
                            http://github.com/jchris/couchrest
                            CouchREST Rails
     ...
★   Uses BSON instead of JSON
       ★   Dynamic query language
       ★   Interfaces using native drivers (no REST)
     ...
Levee
       Monitoring management dashboard that helps you build and
       deliver research reports to clients




     ...
Resources

       http://couchdb.apache.org/

       http://peepcode.com/products/couchdb-
       with-rails

       http:...
Upcoming SlideShare
Loading in …5
×

Document-Oriented Databases: Couchdb Primer

2,972 views

Published on

Published in: Technology, Design
  • Be the first to comment

Document-Oriented Databases: Couchdb Primer

  1. 1. Document-Oriented Databases A CouchDB Primer Wednesday, March 17, 2010
  2. 2. jsiarto jeff@loudpixel.com Wednesday, March 17, 2010
  3. 3. SELECT * FROM reviews JOIN movies ON movies.id = reviews.movie_id WHERE movies.title = ‘Gigli’; movies reviews Wednesday, March 17, 2010
  4. 4. Name Jeff Siarto Employee Number 0001 Titles President, Creative Director, Analyst Websites http://loudpixel.com, http://siarto.com Social Twitter: @jsiarto, Github: jsiarto Jeff Ryan Allie Wednesday, March 17, 2010
  5. 5. { "_id": "1d62f8555188f1267a6fcbe81f9dc54b", "_rev": "5-1511a8ac9d5ad5512774545ae390201d", "first_name": "Jeff", "last_name": "Siarto", "titles": [ "Partner", "Analyst", "Designer" ], "online": { "website": "http://siarto.com", "twitter": "@jsiarto", "github": "http://github.com/jsiarto" } } Wednesday, March 17, 2010
  6. 6. Data APIs YAML JSON Native Browser JavaScript Support Wednesday, March 17, 2010
  7. 7. Futon Wednesday, March 17, 2010
  8. 8. Wednesday, March 17, 2010
  9. 9. REST GET http://localhost:5984/loudpixel_employees/1d62f8... PUT http://localhost:5984/loudpixel_employees/1d62f8... POST http://localhost:5984/loudpixel_employees DELETE http://localhost:5984/loudpixel_employees/1d62f8... Wednesday, March 17, 2010
  10. 10. CouchDB Views Wednesday, March 17, 2010
  11. 11. Map Function function(doc) { if (doc.type == "Full-time") { doc.titles.map(function(title) { emit(title, doc); }); } } Reduce Function function(key, values, combine) { return values.length; } Wednesday, March 17, 2010
  12. 12. CouchREST http://github.com/jchris/couchrest CouchREST Rails http://github.com/hpoydar/couchrest-rails CouchDB-Python http://code.google.com/p/couchdb-python/ PHPillow http://arbitracker.org/phpillow.html Wednesday, March 17, 2010
  13. 13. ★ Uses BSON instead of JSON ★ Dynamic query language ★ Interfaces using native drivers (no REST) ★ Not as durable as CouchDB in single-server deployments Wednesday, March 17, 2010
  14. 14. Levee Monitoring management dashboard that helps you build and deliver research reports to clients charts datasets data points } cot-0001 Wednesday, March 17, 2010
  15. 15. Resources http://couchdb.apache.org/ http://peepcode.com/products/couchdb- with-rails http://books.couchdb.org/relax/ http://www.mongodb.org/display/DOCS/ MongoDB,+CouchDB,+MySQL+Compare+Grid Wednesday, March 17, 2010

×