Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 10998 invoked from network); 3 Dec 2008 23:17:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Dec 2008 23:17:29 -0000 Received: (qmail 93883 invoked by uid 500); 3 Dec 2008 23:17:40 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 93850 invoked by uid 500); 3 Dec 2008 23:17:40 -0000 Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-user@incubator.apache.org Delivered-To: mailing list couchdb-user@incubator.apache.org Received: (qmail 93839 invoked by uid 99); 3 Dec 2008 23:17:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Dec 2008 15:17:40 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of antony.blakey@gmail.com designates 209.85.198.240 as permitted sender) Received: from [209.85.198.240] (HELO rv-out-0708.google.com) (209.85.198.240) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Dec 2008 23:16:10 +0000 Received: by rv-out-0708.google.com with SMTP id k29so4491975rvb.0 for ; Wed, 03 Dec 2008 15:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=vZw1weGmp83j1bmsqWrChWd9F2DFu+CR3eEr4ZjO0eA=; b=oBAKZZkKPJp8hn3tfI9KzRkiZz+4Fm1Cj6wK+lbIfoWV0mUzsdUkZ3ZBPjbSThcjE8 5OcXgNL4IA2pLtFzJHTbnSoOZU9ZfdDiS4eCotCgQ/RS82aeCxU0occnJAzU7TzD59l3 ljMGa+y2f06pzstRxQc4n67ZtN57uKn6ZEjZ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=WqK/V5Il6NETbPd6c+UlNuFU00NsnLdwSwoKTbhhBvxJY0rWpEx/Mq9y/iW6Icnd/3 mUJXGQq1q0hhzbkxbncOznyOQjBrdug+Ut39YcVkjEgv1LBv7TqBLoKL4pl7CCFU14vk prfRl+J6xgzw1Sp+10l2JR+XhW21zCiVciw1I= Received: by 10.140.202.21 with SMTP id z21mr6572713rvf.68.1228346208808; Wed, 03 Dec 2008 15:16:48 -0800 (PST) Received: from ?192.168.0.16? (ppp121-45-41-103.lns10.adl2.internode.on.net [121.45.41.103]) by mx.google.com with ESMTPS id k41sm6215535rvb.4.2008.12.03.15.16.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Dec 2008 15:16:48 -0800 (PST) Message-Id: From: Antony Blakey To: couchdb-user@incubator.apache.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Re: Auto-adding additional fields on PUT/POST? (datetime stamps) Date: Thu, 4 Dec 2008 09:46:43 +1030 References: <53b9568a0812010829n49ce2eebl89419e5db0b536a4@mail.gmail.com> <493487C8.5060206@silencegreys.com> <53b9568a0812011907u25e99f06s7ee1c036356942df@mail.gmail.com> <4934EB71.3050500@silencegreys.com> <53b9568a0812030100n6896fe38q515b5427512245a4@mail.gmail.com> <6E4052ED-1125-4542-977A-0721177D5820@gmail.com> X-Mailer: Apple Mail (2.929.2) X-Virus-Checked: Checked by ClamAV on apache.org On 04/12/2008, at 9:31 AM, Chris Anderson wrote: > On Wed, Dec 3, 2008 at 2:50 PM, Antony Blakey > wrote: >> >> On 04/12/2008, at 9:07 AM, Chris Anderson wrote: >> >>> It should just be clear that timestamps are the application's >>> business, not the database's. >> >> But it's possible for Couch to be the application, especially if >> you use >> your apps-in-the-db approach. I'm not sure I see any fundamental >> difference >> between a validation function in a design document and some >> javascript in an >> attachment, of even a function inan _external handler. >> > > The problem with writing from the validation functions is that you are > supposed to be able to trust them. Eg, if you look at the function, > you can know what contract holds on the data that passes through it. A > timestamp on new docs doesn't pass this test. There's no way to know > whether the timestamp was added by a different function. With proper > pass/fail validations, you know that running the same validations at > replication time will give the same pass/fail result as at original > write time. IIUC, replication conflicts in a P2P configuration allow for a situation where even a validator that is purely funtional wrt the database state can generate different results upon replication. Or maybe I'm missing something? Antony Blakey ------------- CTO, Linkuistics Pty Ltd Ph: 0438 840 787 A reasonable man adapts himself to suit his environment. An unreasonable man persists in attempting to adapt his environment to suit himself. Therefore, all progress depends on the unreasonable man. -- George Bernard Shaw