Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 46622 invoked from network); 1 Feb 2009 22:52:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Feb 2009 22:52:31 -0000 Received: (qmail 32562 invoked by uid 500); 1 Feb 2009 22:52:31 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 32334 invoked by uid 500); 1 Feb 2009 22:52:30 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 32323 invoked by uid 99); 1 Feb 2009 22:52:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Feb 2009 14:52:30 -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.200.171 as permitted sender) Received: from [209.85.200.171] (HELO wf-out-1314.google.com) (209.85.200.171) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Feb 2009 22:52:22 +0000 Received: by wf-out-1314.google.com with SMTP id 28so1355008wfc.29 for ; Sun, 01 Feb 2009 14:52:02 -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=IdDeqGT2ujh8RGUXItHD0ZYK5+wOnpzGVD/MyKOBus8=; b=DEK9djb/xo3pAqBfxvbTp8CjernTyTcFJqLk4gJ7fuG/ENXN1ON3A/l1D98I3yU07e 3SDzx3X7AoW26x9CLxfjsIgfTAkdsV4gBqsGV3JkqeEWNGxQZfj/h3bXaK2Vmw7Up4Y8 ykShSbgGb+tVUuYxXBev1T2J1S7wiJgIEvJ60= 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=f0mu+AllJP47HIHXDY3iWe2yKU44uAe7pBESz3pxX+JSIRkU27sPPp+cHqK+IXhdvH mvQqRya/OyXjmw2pXRhw8ao7ycoFX6/dl/+8mvbSaUzF1j9T4d9RQWXcICm3Z1TI6Z14 TEskNfXiH2s+/wL5fRnKf3HjT1Y7vIfuGac8g= Received: by 10.142.132.2 with SMTP id f2mr1542178wfd.216.1233528722428; Sun, 01 Feb 2009 14:52:02 -0800 (PST) Received: from ?192.168.0.16? (ppp121-45-202-232.lns10.adl2.internode.on.net [121.45.202.232]) by mx.google.com with ESMTPS id 22sm6502962wfi.58.2009.02.01.14.52.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 01 Feb 2009 14:52:02 -0800 (PST) Message-Id: <2F32C6DA-D91B-4CFB-8561-9E404D6EAA3F@gmail.com> From: Antony Blakey To: dev@couchdb.apache.org In-Reply-To: <4985A930.4050802@diskware.net> Content-Type: text/plain; charset=WINDOWS-1252; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: couch_gen_btree: pluggable storage / tree engines Date: Mon, 2 Feb 2009 09:21:57 +1030 References: <498464EC.1070209@diskware.net> <49859AB5.7080404@diskware.net> <5FCD4937-E8BD-4024-9E46-A24061F4D322@dionne-associates.com> <4985A930.4050802@diskware.net> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org On 02/02/2009, at 12:22 AM, Martin Scholl wrote: > What worries me most, is that I am still unsure in how to differ =20 > between > design docs and indexing schemes, and when to use which =20 > infrastructure. > Applied to the doc-relationship example you gave: how should > "intermediate reults" of the dag processing be treated? As documents? > Should they be put into view functions? Should views be able to hint, > which indexing scheme is to be used? Depending on the index type, > indexing and doc / view-processing can become inherently coupled and > complex. Is this still CouchDB then? No sure if this is exactly what you're talking about, but the way I =20 was thinking (which I picked up from GeoCouch) was to have design docs =20= that define no couch view, that allow you to configure the external =20 e.g. in my case, which was for returning the TC of user/role/=20 permissions graphs, that might look like this: { "_id": ..., "_rev": ..., transitive_closure_generator: { "User": { "from": "_id", "to": "[roles]" }, "Role": { "from": "_id", "to": "[permissions]" }, } } Then, in my external I process such docs in my update-loop to generate =20= the configuration of the external i.e. I monitor changes to design =20 docs with a 'transitive_closure_generator' element, obviously caching =20= and persisting that configuration. You also need to catch design docs =20= updates that remove that element, and the deletion of monitored docs =20 as well. Because I use CouchRest, I can use the 'couchrest-type' key that it =20 inserts to identify which document's fields I need to process e.g. =20 'User'/'Role'. As an aside, it might be nice if you could use that doc to define the =20= endpoint for your externals, so you could completely simulate a built-=20= in view. Putting external configuration into design docs isn't good =20 idea but maybe it could be indirect e.g. { "_id": 'my_design', "_rev": ..., transitive_closure_generator: { ... } externals: { view_name: 'tc', external: } } which would then allow you to access your external via '_view/=20 my_design/tc'. External views mapped like this would need to adhere to =20= the view contract e.g. params etc. Antony Blakey -------------------------- CTO, Linkuistics Pty Ltd Ph: 0438 840 787 Always have a vision. Why spend your life making other people=92s = dreams? -- Orson Welles (1915-1985)