couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dean Landolt" <d...@deanlandolt.com>
Subject Re: when to use another document and when not to?
Date Mon, 14 Jul 2008 23:04:29 GMT
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 <patcito@gmail.com> 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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message