Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 42429 invoked from network); 5 Nov 2009 17:34:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Nov 2009 17:34:19 -0000 Received: (qmail 1492 invoked by uid 500); 5 Nov 2009 17:34:18 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 1423 invoked by uid 500); 5 Nov 2009 17:34:18 -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 1413 invoked by uid 99); 5 Nov 2009 17:34:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Nov 2009 17:34:18 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [83.97.50.139] (HELO jan.prima.de) (83.97.50.139) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Nov 2009 17:34:15 +0000 Received: from [10.0.1.5] (f053035110.adsl.alicedsl.de [::ffff:78.53.35.110]) (AUTH: LOGIN jan, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by jan.prima.de with esmtp; Thu, 05 Nov 2009 17:33:51 +0000 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: How do you handle multiple document groups? From: Jan Lehnardt In-Reply-To: <20091105154530.GA6993@uk.tiscali.com> Date: Thu, 5 Nov 2009 18:33:20 +0100 Content-Transfer-Encoding: 7bit Message-Id: <3008659E-73D2-4192-9A34-4E75018808C9@apache.org> References: <20091105154530.GA6993@uk.tiscali.com> To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1076) On 5 Nov 2009, at 16:45, Brian Candler wrote: > On Thu, Nov 05, 2009 at 12:03:55PM +0100, Jan Lehnardt wrote: >>> For something like "myapp.com" domain and "users" database. I'll >>> just >>> have to replace all periods with underscores or something. >> >> I wouldn't create databases per type. >> >> say user a has the domains foo.com and bar.com >> >> for that user the databases /a/foo_com/ and /a/bar_com >> are created. In these databases, all documents for the >> respective domain live. If you need additional info for >> the user that owns the domain that is not specific to >> the domain, I'd go with putting all user-specific info >> in each of the user's databases. This is duplication, >> but it doesn't really hurt, except maybe for users >> with hundreds and thousands of domains. > > I'd say it depends what you mean by a "user" > > If a user logs in as user@foo.com to get to the foo.com blog, and > user@bar.com to get to the bar.com blog, then each database probably > should > have its own users table. > > If you can login as user@example.com and you are 'attached' to both > the > foo.com and bar.com domains as a user, then I'd say you'd need a > single > users database, separate from the domain databases. The records in > the user > database would list what domains the user is allowed to see. You can > use a > map view to turn the data backwards, e.g. so that you can see which > users > are allowed to access foo.com Yeah, I had both methods in mind while writing, Thanks for clearing it up :) Cheers Jan -- PS: No need to CC me on the couch lists :)