Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 85520 invoked from network); 8 Dec 2010 14:37:05 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Dec 2010 14:37:05 -0000 Received: (qmail 37791 invoked by uid 500); 8 Dec 2010 14:37:04 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 37648 invoked by uid 500); 8 Dec 2010 14:37:04 -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 37638 invoked by uid 99); 8 Dec 2010 14:37:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Dec 2010 14:37:03 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of djc.ochtman@gmail.com designates 209.85.216.52 as permitted sender) Received: from [209.85.216.52] (HELO mail-qw0-f52.google.com) (209.85.216.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Dec 2010 14:36:57 +0000 Received: by qwi4 with SMTP id 4so1425597qwi.11 for ; Wed, 08 Dec 2010 06:36:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=mj5JzzjnpNZTKB3jqpSvk4tXX1Tc/LkJ2LeggyBJMEE=; b=eOP5kWD1rYMuSC2og8APim1Zq1WHVToS6n5ITvduuJ8jJyTcGOsrJmmxfbLuYvB9Hm aXclJL4U24ERwj/6uqio9ixjDBZTBbbZ53UiBZCVkng1e+5tTL0dRYWbJKynghD6tRa/ pUruKj5tDxtVhK+NV/J2Yp0Jxezcn7588xsWg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; b=xXVDmrBk5c6lin8w2QIn2g8R1d7C2eC7CRItiiJSc1+i6hFBV0Jqlfco7GHD/fVDCQ BKKr+hkWJ/4UEaz61AKgXtCMlLYPLSjM4fLaghyP0mmHhnw+vHv8d3rIoMRVIpgWMJoc Rwn9pJkJnZzSQgmTW8s78UtxbDXMaIWB56un8= Received: by 10.229.221.69 with SMTP id ib5mr7081714qcb.10.1291818996318; Wed, 08 Dec 2010 06:36:36 -0800 (PST) MIME-Version: 1.0 Sender: djc.ochtman@gmail.com Received: by 10.229.35.16 with HTTP; Wed, 8 Dec 2010 06:36:15 -0800 (PST) In-Reply-To: References: From: Dirkjan Ochtman Date: Wed, 8 Dec 2010 15:36:15 +0100 X-Google-Sender-Auth: JagvUt5YXu5eRI8r7MGrbwLgTyk Message-ID: Subject: Re: Database design with CouchDB To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 On Wed, Dec 8, 2010 at 14:59, He Shiming wrote: > Thanks again for clarifying. So this is one database per project, and > inside this database, everything is flat document. Each user has one > document. > > Now if each user has several blogs, each with several articles, do > these information fit into the user document? Or do I create separate > documents, with "type" field set to either "blog" or "article"? I would create one document per blog, and one document per article, with appropriate type-field values. > Most apps are user-oriented. Everything is tied to a user. Does that > mean everything related to this user fits into the user document? Will > this approach introduce any difficulty later on? Everything is tied to a user, but if it's manipulated separately (like comments, forum posts, weblog articles), it should probably be a separate document. Cheers, Dirkjan