We have a new wiki. The migration is not 100% complete. You can help out by moving pages across. This wiki will exist for as long as there are pages left.

The official documentation has moved to http://docs.couchdb.org — The transition is not 100% complete, but http://docs.couchdb.org should be seen as having the latest info. In some cases, the wiki still has some more or older info on certain topics inside CouchDB.

You need to be added to the ContributorsGroup to edit the wiki. But don't worry! Just email any Mailing List or grab us on IRC and let us know your user name.

When needing to upload changes to an existing design document, to avoid having everything hang for potentially hours while generating the views - follow the descriptions below:

Background information:

CouchDB view index filenames are based on the contents of the design document (not its name, ID or revision). This means that two design documents with identical view code will share view index files.


Example: http://localhost:5984/database/_design/ddoc needs to be updated

So the simple approach is:

  1. Upload the old design doc to _design/ddoc-old (or copy _design/ddoc to _design/ddoc-old) if you want an easy way to rollback in case of problems. This will cause the view indexes for _design/ddoc to be shared with _design/ddoc-old.

  2. Upload the updated design doc to _design/ddoc-new.

  3. Query a view in _design/ddoc-new to trigger view index generation. You can track the indexing progress via Futon at http://localhost:5984/_utils/status.html or by requesting http://localhost:5984/_active_tasks directly.

  4. Reupload the updated design doc to _design/ddoc (or copy _design/ddoc-new to _design/ddoc) when view index generation is complete. This will cause the indexes built for _design/ddoc-new to be shared with _design/ddoc. The updated design doc is now live with view indexes ready to go!

  5. Delete _design/ddoc-new and/or _design/ddoc-old at your discretion. Don't forget to also run a clean-up to reclaim the disk space used by their view indexes: http://wiki.apache.org/couchdb/HTTP_view_API#View_Cleanup

To copy a document use:

When copying a document to an already existing destination, you'll also need to supply the revision of the document you want to overwrite:

Example: copy http://localhost:5984/database/_design/ddoc to http://localhost:5984/database/_design/ddoc-old:

Note: This approach will work for normal couch views, couchdb-lucene views (fulltext), and should also work for bigcouch clusters - to my understanding

How_to_deploy_view_changes_in_a_live_environment (last edited 2011-12-07 12:27:25 by NilsBreunese)