Quick introduction to Phoenix: SQL on hbase

Source: Internet
Author: User

Author: Liu Xuhui Raymond reprinted. Please indicate the source

Email: colorant at 163.com

Blog: http://blog.csdn.net/colorant/

Faster understanding of Multi-cloud computing-related projects http://blog.csdn.net/colorant/article/details/8255910

= What is =

 

Target scope

 

Easystandard SQL access on top of hbase

 

Official definition

 

A SQL layer over hbase delivered as a client-embedded JDBC drivertargeting low latency queries over hbase data

 

Personal Understanding

 

Unlike hive on hbase, Phoenix
Plan is implemented directly using hbaseapi to avoid mapreduce framework and reduce query time delay.

 

= Architecture =

 

In Phoenix, the execution of SQL query plan is basically based on the construction of a series of hbase
Scan to complete.

 

To minimize data transmission, use coprocessor on the region server to perform aggregate-related work as much as possible. The basic idea is to use regionobserver on the postscanneropen
In the hook, replace regiongate with a customized worker that supports aggregation. The specific aggregate operation is passed to regiongate through the scan attribute of custom. Compared with the mapreduce-based framework execution plan, it basically uses coprocessor to use regionserver itself to execute aggregation on each node.

 

In addition, through a variety of customized filters in the hbase region.pdf
During the scan process, irrelevant data is filtered out as early as possible.

 

Use JDBC interfaces to interact with applications.

 

= Implementation =

 

Currently, you can create, modify, delete, filter, search, and other SQL syntaxes for simple tables. In terms of syntax, multi-Table operations are not supported, essentially, multi-table join operations such as various join operations are not supported, so the where part cannot be compared with multiple tables.

 

I personally think that due to coprocessor and
Limitations of the filter's own capabilities. If the map reduce framework is completely independent, it is relatively difficult to implement complex query operations, such as multi-Table Union operations, only through hbaseclient APIs, or a lot of work needs to be done in the client code, and the performance may not meet the requirements.

 

From roadmap, we plan to support hash
To consider the performance of join, I guess the general implementation idea is to save the results of the small table for the first scan in memory in some way for matching during the second scan, the status should be retained between scans. I don't know how to implement phoneix.

 

In addition, the secondary index is also under planning. No secondary
Index, obviously, the query efficiency is greatly reduced.

 

Then, based on hbase's TS basedversion and non-restrictive qualifier features, we plan to implement some relatively interesting functions, such as dynamic column, nested data structure, schema evolution, and so on.

 

Applicable fields

 

If you cannot find a better way to implement join operations, and the multi-Table operations cannot be efficiently implemented, you should only be able to perform simple filtering, sorting, and single-Table search operations. According to the official statement, it is applicable to simple queries with 10-m rows.

 

However, considering the design philosophy of hbase tables, we try to use the redundant data space to reduce complexity. In fact, we can put all the relevant data in the same table, instead of reducing data redundancy, splitting data into multiple tables can avoid the lack of Phoenix's ability to perform multi-table join operations (of course, all data is stored in one table, if there is a burden and consistency problem for the update operation, it should be split)

 

= Related literature =

 

Syntax: http://forcedotcom.github.com/phoenix/

Wiki home: https://github.com/forcedotcom/phoenix/wiki

Code: https://github.com/forcedotcom/phoenix

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.