• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
HTTP API for Free? Check out CouchDB
 

HTTP API for Free? Check out CouchDB

on

  • 2,635 views

Presentation on CouchDB and its usage at VPRO. Given at Magnolia Conference 2010 in Basel and NoSQL-NL Meetup #4 at VPRO in Hilversum.

Presentation on CouchDB and its usage at VPRO. Given at Magnolia Conference 2010 in Basel and NoSQL-NL Meetup #4 at VPRO in Hilversum.

Statistics

Views

Total Views
2,635
Views on SlideShare
2,477
Embed Views
158

Actions

Likes
4
Downloads
28
Comments
0

5 Embeds 158

http://weblogs.vpro.nl 96
http://www.nosqldatabases.com 37
https://infohubble.jira.com 16
http://confluence.infohubble.com 5
http://192.168.12.125 4

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

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
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

HTTP API for Free? Check out CouchDB HTTP API for Free? Check out CouchDB Presentation Transcript

  • HTTP API for Free? Check out CouchDB Nils Breunese, VPRO N.Breunese@vpro.nl @breun
  • HTTP API HTTP is simple Every OS and programming language supports HTTP Lots of tooling available: proxying, caching, monitoring, etc. “Cool! So, how do I get one for my data?”
  • DIY?
  • Relax!
  • Apache CouchDB Document-oriented database Built-in HTTP server Map/Reduce Replication Written in Erlang, fast and reliable
  • CAP Theorem Consistency: all nodes see the same data at the same time Availability: node failures do not prevent survivors from continuing to operate Partition tolerance: the system continues to operate despite arbitrary message loss Choose any two; you can’t have all three
  • Eventual Consistency Consistency Partition Availability tolerance
  • CouchDB at VPRO - Broadcasts - Trailers - Clips Supplier 1 - Trailers - Etc. Media Supplier 2 Service Websites Etc. CouchDB ActiveMQ CouchDB Apps Twitter Publisher Mashup Etc. Flickr Harvester Etc. - Articles - Photos - Tweets - News - Etc.
  • Document
  • What’s a Document? JSON Schemaless Attachments
  • HTTP Document API Create POST /db Read GET /db/id Update PUT /db/id Delete DELETE /db/id (Also: HTTP Bulk Document API)
  • Views {“_id”: “myid1”, keywords: [“foo”,”bar”], title: “title1”, ...} {“_id”: “myid2”, keywords: [“foo”,”baz”], title: “title2”, ...} docs function(doc) { {key: “foo”, value: “title1”} doc.keywords.forEach(function(keyword) { {key: “foo”, value: “title2”} emit(keyword, doc.title); {key: “bar”, value: “title1”} }); {key: “baz”, value: “title2”} } map _count reduce {key: “foo”, value: 2} {key: “bar”, value: 1} {key: “baz”, value: 1}
  • Performance Append-only B-trees (crash proof) Views are pre-calculated indexes Incremental map/reduce Trade disk space for performance Very low RAM usage
  • HTTP View API /{db}/_design/{ddoc}/_view/{view_name} Query parameters: key=”foo” startkey, startkey_docid, endkey, endkey_docid limit, descending, skip, group, group_level, reduce /db/_design/unconf/_view/by_keyword?key=”foo”
  • Using the API Client-side: AJAX from browser (JSONP support in CouchDB) Invisible for search engines Server-side You can use a library like jcouchdb Indexable!
  • Formatting Data Show function: transform a document into... SVG, HTML, MP3, etc. List function: transform a view result RSS, etc.
  • Next Episode
  • Media Archive
  • Mashups
  • Public API Rewrite handlers for prettier URL’s API keys, monitoring, etc.? You might need an extra layer
  • CouchApp Replicatable HTML/JavaScript application Without any middleware! CouchApp tool to manage design documents
  • More CouchDB Website: http://couchdb.apache.org/ Book: http://guide.couchdb.org/ BigCouch: sharding GeoCouch: support for geospatial queries couchdb-lucene: full-text indexing and querying Myriad third-party libraries
  • VPRO Digital http://weblogs.vpro.nl/digitaal/ (Dutch)