From couchdb-user-return-761-apmail-incubator-couchdb-user-archive=incubator.apache.org@incubator.apache.org Mon Jul 14 23:05:06 2008
Return-Path:
Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org
Received: (qmail 49306 invoked from network); 14 Jul 2008 23:05:06 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2)
by minotaur.apache.org with SMTP; 14 Jul 2008 23:05:06 -0000
Received: (qmail 95765 invoked by uid 500); 14 Jul 2008 23:05:01 -0000
Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org
Received: (qmail 95735 invoked by uid 500); 14 Jul 2008 23:05:01 -0000
Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm
Precedence: bulk
List-Help:
List-Unsubscribe:
List-Post:
List-Id:
Reply-To: couchdb-user@incubator.apache.org
Delivered-To: mailing list couchdb-user@incubator.apache.org
Received: (qmail 95334 invoked by uid 99); 14 Jul 2008 23:05:01 -0000
Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136)
by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jul 2008 16:05:00 -0700
X-ASF-Spam-Status: No, hits=3.2 required=10.0
tests=HTML_MESSAGE,SPF_NEUTRAL
X-Spam-Check-By: apache.org
Received-SPF: neutral (athena.apache.org: local policy)
Received: from [209.85.198.246] (HELO rv-out-0708.google.com) (209.85.198.246)
by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jul 2008 23:04:07 +0000
Received: by rv-out-0708.google.com with SMTP id k29so4844449rvb.0
for ; Mon, 14 Jul 2008 16:04:30 -0700 (PDT)
Received: by 10.140.193.15 with SMTP id q15mr6946948rvf.191.1216076670001;
Mon, 14 Jul 2008 16:04:30 -0700 (PDT)
Received: by 10.140.225.8 with HTTP; Mon, 14 Jul 2008 16:04:29 -0700 (PDT)
Message-ID: <64a10fff0807141604i6f4c5778meba60a1f634f518b@mail.gmail.com>
Date: Mon, 14 Jul 2008 19:04:29 -0400
From: "Dean Landolt"
To: couchdb-user@incubator.apache.org
Subject: Re: when to use another document and when not to?
In-Reply-To: <6b6419750807141546q63431cfek69184295a1cb25b0@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_Part_61221_33103375.1216076670000"
References: <6b6419750807141546q63431cfek69184295a1cb25b0@mail.gmail.com>
X-Virus-Checked: Checked by ClamAV on apache.org
------=_Part_61221_33103375.1216076670000
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
I've been wrestling with this myself, and the only rule of thumb that makes
any sense to me is just to spin off a new object if the new type of data
tends to grow rather than change. In the example you put forth, that seems
like the kind of data structure that is subject to change so it seems like a
better candidate for nesting inside the parent doc. If it were something
more akin to logging information, it probably belongs in its own doc just
due to versioning overhead that would be created by creating a whole new doc
for every new write...
Of course, this is a complete shot in the dark. I'm still very new with
couch as well. Anyone else have a better rule of thumb?
Dean
On Mon, Jul 14, 2008 at 6:46 PM, Patrick Aljord wrote:
> Hey all,
>
> I'm playing with couchdb and I'm wondering when should I just use
> another field in the doc or another doc.
>
> Say, I have users, each user can follow many users. Should I put all
> the followed users in a field of each user doc (as an array) or
> should I create a Follower doc with the id of the followed user and
> the id of the follower user.
>
> What's the general "rule" if there is one to know when it's best to
> use a separate doc and when not to?
>
> Thanks in advance
>
> Pat
>
------=_Part_61221_33103375.1216076670000--