couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Anderson" <jch...@grabb.it>
Subject Re: when to use another document and when not to?
Date Wed, 06 Aug 2008 20:01:54 GMT
On Wed, Aug 6, 2008 at 12:50 PM, Sho Fukamachi <sho.fukamachi@gmail.com> wrote:
>
> Chris, what did you think about my idea of attaching/making available _rev
> information for views?
>
> Basically if we could get a _rev for every key-value output, could get an
> array of them (however massive) for the "root" of a particular view, and a
> "top" _rev for the view, it would make tracking changes much easier. I have
> been messing around and think it would be pretty easy to make a decent
> "sync" for remapping purposes if that info was available.

I think that it's a feasible way to start down the path... I'd be
curious to see what Damien thinks - he may have an eye on how to do
this in a way that could eventually be used to support remapping
natively.

My first idea of how to do this was with an event system. If there was
a way to "subscribe" to changes in a view (and which key they effect)
you could use it to mark parts of the remap index as dirty. Then to
regenerate you'd only have to recalculate the dirty parts (and also
any keys in the view which aren't in the remap - making that search
efficient might be problematic).

The event system could be prototyped by eavesdropping on the
communication between CouchDB and the view server, and firing events
based on the emitted keys.

-- 
Chris Anderson
http://jchris.mfdz.com

Mime
View raw message