HBase Data Model

Source: Internet
Author: User

Row Key

    1. Similar to the primary key in MySQL, HBase naturally comes with no need to display the specified when it is created.
    2. There are only three ways to access the rows in the table:①. Access ② with a single row key. Range ③ for the given row key . Full Table Scan
    3. The row key is stored in the dictionary order , taking into account the nature of the sorting store and putting together the row stores that are often read together (positional dependencies).

Attention:

    • The result of the dictionary ordering of int is 1,10,100,11,2,20,21,..., 9. To maintain the natural order of shaping, the row key must be left padded with 0 .
    • one read and write of a row is an atomic operation (no matter how many columns are read or written at a time), so that multiple users cannot concurrently update the same row.

Column Family

  1. Manually specified when the table is built, containing one or more columns
  2. Data in the column family is stored in binary form on HDFs with no data type
  3. add A new column family: First disable ' users '/alter ' users ', ' info '/enable ' users '.
  4. Delete column family mode: First disable ' users '/alter ' users ',{name=> ' info ',method=> ' delete '}/enable ' users '
  5. Column families cannot be renamed: The usual practice is to use the API to create a new column family with the desired name, then copy the data past, and then delete the old column family.
  6. Each column family is stored in a separate file on HDFs, and null values are not saved.
  7. Access control, disk, and memory usage statistics are performed at the column family level.
  8. the elements in the column family are best to have the same reading and writing methods (such as strings of equal length) to improve performance.

Column

    1. Column names are added dynamically when adding data, without specifying when the table is being built
    2. Set column values: Put ' users ', ' xiaoming ', ' info:age ', ' 18 '
    3. Read column values: Get ' users ', ' Info:age '

TimeStamp

    1. The default value is the system time stamp , or it can be explicitly assigned by the customer.
    2. In each cell, different versions of the data are sorted in reverse chronological order , that is, the most recent data is in the front row.
    3. If an application avoids data timestamp collisions, it must generate its own unique timestamp.

Cell

    1. The only storage unit determined by the " row key + column family: Column name " in HBase is called the cell.
    2. Each cell holds multiple versions of the same piece of data, each indexed by timestamp time Stamp .
    3. Each version of the cell is determined by the row key + column family: Column name + timestamp .

HBase Data Model

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.