You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Anh <7z...@gmail.com> on 2009/12/01 02:56:20 UTC

Re: Comment tree design in CouchDB?

I've been thinking about it, and related to my original question on storing
the comment tree in a single doc, does anyone see a problem with this
approach?:

When a comment is added and a revision conflict is detected, you deserialize
the latest version of the comment tree and merge the two versions
programmatically, and then reattempt the update.

In my case, seems this would suffice due to the comment tree size likely
being small, and also not having to worry about deleted/removed comments.

Thoughts?

Thanks

Re: Comment tree design in CouchDB?

Posted by Chris Anderson <jc...@apache.org>.
On Tue, Dec 1, 2009 at 10:28 AM, Anh <7z...@gmail.com> wrote:
> BTW, I coincidentally noticed that the "CouchDB: The Definitive Guide"
> online version has a hidden link that is  commented-out link to a
> chapter that discusses comments via a small example:
>
> http://books.couchdb.org/relax/example-app/accepting-comments
>
> I found it useful as well, curious if there was anything "wrong" with it :-)
>

nothing wrong with it. we just didn't have the time to bring it to
publishing quality.

>
> Thanks again
>



-- 
Chris Anderson
http://jchrisa.net
http://couch.io

Re: Comment tree design in CouchDB?

Posted by Anh <7z...@gmail.com>.
BTW, I coincidentally noticed that the "CouchDB: The Definitive Guide"
online version has a hidden link that is  commented-out link to a
chapter that discusses comments via a small example:

http://books.couchdb.org/relax/example-app/accepting-comments

I found it useful as well, curious if there was anything "wrong" with it :-)


Thanks again

Re: Comment tree design in CouchDB?

Posted by Anh <7z...@gmail.com>.
On Mon, Nov 30, 2009 at 6:36 PM, Chris Anderson <jc...@apache.org> wrote:

>
> I'd store a comment per document, otherwise users will be stepping on
> each other's toes which will kill your concurrency.
>


Good point, thanks

Re: Comment tree design in CouchDB?

Posted by Chris Anderson <jc...@apache.org>.
On Mon, Nov 30, 2009 at 5:56 PM, Anh <7z...@gmail.com> wrote:
> I've been thinking about it, and related to my original question on storing
> the comment tree in a single doc, does anyone see a problem with this
> approach?:
>
> When a comment is added and a revision conflict is detected, you deserialize
> the latest version of the comment tree and merge the two versions
> programmatically, and then reattempt the update.
>
> In my case, seems this would suffice due to the comment tree size likely
> being small, and also not having to worry about deleted/removed comments.
>
> Thoughts?

I'd store a comment per document, otherwise users will be stepping on
each other's toes which will kill your concurrency.

Chris


-- 
Chris Anderson
http://jchrisa.net
http://couch.io