hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bui Ngoc Son <gemmountain...@gmail.com>
Subject HBase Schema: how to sort row by last update?
Date Wed, 20 Apr 2011 06:53:31 GMT
Hi everybody,

I am desiging a two-tiers comment system like facebook: the system 
inlcuded main comments and each main comment has a various number of 
sub-comments. My schema is as follow:

table comments
     family "data":
         "data:content" - content of main comment
         "data:uid" - uid of user who posted this comment
         "data:sub_count" - the number of its sub-comment.
     family "sub_content"
         "sub_content:<cid>": content of the sub-comment which has id=cid
     family "sub_uid"
         "sub_uid:<cid>": uid of user who posted the sub-comment which 
has id=cid

So, each sub-comment has two columns in 2 families with an unique cid. 
As well, each main comment has an unique id that is decreased by time 
(to make sure that newer main comments are selected first)

However, my boss requires that main comments have to be ordered by last 
update first. It is mean that, each time a main comment have a new 
sub-comment, it becomes "newer" than the others, and i have to sort the 
main comments by the time of their last sub-comments.

How can i design the comment schema to meet my boss's requirement? can i 
keep the current schema and use some extra-indexing table? or i have to 
re-design the schema?

Thanks in advance

Regards,

Eddie Bui

Mime
View raw message