couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Blakey <>
Subject Re: Proposal: Extending immutability
Date Mon, 05 Jan 2009 22:25:25 GMT

On 06/01/2009, at 5:51 AM, Chris Anderson wrote:

> Currently you have the freedom to add the rev to the value if you need
> it. I think we can get the semantics you desire without adding more
> fields to the view results.

But then you need to get the view value rather than just the row  
metadata. I propose including the rev in the view result row so that  
it appears even if the value doesn't. Furthermore it means that you  
can write (third-party) generic interposition software without  
requiring that your views have a certain value structure.

> On the "roadmap", and actually within striking distance, it is planned
> that CouchDB will return Etags with view responses. We could throw all
> the information needed to calculate an Etag into the response JSON
> (and there might be other compelling reasons to do so) but for the
> sake of caching, I think getting the Etags right is the thing to
> concentrate on.

I disagree - etags is a property of the transport protocol, and is at  
the wrong granularity. If all but one document in the view result  
hasn't changed then a transparent document cache would have no way of  
knowing if all of the documents have changed or just one. This affects  
memoization, which isn't based on view window requests.

> I think that with proper use of Etags, the JSON content of the views
> becomes irrelevant for their cacheability.

But I'm suggesting per-document / pre-view-row immutable-value- 
identity, which is quite different than per-view-window caching.

This isn't just about caching - I'm suggesting the adoption of a  
theoretical model that will have benefits both immediately obvious,  
and not yet evident.

Antony Blakey
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

It is no measure of health to be well adjusted to a profoundly sick  
   -- Jiddu Krishnamurti

View raw message