couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Goodall <matt.good...@gmail.com>
Subject Re: Linking of Documents / Attachments
Date Thu, 13 May 2010 10:57:16 GMT
On 13 May 2010 10:57, c.Kleinhuis <ck@digitalgott.de> wrote:
> Hello all,
>
> i just decided to use couchdb in favor of hibernate/spring ... my name is
> christian kleinhuis
>
> and i have some general questions:
>
> 1. How is linking of documents solved ?      i would like to have something
> like a root node ( Project )
>   and i would like to associate nodes ( tasks ) to this root node,
>   what is the way to do it with couchdb ?
>   do i use the "_id" of the projekt in my task document, or do i
>   add the tasks as fields in the project ? but thus i couldnt edit a single
>   task hence it hasnt an id ...

It really depends on the application, but a reasonable rule of thumb
is to store things that tend to get edited on their own in separate
documents. Certainly, In terms of projects and tasks I would expect a
project document and lots of task documents. However, something like a
person and his addresses almost certainly makes more sense in a single
document.

> 2. handling attachments ... are the attached files configurable in the
>   file system, so that a user could go in the attachments folder and see
>   the files directly ?!

Attachments are stored in the database (and are replicated to other
databases just like documents) but there is a FUSE driver that lets
you map a database to the file system,
http://code.google.com/p/couchdb-fuse/.

- Matt

Mime
View raw message