You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by Apache Wiki <wi...@apache.org> on 2008/07/13 18:45:37 UTC

[Couchdb Wiki] Update of "FrequentlyAskedQuestions" by JanLehnardt

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The following page has been changed by JanLehnardt:
http://wiki.apache.org/couchdb/FrequentlyAskedQuestions

------------------------------------------------------------------------------
  
  CouchDB's data model and internal API map the REST/HTTP model so well that any other API would basically reinvent some flavour of HTTP. Since that makes little sense, there's only the HTTP API.
  
+ == I want to update my view indexes more often than only when a user reads it. How do I do that best? ==
+ 
+ To get on write view update semantics, you can write a little daemon
+ script that runs alongside CouchDB and is specified in couch.ini
+ as DbUpdateNotificationProcesses. This deamon gets sent a 
+ notification each time the database is changed and could in turn
+ trigger a view update every N document inserts or every Y seconds,
+ whichever occurs first. The reason not to integrate each doc as
+ it comes in is that it is horribly inefficient and CouchDB is designed
+ to do view index updates very fast, so batching is a good idea.
+ 
+ To get a list of all views in a database, you can do a 
+ GET /db/_all_docs?startkey=_design/&endkey=_design/ZZZZ
+ (we will have a /db/_all_design_docs view to make the ZZZZ-hack
+ go away).
+ 
+ That should solve your problem.
+ 
+ Yes, such a daemon should be shipped with CouchDB, but we
+ haven't got around to work on the deployment infrastructure yet.
+ Any contributions to this are very welcome. I think the developer's
+ choice of language for helper scripts is Python, but any will do,
+ whatever suits you best.
+