title: How to compose an HBase key with variable length constituents
body: <p>Suppose my HBase table needs to be accessed by a key which is a combination of four different elements (K1:DateTime, K2:Int, K3:String, K4:Double). What is the best practice to construct the key for this? I am especially concerned about the variable length data types (string). </p>
  
  <p>Currently I am appending the byte length to the string so I can parse back each of the elements from the key bytes. I was thinking that having length at the beginning would result in fast checks when the string lengths do not match. Are there any drawbacks to this approach. Could it somehow affect querying based on partial keys later? (I am fairly new to HBase having tinkered around with it for just a week) </p>
  
  <p>Honestly I dont like strings to be part of the keys and I am trying to get the guys to use some kind of enumerations instead of strings, but not sure I'll be able to convince them. Assuming I am stuck with Strings being part of the key, what is the best approach to compose a key with these elements?</p>