incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: forum application data model conversion
Date Mon, 28 Jun 2010 15:40:47 GMT
The principle in Cassandra modeling is that for each query, you should
denormalize your data at write time such that you can get the data for
that query from a single row.

The best explanation so far is at
http://www.rackspacecloud.com/blog/2010/05/12/cassandra-by-example/

On Tue, Jun 22, 2010 at 1:13 PM, S Ahmed <sahmed1020@gmail.com> wrote:
> Converting a Forum application to cassandra's data model.
>
> Tables:
>
> Posts [postID, threadID, userID, subject, body, created, lastmodified]
>
> So this table contains the actual question subject and body.
>
> When a user logs in, they want to see a list of their questions, and also
> order by the last-modified date (to see if people responed to their
> question).
>
> How would you do this best in Cassandra, seeing as the question/answer text
> is stored in another table.
>
> I know you could make a CF like:
>
> userID { postID1, postID2, ...}
>
> And somehow order by last-modified, but then on the actual web page you
> would have to first query for postID's owned by the user, and orderd by
> last-modified.
>
> THEN you would have to fetch the post data from the posts collection.
>
> Is this the only way?  I mean other than repeating the post subject+body in
> the user-to-postID index CF.
>
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Mime
View raw message