incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zachary Zolton <zachary.zol...@gmail.com>
Subject Re: triggering all (necessary) view update
Date Fri, 29 Apr 2011 19:31:02 GMT
Since CouchDB updates all views in the same design doc at the same
time, you only have to query a row from one view per design doc to
update the view indexes.

On Fri, Apr 29, 2011 at 1:34 PM, Mage <mage@mage.hu> wrote:
>
>            Hello,
>
> there should be a way to trigger an update on all views in a database.
>
> I imagine a master-slave setup for a website. There can be one or
> several slaves.
>
> The code for the website gets updated. So do the views. (For example,
> couchrest_model updates the view functions on every little code change).
>
> Putting the new design documents to the master causes a big read-delay
> on all the slaves while they are rebuilding the b-trees from scratch.
>
> I would put the new design documents to a slave, let it rebuild the
> views (the ones which were changed) then replicate the design document
> changes to the master. This way the clients can read the other slaves or
> the master while the updated slave rebuilds. After that the updated
> slave can serve the clients while the others are rebuilding b-tress. No
> delay.
>
> I suppose that I can write a short script that finds all the views in a
> database and asks one document from each, however it is not as elegant
> as having a request which does the same.
>
>        Mage

Mime
View raw message