Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 52590 invoked from network); 14 Apr 2009 08:42:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Apr 2009 08:42:42 -0000 Received: (qmail 70214 invoked by uid 500); 14 Apr 2009 08:40:44 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 70060 invoked by uid 500); 14 Apr 2009 08:39:32 -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 69967 invoked by uid 99); 14 Apr 2009 08:39:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Apr 2009 08:39:03 +0000 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 wout.mertens@gmail.com designates 209.85.221.180 as permitted sender) Received: from [209.85.221.180] (HELO mail-qy0-f180.google.com) (209.85.221.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Apr 2009 08:38:55 +0000 Received: by qyk10 with SMTP id 10so4084579qyk.13 for ; Tue, 14 Apr 2009 01:38:32 -0700 (PDT) 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=nNst1iGiowQFXHMFbvbbLfV1+mG55UGjY1X9ypPZXWk=; b=uDMKluruwZR6V49av9Gxx8URHPAP8RR7zuFa0cCzoKC2w+481fC2SxUC++WXJBBDjd R+P22uxuiOtEMe9dZ781/IwrP5iNybq4KcunpouVGzGc5fHh7YkYno8r3J7D2X0Vjl/K Vc20WUvGhYbs6nIT3GmIqDxHplzIfIRc0K82Y= 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=kL0yoMVJJuY0R6eigLUHhyVtImo+0V4HRCf1LAZ5c6lISR4Qkzk/+rL6RhcrrIP+3G Z1yyjBMqpqo7IM46PUx6jHOZGwWz+1sfUvpagv8t7hkEEEyLHhvGON1ZcadYKHLvNX/R IwSUbaugYAL24i/1RmsExR32QiMaKxVFUEBT4= Received: by 10.220.95.14 with SMTP id b14mr7470948vcn.35.1239698312330; Tue, 14 Apr 2009 01:38:32 -0700 (PDT) Received: from ?192.168.1.11? (5.96-201-80.adsl-dyn.isp.belgacom.be [80.201.96.5]) by mx.google.com with ESMTPS id 5sm2224202yxt.54.2009.04.14.01.38.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 14 Apr 2009 01:38:31 -0700 (PDT) Message-Id: From: Wout Mertens To: dev@couchdb.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 v930.3) Subject: Re: Erlang vs Scala Date: Tue, 14 Apr 2009 10:38:27 +0200 References: <20090408080746.GA7710@uk.tiscali.com> <15ec700a0904081918j4dc53af7mab831a6fed475ad8@mail.gmail.com> <64a10fff0904081953s51a476eekb40ade9d03165ad7@mail.gmail.com> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org Hi Daniel, On Apr 13, 2009, at 7:01 AM, Daniel Friesen wrote: > In CouchDB we would have needed a structure similar to: > document aaa: { "isa": "jit", "state": {}, "children": ["bbb", > "ccc"] } > document bbb: { "isa": "jit", "state": {}, "children": ["ddd"] } > document ccc: { "isa": "jit", "state": {}, "children": ["ddd"] } > document ddd: { "isa": "jit", "state": {}, "children": [] } > But unfortunately we can't go grabbing data hierarchically without > doing a pile of queries, or complicating the data structure in a way > that I cannot sanely complicate the program itself by using when I > have other options. Avoiding the huge piles of queries and > overcomplicated data structures was the whole reason behind moving > away from MySQL and into using non-traditional databases. > > In the XML database instead of the structure before I can place all > the jits into one document for the site (because I can modify > individual parts of it without worrying about conflicts in other > parts of the document) and make use of XQuery to to iteration and > recursion and return whatever I need. > > > bbbccc children> > ddd > ddd > > > I'm confused I think. Is it correct to say that you compile all jits into a master document per site? What would prevent you from using the same technique with CouchDB? > So querying for the jit ID by document id in couch is equivalent to > `doc(...)/site/jits/jit[id="..."]` in XQuery. But because of FLWOR > and the other parts of XQuery I should theoretically be able to deal > with the recursive nature of our data on the database side. I think you can do the very same thing in CouchDB using one doc per site. You can use views to generate the recursive list of jits you need to load. As for atomicity, a document is atomic for CouchDB, so that would help as well? Wout.