74
CouchDB Apache

CouchDB Google

Embed Size (px)

Citation preview

Page 1: CouchDB Google

CouchDBApache

Page 2: CouchDB Google

HelloChris Anderson

[email protected] / @jchris

Apache CouchDB Committer

REST and JavaScript enthusiastDirector, couch.io

Page 3: CouchDB Google

I’m here to answer the question: What is CouchDB? (from an app devs perspective - and some implementor)How many of you have: built an application around a key value store?written map reduce functions?used Erlang in an application?

Page 4: CouchDB Google

Relax - easy to reason about - reliable - your data is safe with us. - honda accord, not a ferrari - as a debating point among developers

Page 5: CouchDB Google

Bandwidth Explosion

Page 6: CouchDB Google
Page 7: CouchDB Google
Page 8: CouchDB Google
Page 9: CouchDB Google
Page 10: CouchDB Google
Page 11: CouchDB Google
Page 12: CouchDB Google

“no bars”

Page 14: CouchDB Google

Latency Sucks

speed of lightdrawback to cloud computing

Page 15: CouchDB Google

What is CouchDB?

- k/v store with map reduce - http database written in erlang

Page 16: CouchDB Google

Local Web Platform

Local Web

Platform - on your device, local network, in a browser plugin - replication: it just works. makes data portable. - real-time remote backups, ad hoc topologies.

Page 17: CouchDB Google

http://www.flickr.com/photos/mcpig/872293700/

“Ground Computing”@jhuggins

- local to the user, more like desktop web than like Gears - local http server - browser apps - same application on the client and server or the cloud

Page 18: CouchDB Google

http://www.flickr.com/photos/shane-h/280084650

Offline by Default

- low latency & reliable - 2 tier applications

Page 19: CouchDB Google

http://jacobian.org/writing/of-the-web/

http://apod.nasa.gov/apod/ap050930.html

“Of the Web”

Let me tell you something: Django may be built for the Web, but CouchDB is built of the Web. I've never seen software that so completely embraces the philosophies behind HTTP. ... this is what the software of the future looks like. Jacob Kaplan-Moss -- October, 2007

perfect spot - discovered not invented

Page 20: CouchDB Google

- lower barrier for contribution - validate installations - foster interop (CouchDB as a protocol)

Page 21: CouchDB Google

Learning Curve

- doc modeling (mvcc / concurrency) - etags / Functional style of REST - eventual consistency

Page 22: CouchDB Google
Page 23: CouchDB Google
Page 24: CouchDB Google

http://www.longnow.org/projects/clock/

http://www.longnow.org/projects/clock/orrery/

Page 25: CouchDB Google

Robust

- single file - append only - no fixup phase - minimizes seeks

Page 26: CouchDB Google

Robust

- when britain is burning - Enda Farrell - bbc

Page 27: CouchDB Google

{ "_id": "BC4ea69ce1a73aa7d21d23b608d221d0", "_rev": "1-967a00dff5e02add41819138abb3284d",

"type": "person", "name": "Darth Vader", "age": 63, "headware": ["Helmet", "Sombrero"], "dark_side": true}

JSON Documents

- denormalize - natural data behavior - evolve formats with your application - easier to bootstrap in your mind

Page 28: CouchDB Google

{ "_id": "BC4ea69ce1a73aa7d21d23b608d221d0", "_rev": "1-967a00dff5e02add41819138abb3284d",

"type": "person", "name": "Darth Vader", "age": 63, "headware": ["Helmet", "Sombrero"], "dark_side": true}

JSON Documents

- 2 patterns - document update - event log

Page 29: CouchDB Google

{ "_id": "BC4ea69ce1a73aa7d21d23b608d221d0", "_rev": "2-41819138abb32967a00dff5e02add84d",

"type": "person", "name": "Darth Vader", "age": 63, "headware": ["Helmet", "Sombrero"], "dark_side": “More CoWbell!”}

JSON Documents

- MVCC - model for concurrency

Page 30: CouchDB Google
Page 31: CouchDB Google

Map Reduce

Page 35: CouchDB Google
Page 36: CouchDB Google

curl -X POSThttp://127.0.0.1:5984/_replicate

-d '{"source":"http://couch.example.com:5984/remote-db",

"target":"local-db"

}'

Page 37: CouchDB Google

curl -X POSThttp://127.0.0.1:5984/_replicate

-d '{"source":"http://couch.example.com:5984/remote-db",

"target":"local-db"

}'

Page 38: CouchDB Google
Page 39: CouchDB Google
Page 40: CouchDB Google
Page 41: CouchDB Google
Page 42: CouchDB Google

periodic, notifier system

Page 43: CouchDB Google
Page 44: CouchDB Google

“In the fullness of time there is only one CouchDB”

Page 45: CouchDB Google

standalone CouchDB applications

Page 46: CouchDB Google

Scaling Down

Page 47: CouchDB Google

Browser CouchJavaScript port

Uses HTML5 storage

Replicates with CouchDB

http://hg.toolness.com/browser-couch/

Page 48: CouchDB Google

Gives Control to Users

CC-BY-SA http://www.flickr.com/photos/kelleys/492253912/

- want to get kids in trouble for programming too muchclaris

Page 49: CouchDB Google
Page 50: CouchDB Google
Page 51: CouchDB Google
Page 52: CouchDB Google

! !

Stuart Langridge - Canonical

Page 53: CouchDB Google

- good because it's the status quo - easy to address with URLs - bad because users are depending on a remote resource for low latency responses - centralized, so traffic spikes impact all users, who might start refreshing

Page 54: CouchDB Google

- local requests are fast - easier to tune for throughput - plays to the strengths of mobile connections

Page 55: CouchDB Google

- users can run different applications on the same datasetdeployment Independent Personal - dark matter of the information universe

Page 56: CouchDB Google

messaging peer discovery identity Can we trust intermediate servers?

Page 57: CouchDB Google

“Obvious.”

web architecture

Page 58: CouchDB Google

Local Web Platform

Page 59: CouchDB Google

anks!

Page 60: CouchDB Google

Resources@CouchDB

http://couchdb.apache.org/

Dress like a Couch: http://shop.couchdb.com

http://planet.couchdb.org/

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

Page 61: CouchDB Google

http://books.couchdb.org/relax

@couchdbinaction

Page 62: CouchDB Google

Robust

JSON

HTTP

Local

Page 63: CouchDB Google

couch.io

Conflict resolution by example

A B

Page 64: CouchDB Google

couch.io

Conflict resolution by example

A B

Page 65: CouchDB Google

couch.io

❦❦

Conflict resolution by example

A B

Page 66: CouchDB Google

couch.io

❦ ❦

Conflict resolution by example

A B

Page 67: CouchDB Google

couch.io

Conflict resolution by example

A B

Page 68: CouchDB Google

couch.io

Conflict resolution by example

A B

❦ ✿

Page 69: CouchDB Google

couch.io

Conflict resolution by example

A B

❦ ✿♪

Page 70: CouchDB Google

couch.io

✿♪

Conflict resolution by example

A B

Page 71: CouchDB Google

couch.io

✿♪

Conflict resolution by example

A B

Page 72: CouchDB Google

couch.io

✿♪

Conflict resolution by example

A B

Page 73: CouchDB Google

couch.io

✿♪

Conflict resolution by example

A B