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 2011/04/02 16:29:48 UTC

[Couchdb Wiki] Update of "How_to_deploy_view_changes_in_a_live_environment" by HenrikHofmeister

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

--------------------------------------------------

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: ==

'''Example:'''
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'''