The application of Salting in HBase isto assign a random character toeach rowkey prefix, so that the data is scattered in multiple different regions to achieve a balanced load.
If the table region in HBase is distinguished according to the prefix ofeach letter, let's compare the changes before and after adding salt to the rowkey. First, we give a set of rowkeys before salt:
rk001
rk002
rk003
According to the partition, the above rowkey isin the same region. Below we add salt to the above rowkey:
a-rk001
b-rk002
c-rk003
After the processed rowkey, the data is distributed in3 regions. In theory, the throughput at this time is3 times that before the processing. Since the prefix is random, it takes more time to search lexicographically when reading these data (may initiate a request toeach region server), so salt increases the throughput of write operations, but it increases the read operation Overhead.