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 2009/05/04 22:08:15 UTC

[Couchdb Wiki] Update of "HTTP Document API" by ChrisAnderson

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 ChrisAnderson:
http://wiki.apache.org/couchdb/HTTP_Document_API

The comment on the change is:
document batch=ok

------------------------------------------------------------------------------
  
  {"error":"conflict","reason":"Document update conflict."}
  }}}
+ 
+ There is a query option ''batch=ok'' which can be used to achieve higher throughput at the cost of lower guarantees. When a ''PUT'' (or a document ''POST'' as described below) is sent using this option, it is not immediately written to disk. Instead it is stored in memory on a per-user basis for a second or so (or the number of docs in memory reaches a certain point). After the threshold has passed, the docs are committed to disk. Instead of waiting for the doc to be written to disk before responding, CouchDB sends an HTTP ''202 Accepted'' response immediately. 
+ 
+ ''batch=ok'' is not suitable for crucial data, but it ideal for applications like logging which can accept the risk that a small proportion of updates could be lost due to a crash. Docs in the batch can also be flushed manually using the ''_ensure_full_commit'' API.
  
  === POST ===