Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
None
-
None
-
None
Description
It can take a very long time to generate views for a large database. If you have an application that relies on those views, even if performance is acceptable, it is generally a serious problem if something causes the views for that design doc to no longer be available. This gets especially tricky if a new view is added or modified, as then all view data is thrown away and regenerated, causing your website or app to be unavailable for hours at a time.
To work around this problem, I've taken to the following work flow:
1. PUT the new design doc to /db/_design/scratch
2. Load a view from /db/_design/scratch
3. Once view generation on _design/scratch finishes, send an http COPY request to move the _design/scratch to _design/app.
This mostly works pretty well. However, if you have jobs that copy couchdb documents from one place to another, it can be very easy to accidentally trigger a view regeneration and cause your website or app to go down. (Qv today's npmjs.org outage.)
I would love it if there was a way to say, "NEVER make the views of _design/app unavailable, even if they are temporarily out of date". I can imagine a few ways that this could be accomplished:
1. PUTs to the specified design doc fail if they modify the "views" member.
2. COPYs to the specified design doc fail if the COPY source does not have a full set of pre-generated views.
3. Views for the specified design doc are always done in the background, and stale=ok is assumed for all requests.