• Like
  • Save
Introduction to REST & CouchDB
Upcoming SlideShare
Loading in...5
×
 

Introduction to REST & CouchDB

on

  • 10,985 views

A presentation introducing REST and CouchDB given at the "Web Enigineering" course at Ulm University, 2011/01/28.

A presentation introducing REST and CouchDB given at the "Web Enigineering" course at Ulm University, 2011/01/28.

Statistics

Views

Total Views
10,985
Views on SlideShare
10,738
Embed Views
247

Actions

Likes
11
Downloads
206
Comments
0

8 Embeds 247

http://www.benjamin-erb.de 216
http://benjamin-erb.de 24
https://twitter.com 2
http://paper.li 1
http://www.netvibes.com 1
http://translate.googleusercontent.com 1
http://10.150.200.76 1
http://www.slashdocs.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Introduction to REST & CouchDB Introduction to REST & CouchDB Presentation Transcript

    • Introduction to REST & CouchDBBenjamin Erb | 28.01.2011 | Universität Ulm Web Engineering WS10/11
    • Slide 2 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Introduction Benjamin Erb http://twitter.com/b_erb http://github.com/berb http://www.benjamin-erb.de student of computer sciene & media informatics Ulm University, Germany
    • Part I: REST
    • Slide 4 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Programming for Distributed Systems communication between computer programs distributed (different processes . . . different machines) popular approaches RPC (remote procedure call) RMI (OOP-ish RPC) Messaging (SOAP, MQs) ...
    • Slide 5 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Representational State Transfer (REST) architectural style for distributed hypermedia systems
    • Slide 6 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 The Idea behind REST WWW REST
    • Slide 6 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 The Idea behind REST WWW distributed hypermedia system works on “Internet scale” loose coupling human users REST
    • Slide 6 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 The Idea behind REST WWW REST architectural style distributed systems embracing the ideas behind the web non-human users (applications)
    • Slide 6 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 The Idea behind REST WWW REST Please note: We’ll only focus on applying the REST architectural style on HTTP during this talk.
    • Slide 7 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 The Main Principles of REST client-server architecture statelessness uniform interface cacheability layered system
    • Slide 8 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Client-Server Architecture Request Response
    • Slide 9 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Statelessness server manages resource states client manages session states »[...]each request from client to server must contain all of the information necessary to understand the request, and cannot take advantage of any stored context on the server.« Source: Roy T. Fielding — Architectural Styles and the Design of Network-based Software Architectures
    • Slide 10 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Statelessness — Examples http://google.com/search?q=uni+ulm&start=10 http://example/q?SID=61AUOh6W1TA&page=next
    • Slide 10 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Statelessness — Examples http://google.com/search?q=uni+ulm&start=10 search query for “uni ulm” second result page http://example/q?SID=61AUOh6W1TA&page=next
    • Slide 10 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Statelessness — Examples http://google.com/search?q=uni+ulm&start=10 search query for “uni ulm” second result page http://example/q?SID=61AUOh6W1TA&page=next server maintains sessions for each search process SID contains session variable server must check state of session (i.e. search term) apply new action (i.e. next page)
    • Slide 10 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Statelessness — Examples http://google.com/search?q=uni+ulm&start=10 search query for “uni ulm” second result page × http://example/q?SID=61AUOh6W1TA&page=next server maintains sessions for each search process SID contains session variable server must check state of session (i.e. search term) apply new action (i.e. next page)
    • Slide 11 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Uniform Interface set of distinct methods generic operations methods of interface ∼ verbs cf. component interface design pattern
    • Slide 12 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 HTTP Methods safe idempotent cachable1 HEAD GET PUT DELETE POST 1 possible
    • Slide 13 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 CRUD Verbs for Resources C create PUT create resource; client knows URI a-priori POST create resource; server chooses URI of new resource R read GET retrieve resource U update PUT change resource D delete DELETE remove resource
    • Slide 14 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Constraints due to the Uniform Interface identification of resources manipulation of resources through representations self-descriptive messages hypermedia as the engine of application state
    • Slide 15 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Identification of Resources “nouns” of the application fine-grained entities addressable through URIs Examples http://portal/user/4711 http://shop/customer/23/order/8 http://blog/post/the-post-title/comments http://search/query?term=foo
    • Slide 16 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Manipulation of Resources through Representations GET /resource/4711 200 OK PUT /resource/4711 200 OK
    • Slide 17 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Self-descriptive Messages messages contain representations of resources descriptitve data available in HTTP headers also useful for intermediate proxies
    • Slide 18 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Self-descriptive Messages (2) popular representations for RESTful applications XML JSON HTML representations can be negotiated HTTP Request Headers: Accept, Accept-Language, Accept-Encoding HTTP Response Headers: Content-Type, Content-Language, Content-Encoding HTTP Responses: 300 Multiple Choices, 406 Not Acceptable
    • Slide 19 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Hypermedia as the Engine of Application State Linking resources /users {"users" : [ GET /users { "id": 23, "link" : "/user/23" }, 200 OK { "id": 42, "link" : "/user/42" } ]} /user/23 {"user" : { GET /user/23 "id" : 23, "name" : "foobar", "details" { ... 200 OK } }}
    • Slide 20 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Hypermedia as the Engine of Application State (2) Creating resources through factory resources POST /users HTTP/1.1 Host: foo.x ... Content-Type: application/json POST /users {"user" : { "name" : "qwerty", "details" { ... } 201 Created }} HTTP/1.1 201 Created Location: http://foo.x/user/12 ...
    • Slide 21 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 REST Triangle Nouns URIs http://host/user/4711 Verbs HTTP Methods GET, PUT,… Representations Content-Types XML, JSON, HTML,…
    • Use CaseRESTful API
    • Slide 23 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 REST: Further Readings Dissertation of Roy Thomas Fielding (Original source) http://www.ics.uci.edu/~fielding/pubs/ dissertation/top.htm (Chapter 5) Books Richardson, Leonard; Ruby, Sam: RESTful Web Services (O’Reilly) Stefan Tilkov: REST und HTTP (dpunkt Verlag) Articles http://tomayko.com/writings/rest-to-my-wife
    • Part II: CouchDB
    • Jacob Kaplan-Moss (Django Developer) »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.«
    • NoSQL
    • NoSQLNot Only SQL
    • Slide 27 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 SQL relational algebra database schemes powerful (ad-hoc) queries transactional behaviour blocking consistency ACID A atomicity C consistency I isolation D durability
    • Slide 28 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 SQL. . . but Think of large data sets (i.e. Facebook profiles) many concurrent reads/writes (i.e. Tweets) oops RDBMS are really hard to scale reads are hard writes are even harder
    • Slide 29 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 NoSQL dedicated database architecture special purposes: scalability, read/write performance, . . . BASE BA basically available S soft state E eventually consistent
    • Slide 30 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 NoSQL. . . but weak(er) consistency models generally less features querying no SQL (sic) ad-hoc queries difficult or even not possible i.e. MapReduce instead
    • Slide 31 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 CAP Theorem Availability Consistency Partition Tolerance
    • Slide 31 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 CAP Theorem (pick two) Relational Database Management Systems Availability Consistency Partition Tolerance Eventual Consistency
    • Slide 32 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 NoSQL Databases Document Stores Wide Column Stores Graph Databases Key-Value Stores
    • Slide 32 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 NoSQL Databases Document Stores “documents” ∼ structured, but schemaless data sets Examples: CouchDB, MongoDB Wide Column Stores Graph Databases Key-Value Stores
    • Slide 32 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 NoSQL Databases Document Stores Wide Column Stores sparse tables / column-oriented instead of row-oriented Examples: Cassandra, HBase Graph Databases Key-Value Stores
    • Slide 32 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 NoSQL Databases Document Stores Wide Column Stores Graph Databases data structured as graphs Examples: neo4j, FlockDB Key-Value Stores
    • Slide 32 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 NoSQL Databases Document Stores Wide Column Stores Graph Databases Key-Value Stores cf. HashTable / HashMap Examples: Redis, Amazon Dynamo, Voldemort
    • Slide 33 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 CouchDB NoSQL database document store distributed architecture easy replication
    • Slide 34 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 CouchDB (2) written in Erlang documents stored as JSON RESTful HTTP API MapReduce functions (JavaScript) for views
    • Slide 35 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 JSON JavaScript Object Notation leightweight data-interchange format types string, number, boolean, null structures array, object
    • Slide 36 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 JSON — Example 1 { 2 "boolean" : true, 3 "array" : ["foo","bar"], 4 "object" : { 5 "key" : "value", 6 "num" : 123 7 } 8 }
    • Slide 37 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Documents JSON two required fields _id _rev (versioning/concurrency control) Example: 1 { 2 "_id": "58fb1df368cd2f9fef8e387508000f6d", 3 "_rev": "1-ddc8d18e4d30f529608ec65d7e7879f2", 4 "name": "cauliflower soup", 5 "type": "soup", 6 "labels": [ 7 "organic", 8 "veggie" 9 ] 10 }
    • Slide 38 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 RESTful API: Create a Database benjamin@cronos:~$ curl -i -X PUT http://localhost:5984/mensaplan HTTP/1.1 201 Created Server: CouchDB/1.1.0a7446e91-git (Erlang OTP/R13B) Location: http://localhost:5984/mensaplan Date: Thu, 27 Jan 2011 12:55:29 GMT Content-Type: application/json;charset=utf-8 Content-Length: 12 Cache-Control: must-revalidate {"ok":true}
    • Slide 39 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 RESTful API: Create a Database (2) Let’s try again. . . benjamin@cronos:~$ curl -i -X PUT http://localhost:5984/mensaplan HTTP/1.1 412 Precondition Failed Server: CouchDB/1.1.0a7446e91-git (Erlang OTP/R13B) Date: Thu, 27 Jan 2011 12:57:30 GMT Content-Type: application/json;charset=utf-8 Content-Length: 95 Cache-Control: must-revalidate {"error":"file_exists","reason":"The database could not be created, the file already exists."}
    • Slide 40 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 RESTful API: Delete a Database benjamin@cronos:~$ curl -i -X DELETE http://localhost:5984/mensaplan HTTP/1.1 200 OK Server: CouchDB/1.1.0a7446e91-git (Erlang OTP/R13B) Date: Thu, 27 Jan 2011 13:01:39 GMT Content-Type: application/json;charset=utf-8 Content-Length: 12 Cache-Control: must-revalidate {"ok":true}
    • Slide 41 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 RESTful API: Create a Document benjamin@cronos:~$ curl -i -X POST -H "Content-Type: application/json" -d ’{"name":" goulash","type":"main","labels":["pork"]}’ http://localhost:5984/mensaplan HTTP/1.1 201 Created Server: CouchDB/1.1.0a7446e91-git (Erlang OTP/R13B) Location: http://localhost:5984/mensaplan/ad8592f32ccd34f0588b86f5a9000fd3 Date: Thu, 27 Jan 2011 13:04:09 GMT Content-Type: application/json;charset=utf-8 Content-Length: 95 Cache-Control: must-revalidate {"ok":true,"id":"ad8592f32ccd34f0588b86f5a9000fd3","rev":"1-5 bb3c72e38c6c7aaa7a2d4fd578478e7"}
    • Slide 42 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 RESTful API: Get a Document benjamin@cronos:~$ curl -i -X GET http://localhost:5984/mensaplan/ ad8592f32ccd34f0588b86f5a9000fd3 HTTP/1.1 200 OK Server: CouchDB/1.1.0a7446e91-git (Erlang OTP/R13B) Etag: "1-5bb3c72e38c6c7aaa7a2d4fd578478e7" Date: Thu, 27 Jan 2011 13:07:27 GMT Content-Type: application/json;charset=utf-8 Content-Length: 136 Cache-Control: must-revalidate {"_id":"ad8592f32ccd34f0588b86f5a9000fd3","_rev":"1-5bb3c72e38c6c7aaa7a2d4fd578478e7" ,"name":"goulash","type":"main","labels":["pork"]}
    • Slide 43 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 RESTful API: Update a Document benjamin@cronos:~$ curl -i -X PUT -H "Content-Type: application/json" -d ’{"name":" goulash","type":"main","labels":["pork","organic"]}’ http://localhost:5984/ mensaplan/ad8592f32ccd34f0588b86f5a9000fd3 HTTP/1.1 409 Conflict Server: CouchDB/1.1.0a7446e91-git (Erlang OTP/R13B) Date: Thu, 27 Jan 2011 13:08:53 GMT Content-Type: application/json;charset=utf-8 Content-Length: 58 Cache-Control: must-revalidate {"error":"conflict","reason":"Document update conflict."}
    • Slide 44 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 RESTful API: Update a Document (doing it right) benjamin@cronos:~$ curl -i -X PUT -H "Content-Type: application/json" -d ’{"name":" goulash","type":"main","labels":["pork","organic"]}’ http://localhost:5984/ mensaplan/ad8592f32ccd34f0588b86f5a9000fd3 -H ’If-Match: "1-5 bb3c72e38c6c7aaa7a2d4fd578478e7"’ HTTP/1.1 201 Created Server: CouchDB/1.1.0a7446e91-git (Erlang OTP/R13B) Location: http://localhost:5984/mensaplan/ad8592f32ccd34f0588b86f5a9000fd3 Etag: "2-8ebf81b724635a1b625cc1a66e0e5263" Date: Thu, 27 Jan 2011 13:10:41 GMT Content-Type: application/json;charset=utf-8 Content-Length: 95 Cache-Control: must-revalidate {"ok":true,"id":"ad8592f32ccd34f0588b86f5a9000fd3","rev":"2-8 ebf81b724635a1b625cc1a66e0e5263"}
    • MapReduce?
    • http://www.flickr.com/photos/bdesham/2432400623
    • Slide 47 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 MapReduce
    • Slide 47 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 MapReduce map
    • Slide 47 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 MapReduce 2x 3x 1x 1x map 3x 2x 2x
    • Slide 47 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 MapReduce 2x 3x 1x 1x map reduce 3x 2x 2x
    • Slide 47 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 MapReduce 2x 3x 1x 1x 2x map reduce 6x 3x 3x 3x 2x 2x
    • Source: http://browsertoolkit.com/fault-tolerance.png
    • Slide 49 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 CouchDB Views with MapReduce views ∼ B+ trees incremental tuples of <key, value> items sorted by key complex keys possible (JSON)
    • Slide 50 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 View Example: List organic food only map 1 function(doc){ 2 if(doc.labels){ 3 for(var idx in doc.labels){ 4 if(doc.labels[idx] === "organic"){ 5 emit(doc._id, doc.name); 6 } 7 } 8 } 9 }
    • Slide 51 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Querying the View benjamin@cronos:~$ curl -i http://localhost:5984/mensaplan/_design/couchapp/_view/ organic HTTP/1.1 200 OK Transfer-Encoding: chunked Server: CouchDB/1.1.0a7446e91-git (Erlang OTP/R13B) Etag: "7GW4ZJ7D8F2T2OCFL7VJO5AO6" Date: Thu, 27 Jan 2011 14:26:35 GMT Content-Type: text/plain;charset=utf-8 Cache-Control: must-revalidate {"total_rows":2,"offset":0,"rows":[ {"id":"58fb1df368cd2f9fef8e387508000f6d","key":"58fb1df368cd2f9fef8e387508000f6d"," value":"cauliflower soup"}, {"id":"58fb1df368cd2f9fef8e387508001149","key":"58fb1df368cd2f9fef8e387508001149"," value":"spaghetti napoli"} ]}
    • Slide 52 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 View Example: Count dishes in database map 1 function(doc){ 2 if(doc.type){ 3 emit(doc.type, 1); 4 } 5 } reduce 1 function (key, values, rereduce) { 2 return sum(values); 3 }
    • Slide 53 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Querying the View (without reduce) benjamin@cronos:~$ curl -i http://localhost:5984/mensaplan/_design/couchapp/_view/ dishes?reduce=false HTTP/1.1 200 OK Transfer-Encoding: chunked Server: CouchDB/1.1.0a7446e91-git (Erlang OTP/R13B) Etag: "B3JLG6SIRJKRHCRNIQSEAH6GL" Date: Thu, 27 Jan 2011 14:15:25 GMT Content-Type: text/plain;charset=utf-8 Cache-Control: must-revalidate {"total_rows":3,"offset":0,"rows":[ {"id":"58fb1df368cd2f9fef8e387508001149","key":"main","value":1}, {"id":"58fb1df368cd2f9fef8e3875080012d4","key":"main","value":1}, {"id":"58fb1df368cd2f9fef8e387508000f6d","key":"soup","value":1} ]}
    • Slide 54 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Querying the View benjamin@cronos:~$ curl -i http://localhost:5984/mensaplan/_design/couchapp/_view/ dishes HTTP/1.1 200 OK Transfer-Encoding: chunked Server: CouchDB/1.1.0a7446e91-git (Erlang OTP/R13B) Etag: "B3JLG6SIRJKRHCRNIQSEAH6GL" Date: Thu, 27 Jan 2011 14:16:16 GMT Content-Type: text/plain;charset=utf-8 Cache-Control: must-revalidate {"rows":[ {"key":null,"value":3} ]}
    • Slide 55 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Querying the View: Grouping benjamin@cronos:~$ curl -i http://localhost:5984/mensaplan/_design/couchapp/_view/ dishes?group=true HTTP/1.1 200 OK Transfer-Encoding: chunked Server: CouchDB/1.1.0a7446e91-git (Erlang OTP/R13B) Etag: "B3JLG6SIRJKRHCRNIQSEAH6GL" Date: Thu, 27 Jan 2011 14:17:41 GMT Content-Type: text/plain;charset=utf-8 Cache-Control: must-revalidate {"rows":[ {"key":"main","value":2}, {"key":"soup","value":1} ]}
    • Slide 56 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Replication unidirectional or bidirectional snapshotted or continuous Watch out! conflicts possible conflict resolution necessary Multiversion Concurrency Control
    • Slide 57 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Replication — Example: Bidirectional
    • Slide 58 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Replication — Example: Master Slave Writes Reads
    • Slide 59 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Replication — Example: Peer-to-Peer
    • Slide 60 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Web Interface: Futon
    • Slide 61 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Other CouchDB Features _show _list _changes validate_doc_update
    • Slide 61 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Other CouchDB Features _show regular documents are JSON objects _show functions render other formats i.e. HTML page _list _changes validate_doc_update
    • Slide 61 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Other CouchDB Features _show _list regular view results are encoded in JSON _list functions convert results into custom formats i.e. RSS feed _changes validate_doc_update
    • Slide 61 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Other CouchDB Features _show _list _changes change notification fires on new document, updates, etc. HTTP (long) polling, continuous validate_doc_update
    • Slide 61 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Other CouchDB Features _show _list _changes validate_doc_update validation routine checks if document change is valid
    • Slide 62 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Some Interesting CouchDB Projects CouchApp CouchDB Lounge / BigCouch GeoCouch CouchDB-Lucene
    • Slide 62 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Some Interesting CouchDB Projects CouchApp standalone web applications with CouchDB CouchDB serves client-side HTML + JavaScript CouchDB Lounge / BigCouch GeoCouch CouchDB-Lucene
    • Slide 62 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Some Interesting CouchDB Projects CouchApp CouchDB Lounge / BigCouch clustering extensions proxy-based partitioning/clustering GeoCouch CouchDB-Lucene
    • Slide 62 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Some Interesting CouchDB Projects CouchApp CouchDB Lounge / BigCouch GeoCouch spatial indexes for CouchDB efficient geo-spatial queries CouchDB-Lucene
    • Slide 62 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Some Interesting CouchDB Projects CouchApp CouchDB Lounge / BigCouch GeoCouch CouchDB-Lucene full text search for CouchDB separate index based on Lucene (Java)
    • Live DemoCouchDB & Futon
    • Slide 64 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 CouchDB: Further Readings Books J. Chris Anderson; Jan Lehnardt; Noah Slater — CouchDB: The Definitive Guide (O’Reilly) Open Source Book: http://guide.couchdb.org/index.html Stefan Edlich, Achim Friedland, Jens Hampe, Benjamin Brauer — NoSQL (HANSER Verlag) Websites http://nosqltapes.com http://www.couchone.com/get
    • Slide 65 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Discussion Thanks for your attention. Any questions?
    • Slide 66 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 License Slides incorporate contents form. . . picol.org flickr.com/photos/daveaustria flickr.com/photos/bdesham github.com/oreilly/couchdb-guide
    • Backup Slides
    • Slide 68 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Distributed Systems – Motivation single computer limited resources limited computing power limited storage single point of failure
    • Slide 69 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Distributed Systems – Motivation many computers more resources more computing power more storage non-functional benefits (i.e. fault-tolerance)
    • Slide 69 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Distributed Systems – Motivation many computers more resources more computing power more storage non-functional benefits (i.e. fault-tolerance) but also more complex systems more sources of trouble
    • Slide 70 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Distributed Systems – Different Approaches environments distributed operating systems middleware systems standalone applications ... interaction models shared memory request/reply message-based ...
    • Slide 71 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Distributed Systems – Some Requirements identifiers for resources (what?) location/naming services (where?) communication services/protocols (how?) software support (how to use?)
    • Slide 72 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 Historical Approach: RPC Remote Procedure Calls add(1,2); add(1,2) A B 1+2=3 return 3 Examples: Sun RPC (NFS)
    • Slide 73 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 CouchDB: MVCC / Conflicts Source: CouchDB — The Definitive Guide
    • Slide 73 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 CouchDB: MVCC / Conflicts Source: CouchDB — The Definitive Guide
    • Slide 73 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 CouchDB: MVCC / Conflicts Source: CouchDB — The Definitive Guide
    • Slide 73 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 CouchDB: MVCC / Conflicts Source: CouchDB — The Definitive Guide
    • Slide 73 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 CouchDB: MVCC / Conflicts Source: CouchDB — The Definitive Guide
    • Slide 73 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 CouchDB: MVCC / Conflicts Source: CouchDB — The Definitive Guide
    • Slide 73 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 CouchDB: MVCC / Conflicts Source: CouchDB — The Definitive Guide
    • Slide 73 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 CouchDB: MVCC / Conflicts Source: CouchDB — The Definitive Guide
    • Slide 74 Introduction to REST & CouchDB | Web Engineering WS10/11 | Benjamin Erb | 28.01.2011 CouchDB: Append-only B+ Tree Source: CouchDB — The Definitive Guide