couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cameron Jacobson <>
Subject Re: best way to "warm" views offline
Date Sun, 18 Aug 2013 08:29:29 GMT
Right, I get all that.  But I've always imagined ideally my app would be
serving requests while the new index is building.  Once the new index is
built, then I deploy my new version of the app and "flip the switch" so
that now my app is serving off of the newly indexed views.

One way I've anticipated doing this is by versioning the design document
(ie. _design/version1, _design/version2).  But more interested in best
practices here.


On 08/16/2013 06:57 PM, Filippo Fadda wrote:
> You can only "warm up" your views querying them. You can use cURL from your command line.
This will cause the creation of an index file per design document. This index file is updated
each time another query is made on a view defined inside the design document. A view is never
updated when you insert a document, but when you query the view itself. For performance reasons
you can choose to avoid the index update when you query a view, but the results will not include
the documents inserted since last query. Anyway you must force this behavior using a query
parameter. The index creation requires time, but the index update is generally fast enough.
> So, the best approach is querying all the views when you deploy the application, because
indexing is a slow process. You can do that with a bash script. Eventually, you can query
multiple views at the same time, so you can benefit of a multi-core architecture.
> -Filippo
> On Aug 16, 2013, at 5:33 PM, Cameron Jacobson wrote:
>> What is the best way to "warm" views offline?  Also, if possible, can
>> you explain the mechanics that CouchDB uses in order to "know" that a
>> given view is or isn't new?  In other words, when deploying an updated
>> design document how would the server go about determining whether a
>> given view within that design document is different or not?  Is it
>> through hashing?  Or do all views within the design document require a
>> pre-deployment query?
>> None of my datasets have ever really been big enough to required offline
>> prepping of views, but I'm anticipating this will change soon so I want
>> to make sure I'm using best practices when I'm ready to make this change
>> to my deployment process.
>> Thanks

View raw message