Introduction to HBase Example: relationship and difference between family and qualifier in table

Source: Internet
Author: User

The relationship and difference between family and qualifier in table

Just like with MySQL, what we are going to do is table design, MySQL table, row, column in HBase already has a difference, in hbase is mainly table and family and qualifier, these three concepts. Table can be directly understood as tables, and family and qualifier can actually be understood as columns, a family below can have multiple qualifier, so it can be easily understood that the HBase column is a two-level column, that is, family is the first column, Qualifier is the second-level column. Two are parent-child relationships.

talk about the settings of family and qualifier in table
For a table in a traditional relational database, how do you set family and qualifier from a performance perspective when modeling a business transition to hbase?
The most extreme, can each column be set as a family, can also have only one family, but all columns are one of qualifier, then what is the difference?
The more family, the more obvious the advantage of getting each cell data, because both IO and network are reduced, and if there is only one family, then every read will read all the current Rowkey, and there will be some loss on the network and IO.
Of course, if you want to get a fixed number of columns of data, then it is better to write these columns into a family than to set up family separately, because all the data can be retrieved once a request is made.
The above is from the reading aspect to consider, then write? Please refer to this article:
Http://hbase.apache.org/book/number.of.cfs.html
first, the different family are under the same region. Each family will be assigned a memstore, so more family will consume more memory.
Second, the current version of HBase, both flush and compaction, is in region, meaning that when a family reaches the flush condition, all the family of that part will flush once, Small files are generated even if there is very little data in the memstore that triggers flush. This increases the probability that the compaction will occur, and compaction is also in region, so it is easy to take compaction storms to reduce the overall throughput of the system.
Thirdly, since hfile is based on family, the data is dispersed to more hfile for multiple family, reducing the probability of split occurrence. This is a double-edged sword. Fewer split will cause the region to be larger in size, because the balance is based on the number of numbers rather than sizes, which can cause balance to fail. On the good side, fewer split will allow the system to provide more stable online services.
The benefits of the 3rd above are obvious for online applications, and the downside is that we can avoid them by manually split and balance at the lowest time of the request.
Therefore, to write more systems, if it is offline should be, we try to use only one family good, but if it is an online application, it should be based on the situation of the application of reasonable allocation of family.

Introduction to HBase Example: relationship and difference between family and qualifier in table

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.