Sponsored Links

Ad by Google
In this post, I am going to list few key points, which will help you to design a best row key in Hbase table. This question is very popular in Big Data interview. I am damn sure that, if you follow the below given rules while designing row key in your Hbase table, It will automatically remove the chances of Hot Spotting.

How to design a best row-key in HBase table
While designing database in any RDBMS, the fetching strategy is most important, and based on the fetching strategies, we always design a key/primary key/index etc. The key designing is most important aspect in any RDBM/DBMS.

The same thing in Hbase also, Hbase is a an open source NoSql database that provides random near real time read/write access to the Big Data. And Apache Hbase is an one of the popular Big Data technologies.

While designing tables in Hbase, the row key is the single and most important aspect to keep in-mind (Think till you find a best row key, designing best row key require some brainstorming) and of-course the row key design is based on your access pattern of the records.

Note – In any RDBMS, we can index on multiple columns, but in Hbase row key is the only way to get the data from the Hbase tables, means row key is the only thing which must be a well formed.

Key Rules to Design Best Row key

  1. Try to avoid monotonically increasing row keys, such as Timestamp data.
  2. Try to keep your row keys small, such as email instead of email_address.
  3. Try to keep your row key length small, if possible use numeric row key instead of String, because String takes more bytes as compared to integers.
  4. If your regions and region servers are not properly balanced, and if any or set of region server are getting huge traffic, than, try to add hashing/salting mechanism to your row key.
  5. Try to use average number of versions, not too high neither too small.
Remember bad row key design is the only caused of Hot Spotting.

That's it, If you found any thing other than above listed, please share with me, I will add them into the list.
Sponsored Links


Post a Comment