HBase row key design for monotonically increasing keys

后端 未结 4 1612
北荒
北荒 2021-02-14 07:11

I\'ve an HBase table where I\'m writing the row keys like:

~1
~2
~3
...
~9
~10
4条回答
  •  广开言路
    2021-02-14 07:54

    HBase stores rowkeys in lexicographical order, so you can try to use this schema with fixed-length rowrey:

    ~0001
    ~0002
    ~0003
    ...
    ~0009
    ~0010
    

    Keep in mind that you also should use random prefixes to avoid region hot-spotting (when a single region accepts most of the writes, while the other regions are idle).

提交回复
热议问题