couchdb apache in 20 minutes - perconawho’s talking? • jan lehnardt / [email protected] / @janl •...

42
CouchDB Apache In 20 Minutes Wednesday, 22 April 2009

Upload: dokien

Post on 04-Mar-2018

221 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

CouchDBApache

In 20 Minutes

Wednesday, 22 April 2009

Page 2: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

RelaxWednesday, 22 April 2009

Page 3: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Who’s Talking?

• Jan Lehnardt / [email protected] / @janl

• “Open Source Dude”• Director, CouchDB Ltd.

Wednesday, 22 April 2009

Page 4: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Damien KatzWassat?

Wednesday, 22 April 2009

What’s CouchDB?

Page 5: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Features• Schema Free (JSON)

• Document Oriented, Not Relational

• Highly Concurrent

• RESTful HTTP API

• JavaScript Powered Map/Reduce

• N-Master Replication

• Robust Storage

Wednesday, 22 April 2009

Page 6: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Features• Schema Free (JSON)

• Document Oriented, Not Relational

• Highly Concurrent

• RESTful HTTP API

• JavaScript Powered Map/Reduce

• N-Master Replication

• Robust Storage

Wednesday, 22 April 2009

Page 7: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Schema Free ( JSON){ "_id": "BCCD12CBB", "_rev": "AB764C",

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

Wednesday, 22 April 2009

Page 8: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Schema Free ( JSON){ "_id": "BCCD12CBB", "_rev": "AB764C",

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

Wednesday, 22 April 2009

Page 9: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Schema Free ( JSON){ "_id": "BCCD12CBB", "_rev": "AB764C",

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

Wednesday, 22 April 2009

Access Tokens for MVCC

Page 10: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Schema Free ( JSON){ "_id": "BCCD12CBB", "_rev": "AB764C",

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

Wednesday, 22 April 2009

Access Tokens for MVCC

Page 11: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Features• Schema Free (JSON)

• Document Oriented, Not Relational

• Highly Concurrent

• RESTful HTTP API

• JavaScript Powered Map/Reduce

• N-Master Replication

• Robust Storage

Wednesday, 22 April 2009

Page 12: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Document Oriented• Documents in the Real World™

• Bills, letters, tax forms…

• Same type != same structure

• Can be out of date (so what?)

• No references

Not Relational

Wednesday, 22 April 2009

Page 13: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Document Oriented• Documents in the Real World™

• Bills, letters, tax forms…

• Same type != same structure

• Can be out of date (so what?)

• No references

Not Relational

Natural Data Behaviour

Wednesday, 22 April 2009

Page 14: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Features• Schema Free (JSON)

• Document Oriented, Not Relational

• Highly Concurrent

• RESTful HTTP API

• JavaScript Powered Map/Reduce

• N-Master Replication

• Robust Storage

Wednesday, 22 April 2009

Page 15: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Highly ConcurrentErlang Praising

Wednesday, 22 April 2009

Page 16: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Highly Concurrent

• Parallelism built into the language

Erlang Praising

Wednesday, 22 April 2009

Page 17: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Highly Concurrent

• Parallelism built into the language

• Makes programming multi-core easy(er)

Erlang Praising

Wednesday, 22 April 2009

Page 18: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Highly Concurrent

• Parallelism built into the language

• Makes programming multi-core easy(er)

• Easy to create fault-tolerant systems

Erlang Praising

Wednesday, 22 April 2009

Page 19: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Highly ConcurrentApache vs. YAWS

Wednesday, 22 April 2009

Page 20: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Features• Schema Free (JSON)

• Document Oriented, Not Relational

• Highly Concurrent

• RESTful HTTP API

• JavaScript Powered Map/Reduce

• N-Master Replication

• Robust Storage

Wednesday, 22 April 2009

Page 21: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

ful • Create

HTTP PUT /db/mydocid

• ReadHTTP GET /db/mydocid

• UpdateHTTP PUT /db/mydocid

• DeleteHTTP DELETE /db/mydocid

CRUD

Wednesday, 22 April 2009

Page 22: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

couch = CouchRest.database!("http://127.0.0.1:5984/tweets")

tweets_url = "http://twitter.com/statuses/user_timeline.json"

tweets = http.get(tweets_url)couch.bulk_save(tweets)

ful Example

Wednesday, 22 April 2009

Page 23: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Features• Schema Free (JSON)

• Document Oriented, Not Relational

• Highly Concurrent

• RESTful HTTP API

• JavaScript Powered Map/Reduce

• N-Master Replication

• Robust Storage

Wednesday, 22 April 2009

Page 24: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

JavaScript powered Map/Reduce

• Map functions extract data from your documents & reduce functions aggregate intermediate values.

• The kicker: Incremental b-tree storage.

Wednesday, 22 April 2009

Page 25: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Features• Schema Free (JSON)

• Document Oriented, Not Relational

• Highly Concurrent

• RESTful HTTP API

• JavaScript Powered Map/Reduce

• N-Master Replication

• Robust Storage

Wednesday, 22 April 2009

Page 26: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Wednesday, 22 April 2009

Page 27: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Wednesday, 22 April 2009

Page 28: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Wednesday, 22 April 2009

Page 29: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Wednesday, 22 April 2009

Page 30: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Wednesday, 22 April 2009

Page 31: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Wednesday, 22 April 2009

Page 32: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Wednesday, 22 April 2009

Page 33: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Wednesday, 22 April 2009

periodic, notifier system

Page 34: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Wednesday, 22 April 2009

Page 35: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Wednesday, 22 April 2009

P2P apps

Page 36: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Features• Schema Free (JSON)

• Document Oriented, Not Relational

• Highly Concurrent

• RESTful HTTP API

• JavaScript Powered Map/Reduce

• N-Master Replication

• Robust Storage

Wednesday, 22 April 2009

Page 37: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Robust Storage

Append Only File Structure

Designed to Crash

Instant-On

Wednesday, 22 April 2009

Page 38: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Resources• Twitter: @CouchDB & http://couchdb.org/

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

• http://planet.couchdb.org/

• http://blog.racklabs.com/?p=74

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

Wednesday, 22 April 2009

Page 39: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

CouchDB Factory•http://short.ie/couchdbconf•Next Friday, Palo Alto•Come and relax

Wednesday, 22 April 2009

Page 40: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

couch.ioBerlin – London – Portland

If you need professional CouchDB support talk to the dimwit on stage

Wednesday, 22 April 2009

Page 41: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

anks!Wednesday, 22 April 2009

Page 42: CouchDB Apache In 20 Minutes - PerconaWho’s Talking? • Jan Lehnardt / jan@apache.org / @janl • “Open Source Dude” • Director, CouchDB Ltd. Wednesday, 22 April 2009

Wednesday, 22 April 2009