In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces what the design principles of rowKey in Hbase are, which can be used for reference by interested friends. I hope you can learn a lot after reading this article.
Design principles of Hbase's rowKey
The design can refer to the following three principles.
1. Rowkey length principle
Rowkey is a binary code stream, which can be any string with a maximum length of 64kb. In practical applications, it is generally 10-100bytes, saved in the form of byte [], and is generally designed to have a fixed length. It is recommended that the shorter the better, no more than 16 bytes, for the following reasons:
The persistence file HFile of data is stored according to KeyValue. If the rowkey is too long, it will greatly affect the storage efficiency of HFile. MemStore will cache part of the data to memory. If the rowkey field is too long, the effective utilization of memory will be reduced, and the system can not cache more data, which will reduce the efficiency of retrieval.
2. Rowkey hashing principle
If the rowkey is incremented by timestamp, do not put the time in front of the binary code. It is recommended to use the high bit of the rowkey as a hash field, which is randomly generated by the program, and the low bit time field. This will increase the probability that the data will be evenly distributed in each RegionServer to achieve load balancing. If there is no hash field, the first field is directly time information, and all data will be concentrated on one RegionServer, so that the load will be concentrated on individual RegionServer during data retrieval, which will cause hot issues and reduce query efficiency.
3. The only principle of rowkey
It must be designed to ensure its uniqueness. Rowkey is sorted and stored in dictionary order. Therefore, when designing rowkey, we should take full advantage of this sorting feature, store frequently read data together, and put together data that may be accessed recently.
Thank you for reading this article carefully. I hope the article "what are the design principles of rowKey in Hbase" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.