I would arrange for memtable flush period in such a manner that the time period for which these most viewed discussions are generated equals the memtable flush timeperiod, so that the entire row of most viewed discussion on a topic is in one or maximum two memtables/ SST tables.
This would also help minimize several versions of the same column in the row parts in different SST tables.


On Wed, May 18, 2011 at 11:04 PM, Aditya Narayan <adynnn@gmail.com> wrote:
*************
For a discussions forum, I need to show a page of most viewed discussions.

For implementing this, I maintain a count of views of a discussion & when this views count of a discussion passes a certain threshold limit, the discussion Id is added to a row of most viewed discussions.

This row of most viewed discussions contains columns with Integer names & values containing serialized lists of Ids of all discussions whose views count equals the Integral name of this column.

Thus if the view count of a discussion increases I'll need to move its 'Id' from serialized list in some column to serialized list in another column whose name represents the updated views count on that discussion.

Thus I can get the most viewed discussions by getting the appropriate no of columns from one end of this Integer sorted row.

************

I wanted to get feedback from you all, to know if this is a good design.

Thanks