how to design Hbase schema? how to design Hbase schema? hadoop hadoop

how to design Hbase schema?


Secondary indexes would indeed be useful for many potential applications of HBase, and I believe the developers are in fact looking at it. Checkout http://www.mail-archive.com/hbase-dev@hadoop.apache.org/msg04801.html.

In the mean time though, if your application data storage can be modelled as a star schema (see http://en.wikipedia.org/wiki/Star_schema) you might like to checkout the solution that Hypertable proposes for secondary index-type needs http://markmail.org/message/rphm4q6cbar2ycgp


I recommend having two different flat tables: one for looking up attributes+values given entityID, and one for looking up the entityID given attributes+values.

Table 1 would look like this:

entityID1 {  attribute1: value1;  attribute2: value2;  ...}

and Table 2:

attribute1_value1 {  entityID1;}attribute2_value2 {  entityID1;}