In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces what are the basic knowledge points of HBase, which can be used for reference by interested friends. I hope you will gain a lot after reading this article.
1. Basic characteristics
(1) Hbase is based on HDFS (so HBASE is related to DFS and has nothing to do with Yarn. If you simply operate Hbase, you can only start dfs-start.sh)
(2) Hbase supports simple queries, does not support complex queries such as join, and does not support complex things (row-level things, that is, atomic operations, no matter how many columns are found at once)
(3) Hbase supports data type: byte [] (this is why we can't directly understand what we see in the table through hbase shell)
(4) like Hadoop, the Hbase goal relies mainly on scale-out, increasing computing and storage capacity by increasing the number of cheap commercial servers (that is, simply expanding Datanode and Regionserver).
two。 About tables (Table)
(1) large: a table can have hundreds of millions of rows and millions of columns
(2) column-oriented: column-oriented storage and permission control, column (family) independent retrieval
(3) sparse: for empty (null) columns, no space is occupied.
3. About row keys (Rowkey)
(1) Rowkey is the primary key, and there are only three ways to query rows: Get a single Rowkey; through the entire Region;Scan table where Rowkey is located.
(2) the maximum length of Rowkey is 64kb, and the practical application is generally 10-100bytes. At the bottom of Hbase, Rowkey is saved as a byte array.
(3) the underlying storage of Rowkey is stored in dictionary order, so we should pay attention to the design of Rowkey when using it.
Dictionary order: 1, 10, 100, 11, 12, 13, 14, 14, 20.
So to maintain the natural shaping order, you need to use 0 as the left fill.
4. About column families (Column Family)
(1) the column family is part of the Schema, so the table should be declared (but the column is not).
(2) practical applications can do permission control based on column families, specifying that some applications can be read, some can be written, and so on.
5. About timestamps (Timestamp)
The storage unit determined by row and columns in HBase is called cell. Each cell holds multiple versions of the same data. The version is indexed by timestamp. The type of timestamp is 64-bit integer. The timestamp can be assigned by hbase (automatically when the data is written), where the timestamp is the current system time accurate to milliseconds. The timestamp can also be explicitly assigned by the customer. If the application wants to avoid data version conflicts, it must generate its own unique timestamps. In each cell, different versions of the data are sorted in reverse chronological order, meaning that the latest data comes first.
In order to avoid the burden of management (including storage and indexing) caused by too many versions of data, hbase provides two ways to recycle data versions. One is to save the last n versions of the data, and the other is to save the most recent version (for example, the last seven days). You can set it for each column family.
1.6 comparison of row storage and column storage
(1) Row storage:
(2) column storage:
Thank you for reading this article carefully. I hope the article "what are the basic knowledge points of 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.