Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 26659 invoked from network); 1 Jan 2009 00:40:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Jan 2009 00:40:55 -0000 Received: (qmail 89965 invoked by uid 500); 1 Jan 2009 00:40:54 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 89925 invoked by uid 500); 1 Jan 2009 00:40:53 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 89914 invoked by uid 99); 1 Jan 2009 00:40:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Dec 2008 16:40:53 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of antony.blakey@gmail.com designates 209.85.198.229 as permitted sender) Received: from [209.85.198.229] (HELO rv-out-0506.google.com) (209.85.198.229) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jan 2009 00:40:44 +0000 Received: by rv-out-0506.google.com with SMTP id g37so5603727rvb.35 for ; Wed, 31 Dec 2008 16:40:23 -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=ujON9tVDlHyAhW+dU2yx5eGhWJad+EdUAdTJ5LdA+sE=; b=iopUsMAvOD9JtgZcysvpidGmRrKvoosYCyNIIP1ybEnTNDD5fZ3gmoa4G8rGsezUpE hvzPZGJ8KWkDkn3glxdDhH1lbtJ7+o6ExZhkaVeifl+mcf+FV7ZI0icaQukgtLN8/h4B tFdL+ZyTtg8b6kBelAgXsjWBwB1MAmwv2y35M= 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=XomzzDd1nMuTHdiJ7k/u/RD57Fwnq/XMdcDl+FUmDaKQ3TS+rZMfRig1NxM8CV14AL 8eDMEvfbmYCgeqkLqhZjdqtQGuy80ZnDUV0jQOggwb9daXJ3y7Ls1Op+Ls+rW2iUpMSF MTSgVfMRjybywxG5dZNmJCweq8TMlAr0Cx4Eo= Received: by 10.141.122.1 with SMTP id z1mr8049540rvm.210.1230770423166; Wed, 31 Dec 2008 16:40:23 -0800 (PST) Received: from ?192.168.0.16? (ppp121-45-96-203.lns10.adl6.internode.on.net [121.45.96.203]) by mx.google.com with ESMTPS id l31sm41584904rvb.2.2008.12.31.16.40.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 31 Dec 2008 16:40:22 -0800 (PST) Message-Id: From: Antony Blakey To: user@couchdb.apache.org In-Reply-To: <48250456-2512-46BD-85E1-464457DBC995@pobox.com> 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: Changing rev to _rev in view results (Was: Re: newbie question #1) Date: Thu, 1 Jan 2009 11:10:17 +1030 References: <98979283-BB61-4D15-AF05-196979FA42BC@pobox.com> <49C5583B-254D-4D4D-A4F7-AD7306E758F1@gmail.com> <8A2A146E-F011-4502-9DD9-336300392CDC@apache.org> <0743DF91-9015-43DD-9A0F-7E79D6DF4632@gmail.com> <0DE02009-32CB-4A88-8C39-7942E00BF8D6@apache.org> <2CC999E5-9D81-4981-B544-1977B9D16405@gmail.com> <154D8F25-87B3-49DC-9D80-6C68C946ECAF@gmail.com> <34FCDB16-6D06-4401-BCD8-0B053E2E935E@gmail.com> <48250456-2512-46BD-85E1-464457DBC995@pobox.com> X-Mailer: Apple Mail (2.929.2) X-Virus-Checked: Checked by ClamAV on apache.org On 31/12/2008, at 11:29 PM, Geir Magnusson Jr. wrote: > What trouble? I think this is *exactly* what should be done - have > CouchDB store documents that are : > > { > metadata : { _rev : X, _id : Y, _woogie: Z, .... anything that > needs to be added in the future, like other metadata like last > update date... }, > userdata : { .... the document you want to store .... } > } > > and then offer APIs that let you : > > a) get to this document, for libraries and clients that know they > are talking to Couch and want to manipulate at this level > > b) return and accept the userdocument directly, for clients that > just want to consume or produce JSON data, w/o caring about the > internal housekeeping One of the issues complicating the logic of this discussion is that the document id is both metadata and, conceptually, a document member. That's why, although the purest model is to have the userdata as a member within a Couch document as you suggest, this doesn't look that appealing: { metadata: { id: ... rev: ... ... } data: { ... the user's document ... } } Furthermore, from a scalability perspective, always having the metadata when you have the document, isn't a problem - the metadata is constrained. The reverse situation of always having the data when you have the metadata, is not constrained because the data is arbitrarily large. IMO this means that a solution such as this: { id: ... rev: ... ... data: { ... the user's document ... } } isn't such a good idea compared to this: { _metadata: { id: ... rev: ... } ... the user's document ... } Unfortunately the reserved token makes the structure non-reflexive without transformation, and although that's not currently an issue, I can imagine it complicating certain use-cases. It makes the system more complicated to reason about. I'm struggling to objectively evaluate this model and your reflexive model - given Damien's attitude to this issue, my motivation to do so is somewhat depressed :/ Antony Blakey ------------- CTO, Linkuistics Pty Ltd Ph: 0438 840 787 Did you hear about the Buddhist who refused Novocain during a root canal? His goal: transcend dental medication.