Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 93689 invoked from network); 11 May 2010 18:05:29 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 May 2010 18:05:29 -0000 Received: (qmail 45241 invoked by uid 500); 11 May 2010 18:05:27 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 45189 invoked by uid 500); 11 May 2010 18:05:27 -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 45181 invoked by uid 99); 11 May 2010 18:05:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 May 2010 18:05:27 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=10.0 tests=AWL,FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zachary.zolton@gmail.com designates 74.125.82.52 as permitted sender) Received: from [74.125.82.52] (HELO mail-ww0-f52.google.com) (74.125.82.52) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 May 2010 18:05:21 +0000 Received: by wwb24 with SMTP id 24so71064wwb.11 for ; Tue, 11 May 2010 11:05:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=B90qXNpNwc/a+pdNdgMaENm2N/aXivPFFRFt/YHIufs=; b=c8HxU7xik7gS3+/u2cqVi2nGVquRX0oUqV1EjmYikvuCchdDsvCUur0uk91X9URVeR mS+1S+zoDDE1Tq++8EfJSCOoqneNCnSH5V6tDViA0KjdXXx6Qc75Dj0LwYpRoHZGubLD vOEnzvnI+8sk6BW/zkRlA+rjBI+e40H8E+9dc= 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=NQ2KlixK0tBRLkhWDNENeveHUPrqk9/Vx8D/twD6R+siaA/UtubP7MI1araZKY/elm tFBtgcqgawB1hxf5K2ybDVxX+TkJ8V59W9KXK08ADBCf4ttjZK4ddR/QG5t9bYlqgbD8 /2/ytKRygjbA7y+WPE1/s378Kbk+hpX54TZvo= Received: by 10.216.91.83 with SMTP id g61mr3761109wef.138.1273601099990; Tue, 11 May 2010 11:04:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.156.147 with HTTP; Tue, 11 May 2010 11:01:51 -0700 (PDT) In-Reply-To: <814882.97060.qm@web31807.mail.mud.yahoo.com> References: <814882.97060.qm@web31807.mail.mud.yahoo.com> From: Zachary Zolton Date: Tue, 11 May 2010 13:01:51 -0500 Message-ID: Subject: Re: Using views in Validation functions To: user@couchdb.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable I'd suggest having a database per user. That makes both access control and size/usage easy. I'd consider limiting the user access to the database via a middle tier program that can just check the database size before allowing any write operations. And don't worry, CouchDB is known to support tens of thousands of databases= . =97Zach On Sun, May 9, 2010 at 6:52 AM, Behrad Zari wrote: > Consider implementing a MailBox scenario on top of CouchDB, where we shou= ld manage user box quota size. > If we create a doc for each user, and represent a message with a doc that= references user doc NOW: > For quota size control, I was thinking to use validation functions but it= seems they have only access to the to-be-created/updated doc, but we need = access to all docs/msgs (to collect attachment sizes) referenced to the use= r, and this can happen by a map/reduce function! > > Any helps/suggestions/workarounds would be thankful! > > --Behrad > > >