new to riak, unsure of data model for comment system

Zak Fenton zak.fenton at
Sun Oct 3 22:04:27 EDT 2010

Hi. I've recently been using Riak to prototype a website. The data model
for media objects and articles is a no-brainer, but I'm wondering about
the best way to implement a comment system.

This is my current plan:
Media objects/articles are in the media or article buckets. Each such
object can have any number of links to comments (the tag for these links
is unimportant - does a link actually *need* a tag?). Comments go in the
comments bucket, so to retrieve all comments for an object is a simple
link walk of all links to that bucket.

I read that there is no "artificial" limit on the number of links, but
am I likely to run into practical limits if an object has hundreds of
comments? Would I be better off having each object link only to the
latest comment, and store comments in a linked list? The usual request
for comments is something like "give me the last 20 comments for object
Foo", so is there a more effective way of doing this than requesting all
comments at a time (and probably cacheing the last 20 in the frontend or
in a single Riak object)?

More information about the riak-users mailing list