No SQL? No Driver? No Application Server? No Problem! fileCouchDB - protocol HTTP as native protocol...

Preview:

Citation preview

No SQL? No Driver? No Application Server?No Problem!

Elmar Schraml schraml@adesso.de

Who am I ?

@elmarschraml

adesso AG Enterprise Java, web services,... Closet web enthusiast

In Munich: - JUGM - GTUGMUC

Agenda

1) NoSQL –why?

2) CouchDB -what and how

3) CouchApps -cool!

History of Databases

1970s – Relational Databases

History of Databases

1980s – Nothing much happens

History of Databases

1990s – Nothing much happens

History of Databases

2000s – Nothing much happens

NoSQL

Why - Scaling

Relational Databases at Web scale

CAP Theory

Why – Object Storage

Why – Object Storage

NoSQL - who?

CouchDB - who?

Damien Katz

CouchDB – data format

CouchDB – data format

{ "_id": "sdjkdf3892kle23", "_rev": "3-sdfs34", "type": "person", "name": "Elmar", "age": 29, "preferred_hardware": ["macbook","iphone","kindle"] "geek": true }

CouchDB - protocol

HTTP as native protocol

Use existing tools

REST assured

„MySQL is built FOR the web,CouchDB is built OF the web“

NO DRIVER

CouchDB - API

Create -> PUT /mydb/docid Read -> GET /mydb/docid Update -> POST /mydb/docid Delete -> DELETE /mydb/docid

Example:curl -X PUT http://localhost:5984/allmyshinythings -d

'<insert json string here>'

CouchDB - Views

map: function(doc) { if(doc.firstname) { emit(doc.firstname, doc) } }

Reduce: function(keys,values,rereduce){ return sum(values) }

NO SQL

Web applications

HTTP interface

Routing

CRUD operations

Validation

Render Html interface ...... let's see....

CouchDB – show functions

CouchDB – list functions

CouchDB - CouchApp

Deployment script

Templating functions

Jquery Plugin

NO APPLICATION

SERVER

I CAN HAZ

APPSERVER

IN MY

COUCH !?!

CouchDB - Replication

curl -X POST http://localhost:5984/_replicate'{"source":"/somedb","target":"http://theotherguy.org:5984/somedb","continuous":true}'

CouchDB - Replication

CouchDB - Replication

CouchDB - Replication

CouchDB - Replication

State of the CouchDB

1.0 out in Aug 2010 CouchIO Hosting services GeoCouch for GIS Lounge for Clustering 20+ CouchApps Several books coming

What for?

- object persistence: no more hibernate

- Document storage: no more “big chunk of xml in a clobcolumn”

- Data sync: poor man’s dropbox

- Couch apps: “view source” for webapps

More?

couchdb.apache.org

couchapp.org

guide.couchdb.org

schraml@adesso.de

@elmarschraml

THANKS

Recommended