incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrea Schiavini" <a.schiav...@sourcesense.com>
Subject Re: General Q about CouchDB
Date Wed, 17 Dec 2008 07:37:17 GMT
In the second approach described in this article, posts are separated from
comments. But isn't this in contrast with the impossibility of CouchDB to
update atomically several documents? It could lead to a loss of database
integrity, if in example an user deletes an article while another one
updates a related comment. Shouldn't it be encouraged to keep related
informations in the same document?

Andrea Schiavini

2008/12/17 Jan Lehnardt <jan@prima.de>

>
> On 16 Dec 2008, at 20:54, Christopher McComas wrote:
>
>  Chris,
>> Thanks. One question, concern I might have with that would be just
>> spelling
>> something differently, but that shouldn't be too big of an issue.
>>
>> To my next question, what would be the best way to structure comments for
>> a
>> blog post, where they have their own author, timestamp, and entry? Again,
>> this is fairly straight-forward with a relational db using a foreign key.
>>
>
> Same concept ;)
>
> See http://www.cmlenz.net/archives/2007/10/couchdb-joins for details.
>
> Cheers
> Jan
> --
>
>
>
>
>>
>> Thanks,
>>
>> On Tue, Dec 16, 2008 at 2:51 PM, Chris Anderson <jchris@gmail.com> wrote:
>>
>>  On Tue, Dec 16, 2008 at 11:46 AM, Christopher McComas
>>> <mccomas.chris@gmail.com> wrote:
>>>
>>>> Would it be wrong to try to do the category piece as related in CouchDB?
>>>> What would be the best way to do it, so that you can have a page,
>>>> myblog.com/categories/this-category/ that'd then display all the
>>>> entries
>>>>
>>> for
>>>
>>>> that category? What would be proper?
>>>>
>>>
>>> Having a category field on the blog post itself is a fine way to do this.
>>>
>>> Eg:
>>>
>>> {
>>> "title":"Blah",
>>> "author":"Chris",
>>> "category":"music",
>>> "date": ...
>>> }
>>>
>>> Writing a view that sorts posts by category and date would be simple
>>> with this sort of data structure. Of course if you wanted to rename a
>>> category later you'd need to touch all the documents that listed it,
>>> so this solution is more like tagging than categories, but should
>>> fulfill the need.
>>>
>>>
>>> --
>>> Chris Anderson
>>> http://jchris.mfdz.com
>>>
>>>
>

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