Hi everyone,

I am going to implement a facebook-like comments system (with main comments and their sub-comments), using HBase 0.90. I designed the storage of comments as follow:

- Row key is composite row key. Each row key is a composition of user id and timestamp (in reverse order). With this row key, i can easily get top n newest main comments of a specific user.

- Each row has two column family: "data" and "sub_comment"
+ The "data" family stores information of main comment, such as comment content, user id of poster, time of post... + The "sub_comment" family, as its name, store all the sub comments. The number of columns in this family equal the number of sub-comments, and column names follow this format: "sub-comment:timestamp" (timestamp in reverse order), and its value is the content of sub-comment.

So, my question is, is there any way to get the first n columns (ordered by timestamp) of the "sub_comment" family? I searched arround google and this mailing list, but cannot find this information. I know that i can use different versions of a column to solve this problem, but for some reasons, i do not want to use multiple versions of a column.

Thanks in advance

Eddie Bui,

Reply via email to