The differences between Hbase and RDBMS are as follows: Hbase cells (data items in each data record) are versioned. Rows are in order. Qualifiers can be added by clients freely if the Column families to which they belong exist. The following factors should be considered in Hbase Schema design: 1. Hbase does not have the concept of joins
The large table structure solves this problem by eliminating the need for joins. Note: HBase does not have the concept of join. However, the structure of a large table enables it to solve the problems solved by join operations without the need for join operations.
###2, Row keys design primary keys, Region in alphabetical order (byte array storage).
The write should be scattered, such as order table: order_id is reversed and rowkey is created to facilitate distributed storage and avoid data being stored on individual nodes. For multi-condition query, set this parameter to combined Row key
Note: Read data can only be scanned by row key (and range) or scan, ensuring efficient query ###3, COLUMN family CF design
Keep the number of CF devices as small as possible. It is recommended to have 1 or 2 CF devices. When designing Hbase Schema, ensure that there is only one column family. Both flush and compaction trigger base units at the Region level. If a CF has a large amount of data, the memstores of other CF stores in the entire region are flush. When a compaction happens when the number of store files (not the total store file size) reaches a certain number, a flush that generates a large number of store files usually causes a compaction, When flush or compaction occurs, iO-related loads affect Hbase performance. Therefore, it is important to select a proper number of column families.
First, establish student tables and class schedules
Requirements: Students can select multiple courses, and each course can be selected by multiple students. Query the list of all courses selected by a student. Query the list of students for a course. Students can modify their chosen courses.
The design of the table