Couchdb


„Cluster of unreliable commodity hardware Data Base“

Created by Peponi / André

Facts Sheet


  • 2005 Damien Katz / 2008 Apache Foundation
  • a document orientated Database
  • based on Erlang
  • Apache Licence
  • Query Language is Javascript
  • RESTfull
  • CORS
  • Race Condition > Multiversion Concurrency Control = no version control

Installation


wiki.apache.org/couchdb/Installation

Virtual Box Image on USB Stick provided



check if you DB instance works

# curl http://127.0.0.1:5984/

create new Database



# curl -X PUT http://127.0.0.1:5984/jeronimo

# curl -X GET http://127.0.0.1:5984/_all_dbs



# curl -X PUT http://127.0.0.1:5984/jeronimo/12345 -d '{"hello":"world"}'

# curl -X PUT http://127.0.0.1:5984/jeronimo/12345



guide.couchdb.org/editions/1/de/tour.html

Futon

move your ass to

127.0.0.1:5984/_utils/

couchdb futon screenshot

Futon



guide.couchdb.org/editions/1/de/tour.html#figure/7

function(doc) {
    var store, price, key;
    if (doc.item && doc.prices) {
        for (store in doc.prices) {
            price = doc.prices[store];
            key = [doc.item, price];
            emit(key, store);
        }
    }
}
					

Replication



guide.couchdb.org/editions/1/de/tour.html#figure/9

Clients



wiki.apache.org/couchdb/Related_Projects

Projects

pouchdb.com
hood.ie
couchapp.org
    +----------------+                             +------------------+                  +-------+
    | Browser        |                             |  Server          |                  |  DB   |
    |----------------|+--------------------------->|------------------|+----------------->-------|
    |                |                             |                  |                  |       |
    |                <-----------------------------+  Routine         <------------------+       |
    |                |                             |                  |                  |       |
    +----------------+                             +------------------+                  +-------+
    
    +----------------+              +-------+
    | Browser        |              |  DB   |          +-------------+
    |----------------+-------------->-------|          | Routine     |
    |                |              |       |          |             |
    |                |              |       |<---------+             |
    |                <--------------+       |          |             |
    |                |              |       |<--------+|             |
    |                |              |       |          +-------------+
    |                |              |       |
    +----------------+              +-------+    
					

THX