Your SlideShare is downloading. ×
0
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Rotterdam.php CouchDB
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Rotterdam.php CouchDB

2,630

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,630
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
55
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. CouchDB relax
  • 2. CouchDB relax Sander van de Graaf svdgraaf
  • 3. RELAX...
  • 4. PERFORM LIKE A PR0N STAR
  • 5. TOPICS • NoSQL • CouchDB in a nutshell • Querying • map/reduce • Fulltext search • CouchApps
  • 6. NOSQL
  • 7. IT’S A MOVEMENT
  • 8. 1998
  • 9. Carlo Strozzi
  • 10. NOSQL == Not Only SQL
  • 11. “[The NoSQL movement] departs from the relational model altogether, it should therefore have been called more appropriately ‘NoREL’, or something to that effect.” - Carlo Strozzi
  • 12. LANDSCAPE
  • 13. DISTRIBUTED VS NON-DISTRIBUTED Distributed Non distributed Amazon Dynamo Redis Amazon S3 Tokyo Tyrant Scalaris MemcacheDb CouchDB Amazon SimpleDb Voldemort Riak MongoDb BigTable Cassandra HyperTable HBase source: Vineet Gupta http://bit.ly/5kuQgB
  • 14. DATAMODEL STORAGE Key/Value Document Column Amazon Dynamo Amazon SimpleDb Cassandra Amazon S3 CouchDB Google BigTable Redis MongoDb HBase Scalaris Riak Hyperbase Voldemort
  • 15. STORAGE Memory Configurable Disk Scalaris BigTable CouchDB Redis Cassandra MongoDb Hbase Riak HyperTable Voldemort
  • 16. CouchDB relax
  • 17. JAVASCRIPT
  • 18. NUTSHELL
  • 19. SPEED
  • 20. APPEND ONLY
  • 21. NO REPAIR NEEDED
  • 22. COMPACTING
  • 23. HTTP SERVER
  • 24. CAP
  • 25. CouchDB CAP
  • 26. CouchDB EVENTUALLY CONSISTENT
  • 27. ALLTHINGSDISTRIBUTED.COM
  • 28. FULL REST API
  • 29. REST • GET • SELECT • PUT • UPDATE • POST • INSERT • DELETE • DELETE • COPY • ...
  • 30. JSON { total_rows: 2, offset: 0, rows: [ { id: '_design/foobar', key: '_design/foobar', value: { rev: '5-982b2fc36835715b2aae54609b5d5f1e' } }, { id: 'f0e1fd96eb6e094f74dda8d949000a6a', key: 'f0e1fd96eb6e094f74dda8d949000a6a', value: { rev: '1-86bca407fce8234a63c90ff549b56b10' } }, ] }
  • 31. REPLICATION
  • 32. CouchDB relax
  • 33. CouchDB relax CouchDB relax
  • 34. CouchDB relax CouchDB relax CouchDB relax CouchDB relax
  • 35. CouchDB relax CouchDB relax
  • 36. CouchDB relax CouchDB relax CouchDB relax
  • 37. Laptop Desktop CouchDB relax CouchDB relax Phone CouchDB relax
  • 38. US NL CouchDB relax CouchDB relax CouchDB relax
  • 39. IDG US IDG AUSTRALIA CouchDB relax CouchDB relax CouchDB relax CouchDB relax CouchDB relax CouchDB relax CouchDB relax CouchDB relax CouchDB relax IDG NL IDG DE
  • 40. IDG US IDG Australia IDG Poland IDG Romania CouchDB relax CouchDB relax CouchDB relax CouchDB relax CouchDB CouchDB CouchDB relax CouchDB relax CouchDB relax relax relax IDG NL IDG UK IDG Spania IDG Portugal CouchDB relax CouchDB relax CouchDB CouchDB CouchDB CouchDB relax relax relax relax IDG Germany IDG Brasil IDG Ghana IDG Hungary CouchDB relax CouchDB relax CouchDB relax CouchDB CouchDB relax relax IDG India IDG Thailand IDG Japan IDG Vietnam CouchDB relax CouchDB relax CouchDB relax CouchDB relax CouchDB relax CouchDB relax
  • 41. P2P WEB
  • 42. QUERYING
  • 43. SELECT * FROM documents WHERE id = 123 GET /documents/123
  • 44. SELECT * FROM documents WHERE id = 123 GET /documents/123 PUT /documents/123 POST /documents/123 DELETE /documents/123 etc.
  • 45. MAP/REDUCE
  • 46. INPUT IP Bytes 212.122.174.13 18271 212.122.174.13 191726 212.122.174.13 198 74.119.8.111 91272 74.119.8.111 8371 212.122.174.13 43
  • 47. MAPPER => REDUCER IP Bytes 18271 191726 212.122.174.13 198 43 91272 74.119.8.111 8371
  • 48. AFTER REDUCE IP Bytes 212.122.174.13 210238 74.119.8.111 99643
  • 49. MAP/REDUCE SELECT COUNT(foo) FROM documents WHERE 1 GROUP BY foo;
  • 50. MAP/REDUCE
  • 51. MAP/REDUCE function(doc) { emit(doc.foo, doc); }
  • 52. MAP/REDUCE
  • 53. MAP/REDUCE function(keys, values, rereduce) { return sum(values); }
  • 54. MAP/REDUCE
  • 55. COUCHDB-LUCENE http://github.com/rnewson/couchdb-lucene
  • 56. CONFIG [external] fti=/path/to/python /path/to/couchdb-lucene/tools/couchdb-external-hook.py [httpd_db_handlers] _fti = {couch_httpd_external, handle_external_req, <<"fti">>}
  • 57. http://127.0.0.1:5984> GET /foobar/_design/foobar
  • 58. _DESIGN { _id: '_design/foobar', _rev: '8-03a6bc983c721b1cc0ae4b461326bc31', language: 'javascript', views: { foo: { map: 'function(doc) {n emit(doc.foo,1);n}', reduce: 'function(keys, values, rereduce) {return sum(values);}' } } }
  • 59. _DESIGN { _id: '_design/foobar', _rev: '8-03a6bc983c721b1cc0ae4b461326bc31', language: 'javascript', views: { foo: { map: 'function(doc) {n emit(doc.foo,1);n}', reduce: 'function(keys, values, rereduce) {return sum(values);}' } }, fulltext: { by_subject: { index:"function(doc) { var ret=new Document(); ret.add (doc.subject); return ret }" }, } }
  • 60. _DESIGN function(doc) { var ret=new Document(); ret.add(doc.subject); return ret }
  • 61. _DESIGN function(doc) { var result = new Document(); result.add(doc.subject, {"field":"subject", "store":"yes"}); result.add(doc.content, {"field":"subject"}); result.add(new Date(), {"field":"indexed_at"}); return result; }
  • 62. http://127.0.0.1:5984> GET /foobar/_fti/_design/foo/by_subject?q=foobar
  • 63. http://127.0.0.1:5984> GET /foobar/_fti/_design/foo/by_subject?q=foobar
  • 64. COUCHAPPS http://github.com/couchapp/couchapp
  • 65. “Distributed, scalable, web applications you say? omgwtfbbq!?!1!!!11!1!eleven”
  • 66. _attachments
  • 67. CouchDB relax CouchDB relax CouchDB relax
  • 68. COUCHAPP PUSH HTTP://LOCALHOST:5984/MYDB
  • 69. LISTS http://127.0.0.1:5984> GET /relax/_design/relax/_list/posts/all/foobar HTTP/1.1 200 OK Vary: Accept Transfer-Encoding: chunked Server: CouchDB/0.11.0 (Erlang OTP/R13B) Etag: "DZZ19EPLWLHI89K1FOW9DGFT5" Date: Sun, 11 Jul 2010 09:55:42 GMT Content-Type: text/html <h1>ponies</h1><p>rock!</p>
  • 70. CouchDB relax
  • 71. CouchDB relax
  • 72. COUCHDBX http://janl.github.com/couchdbx/
  • 73. Q?

×