couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Anderson" <>
Subject Re: Auto-adding additional fields on PUT/POST? (datetime stamps)
Date Wed, 03 Dec 2008 04:42:33 GMT
On Tue, Dec 2, 2008 at 12:01 AM, Jedediah Smith
<> wrote:
> If validations could write, they could serve as a complete data access
> layer. They could handle meta data generation, merging, encapsulation (aka
> implementation hiding/abstraction/conversion) and essentially solve the
> partial update problem.

I think I've had a change of heart. Damien argues that people would
use validation-writes to generate timestamps. But the timestamps can
be wrong/faked (on remote nodes) and there's no way to validate (on
replication) that they are correct. So putting stamp-capability into
the validation functions would setup false expectations. Apparently it
caused all sorts of trouble in Notes.

This is an instance of a broader distributed computing axiom: no global clock.

> If merges could be handled by script functions, two-way replication could be
> completely autonomous. Plus, sloppy developers would be more likely to
> actually handle revision conflicts instead of just ignoring them.

It might be best to save this action for the end of replication, as
replication could apply more than one replicated rev per document. It
would be nice to have a place in design docs for replication conflict
revision, but I don't think validation is that place.

> Why not just provide hooks to every part of CouchDB?

I think the important thing to do is design them in such a way as to
give developers the flexibility they need while maintaining the right
expectations about what a distributed database can offer.

That said, there is a lot of work to add really cool hooks into
CouchDB. One of the most exciting prospects is Comet requests, where
you could do a POST to /db/_since_seq?seq=300 and wait for a response
until the next change after the last change that you knew about

Chris Anderson

View raw message