Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 60019 invoked from network); 2 Oct 2009 14:52:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Oct 2009 14:52:40 -0000 Received: (qmail 67702 invoked by uid 500); 2 Oct 2009 14:52:39 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 67612 invoked by uid 500); 2 Oct 2009 14:52:39 -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 67602 invoked by uid 99); 2 Oct 2009 14:52:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Oct 2009 14:52:39 +0000 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 ningtan@gmail.com designates 209.85.220.209 as permitted sender) Received: from [209.85.220.209] (HELO mail-fx0-f209.google.com) (209.85.220.209) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Oct 2009 14:52:29 +0000 Received: by fxm5 with SMTP id 5so1271973fxm.3 for ; Fri, 02 Oct 2009 07:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=3JJJ0FnDpC/zh1STcclmC1btZiZCbjYK1oGZvqsXCOE=; b=JlsDjZHeOtuHI+d/oBmwLrpeoF/cuOl5e28Y9U/22WuZCjkHKoKciDqrivpc5BScbV Bs08n/4U394lUXMs1tuJ6fKv3c+p/GxuyYwqulAqmtinjhL/iZED6uF6SwkyINmMXGRf uHUUKdvdBiMkA1qMP2cKO2YAG4LJz0Ef0D180= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=Xq3tVg5FKyN7mab2oQ9OfZl5U7UC7iEcJ6s/9ux11SeZFWxxx3esIQ1XBIudcHrQ0U fKLY1f5bYM9DOPt4rUFWpcFgpGhHeIgEVa4cvX94y1xxDkFYCA+Rq1defiYn+weRkp8A PRI/hDyNfoiC1I34DlUNsQiZuRaT3ldxgt4MQ= MIME-Version: 1.0 Received: by 10.239.142.149 with SMTP id g21mr222753hba.191.1254495129273; Fri, 02 Oct 2009 07:52:09 -0700 (PDT) In-Reply-To: <84fb38e30910011412n14a23f13p9e087cfb6ac981ee@mail.gmail.com> References: <84fb38e30909281153q5cc93c01od2b2692bf5501d6a@mail.gmail.com> <8a02878f0909290846o18be76adxeb42bf1ed941fab@mail.gmail.com> <8a02878f0909290856i31eec803lf80650f602397105@mail.gmail.com> <84fb38e30910011412n14a23f13p9e087cfb6ac981ee@mail.gmail.com> From: Ning Tan Date: Fri, 2 Oct 2009 10:51:49 -0400 Message-ID: <5b7f441e0910020751l45c7d592uea24ebce48e89eb2@mail.gmail.com> Subject: Re: Modelling Question To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Oct 1, 2009 at 5:12 PM, tsuraan wrote: > Ok, so in my case, a user needs to be able to edit his mailbox (delete > messages from it, mostly), so each user needs his own mailbox. =A0If the > structure of the user table is something like: > > { "username" : name, > =A0"mailboxes" : [ > =A0 =A0{ "entries" : [ list of messages ], > =A0 =A0 =A0"source" : name of email source, > =A0 =A0 =A0"name" : whatever the user wants to call the mailbox > =A0 }, > =A0 ... ]} > > Then email delivery for each email creator would be a map-reduce job > that delivers email into every box whose source entry matches the name > of the email creator. =A0Does that make sense for Couch? =A0Is that > something that is reasonable to do in a map-reduce job, and would it > perform reasonably? Are mailboxes concrete documents or merely an abstraction (e.g. supported by tagging the mail messages maybe)? I like the latter better than the former. I'm not sure you need the reduce part of the MapReduce framework here if all you need is a list of messages. Be care generating a large amount of data from your reduce function; it's not meant to support that.