Devs, One of the longstanding issues with CouchDB has been, how to handle changes in view definitions.
If you are exposing CouchDB view URLs to end users, you don't have the luxury of controlling where applications query, so using a version number in the design doc name is not feasible. The work around I came up with in the last couple of days (no patch, just an idea) is to continue to maintain and serve the existing view index, while the index for the new view definitions comes up to date. (For apps that can't accept this relaxed guarantee, we could have an X-Couch-Wait-For-Latest-View=true header.) The edge case that I'd like to get right, before implementing, is that you may be rolling out other code in the design doc, that depends on the the new view. To get this really slick, we'd want to continue to serve the old design docs attachments, lists, validations, shows, etc., until the new view is ready for queries. That way all the code rolls over at the same time, when the new views are ready. Getting this right is not impossible but will require some thinking. Particularly we want to avoid serving old design docs when the changes don't effect the view index. Also compacting away the old design doc, could be a nasty surprise. I think there could be a big usability payoff here if we get this right - feedback welcome. Chris -- Chris Anderson http://jchris.mfdz.com
