couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Couchdb Wiki] Update of "How_to_deploy_view_changes_in_a_live_environment" by HenrikHofmeister
Date Sat, 02 Apr 2011 14:29:48 GMT
Dear Wiki user,

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

The "How_to_deploy_view_changes_in_a_live_environment" page has been changed by HenrikHofmeister.


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

== Background information: ==
CouchDb places view generated data in files named based on the design docs contents (not name,
id, revision). This means that 2 design docs with identical contents will share view files.

== Approach: ==

http://localhost:5984/mydb/_design/users needs to be updated with a new view

So the simple approach is:
 1. Upload the updated design doc to _design/users_tmp
 2. query the new views (to trigger generation)
 3. when generation is complete - copy _design/users_tmp to _design/users. This will cause
the already built index to be shared by the 2 views.
 4. delete _design/users_tmp at your discretion (or keep it in place for the next release)

To copy a document use:
 curl -X COPY <url to source> -H "Destination: <url to dest>"

So for our example it would be
 curl -X COPY http://localhost:5984/mydb/_design/users_tmp -H "Destination: http://localhost:5984/mydb/_design/users"

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

View raw message