Name Last modified Size Description
Parent Directory - demo.rb 2007-09-08 09:12 2.0K couchdb.rb 2007-09-08 07:11 1.8K Employee.sql 2007-09-07 18:36 41K
The demo denormalizes this data and loads it into a CouchDB mock-up, defines a map-reduce view over the data, fetches one page of the output, updates a record, and refetches that same page. This demonstrates incremental and continuous updates of a view defined using both map and reduce functions.
To execute the demo, simply run ruby demo.rb
.
A few notes: the evaluation of reduce could be defered until the first time the page is fetched. It could even be called on every GET. Either way, last modified/ETag data could be associated with each entry in the reduce_input data structure, and the results would play nice with HTTP's caching infrastructure...
In this mock-up deletes are not fleshed out, but essentially are the same as update, but with new_map=[].
Attribution: Employee.sql was extracted from here:
http://www.oracle.com/technology/tech/xml/xdk_sample/EmployeeInformationSample.html