HBase Global Secondary Index Sample Program Development Roadmap
HBase allows you to use global secondary indexes to accelerate conditional queries. This case shows you how to manage and use global secondary indexes.
This sample program applies only to MRS 3.3.0 and later versions.
Scenario
Assume the application you develop needs to record user information and addresses. The following table lists the recorded data.
| id | name | age | address |
|---|---|---|---|
| 1 | Zhang | 20 | CityA |
| 2 | Li | 30 | CityB |
| 3 | Wang | 35 | CityC |
Data Preparation
Proper design of a table structure, RowKeys, and column names enable you to make full use of HBase advantages. The global secondary index is used in the scan condition query scenario. The query is performed by the index table. You do not need to pay attention to the rowkey of the user table. In this example, the rowkey format of the user table is "r1", "r2", "r3".... All columns are stored in the info column family.
Sample Description
The example introduces the creation, status modification, deletion, and query of global secondary indexes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot