couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Couchdb Wiki] Update of "FUQ" by DaveCottlehuber
Date Sat, 10 Dec 2011 20:25:32 GMT
Dear Wiki user,

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

The "FUQ" page has been changed by DaveCottlehuber:

notes on bulkdocs, uuid advantages

  == Documents ==
   1. Why should I generate my own UUIDs?
+     While CouchDB will generate a unique identifier for the _id field of any doc that you
create, there are three reasons why you are in most cases better off generating them yourself.
+    * If for any reason you miss the 200 OK reply from CouchDB, and storing the document
is attempted again, you would end up with the same document content stored under duplicate
_ids. This could easily happen with intermediary proxies and cache systems that may not inform
developers that the failed transaction is being retried.
+    * _ids are are the only unique enforced value within CouchDB so you might as well make
use of this.
+    * CouchDB stores its documents in a B+ tree. Each additional or updated document is stored
as a leaf node, and may require re-writing intermediary and parent nodes. You may be able
to take advantage of sequencing your own ids more effectively than the automatically generated
ids if you can arrange them to be sequential yourself.
   1. What is the benefit of using the _bulk_docs API instead of PUTting single documents
to CouchDB?
+     Aside from the HTTP overhead and roundtrip you are saving, the main advantage is that
CouchDB can handle the B tree updates more efficiently, decreasing rewriting of intermediary
and parent nodes, both improving speed and saving disk space. _bulk_docs also allows you to
treat multiple documents in a single phase, either applying all or none of them if so chosen.
   1. Why can't I use MVCC in CouchDB as a revision control system for my docs?
  == Replication ==

View raw message