Lets assume a data model in which a User have blog-posts. Each post has a unique title and many attributes.
I have a Column Family "posts" in which each row is like this:
posts = { "yersterday" : { date : 03-04-2012 userID : abfe222234 tags : "beatles,paul" } } I want to index the posts by user, so I have another regular column family:
user_posts = { abfe222234 : { yesterday : null .... } } This model comes after a lot of research about secondary indexing in Cassandra, in which I came to these slides: http://www.slideshare.net/edanuff/indexing-in-cassandra and understood that Super Column Family are less and less used.
My question:
If you want all the details about the user posts, it means that I have to read the DB twice: once for getting all the posts IDs, and once for fetching all the post's details for those IDs.
What am I missing?
Thanks, Issahar.
edit:
The other option, is to make "user_posts" be a Super CF, and make it contain all the data that is inside "posts".
pros: you'll have to fetch all the data only once.
cons: 1. You'll duplicate all of your data. 2. You can't search for once attribute of a post.
What do you say?