All Products
Search
Document Center

ApsaraDB for HBase:Secondary indexes

Last Updated:Oct 23, 2023
Important

We recommend that only users who are familiar with HBase API use secondary indexes because of the limitations on the open source HBase API. We recommend that you use secondary indexes by implementing the Lindorm SQL feature.

Overview

ApsaraDB for HBase supports rowkey (primary key) indexing, allowing you to sort rows based on the binary order of rowkeys. Based on rowkey indexing, row scans, prefix scans, and range scans can be performed efficiently. However, if you want to query a table based on columns other than rowkeys, you must use filters to narrow down the range of rowkeys. Otherwise, a full table is scanned. This wastes resources and increases response time.

Many solutions are provided for users to query HBase data in multiple dimensions. For example, you can create a secondary index table based on the columns to query. In this case, you must maintain the secondary index table. You can also export data to an external system, such as Solr or Elasticsearch, and then index the data.

However, we recommend that you do not use search engines such as Solr or Elasticsearch if you perform common queries based on few columns. This wastes resources. ApsaraDB for HBase Performance-enhanced Edition offers a solution that uses native secondary indexes to query HBase data with lower costs. Secondary indexes are built in ApsaraDB for HBase to support high throughput and performance. This solution has been tested in business such as Double 11 Shopping Festivals of Alibaba Group for many years. It is suitable for indexing large amounts of data.