Hi all,

For some specific reason, I have a HBase table that should be frequently 
prepended. The row keys in this table are long integers (converted to bytes of 
course). "Prepend" is an operation that does the following:
1. Scans the table just for the purpose of getting the row key X of the first 
row, then stops the scan.
2. CheckAndSet on X-1, checking if row X-1 is null and putting data at row key 
X-1.
3. If the CAS failed, try CAS on X-2, etc.

I'd like to know if there are any obvious performance drawbacks with this 
approach, compared to inserting rows randomly in the table. With "obvious 
performance drawbacks" I mean something that doesn't need to be benchmarked to 
know its effects.

I am aware that scanning plus CAS will be slower than a simple Put, but I'd 
like to know if prepending has any negative effect regarding region management 
and misc.

Thank you,
Andre Medeiros

Reply via email to