Kylin is an open source distributed data analytics engine on top of SparkSQL/Hive. It offers SQL interface to do OLAP on large datasets. Kylin is not a replacement for a massive parallel processing engine like Hive and Presto. It runs on top of these systems as a query accelerator. [04][05][06]
- Website
- http://www.kylin.io[01]
- Source Code
- https://github.com/apache/kylin[02]
- Tech Docs
- https://kylin.apache.org/docs[03]
- @ApacheKylin
- Developer
- Governance
- Apache Software Foundation
- Country of Origin
- CN
- Start Year
- 2013 [04]
- Former Name
- KylinOLAP
- Project Type
- Open Source
- Written in
- Java
- License
- Apache v2
The way Kylin works is that it pre-calculates a set of data cubes, stores them in HBase, and directly looks up the results in them when receiving queries. If a query cannot be answered by the data cubes, it will be executed by the underlying process engine (like Hive). The data cubes are built when the dataset is imported. The user is responsible to specify which data cubes should be built.
Kylin is an open source distributed data analytics engine on top of SparkSQL/Hive. It offers SQL interface to do OLAP on large datasets. Kylin is not a replacement for a massive parallel processing engine like Hive and Presto. It runs on top of these systems as a query accelerator.
The way Kylin works is that it pre-calculates a set of data cubes, stores them in HBase, and directly looks up the results in them when receiving queries. If a query cannot be answered by the data cubes, it will be executed by the underlying process engine (like Hive). The data cubes are built when the dataset is imported. The user is responsible to specify which data cubes should be built.[04][05][06]
History[04]
The Kylin project was started in 2013, from eBay's R&D in Shanghai, China. It was open sourced on Github as "KylinOLAP" in Oct 2014.
In Nov 2015, Kylin joined Apache Software Foundation incubator;
In Dec 2015, Apache Kylin became a Top Level Project.
Compression[07]
Kylin applies dictionary encoding to all dimension values in data cubes. Kylin's dictionary is order-preserving and supports mapping both from keys to values and vice versa. The dictionary is implemented as a radix tree. Each node in the radix tree also contains the size of its subtree to support mapping values back to keys.
Kylin also supports naive compression algorithms in HBase and Hive.
Data Model[08]
Data cubes are stored as HBase tables. Given a dimension column set, Kylin pre-aggregates all possible combinations of their attributes by map-reduce jobs, then encode the dimensions with dictionary encoding. Finally, Kylin encodes all data cubes to Rowkeys in HBase. The format of a Rowkey is cuboid id + attribute. For example, assume a data cube on year and city with cuboid id 00000001, and there is a row year=1994, city=Beijing, sum(sales)=100, and a dictionary maps 1994=0, Beijing=1, there will be an entry in the HBase table Rowkey=00000001+01, value=100.
Foreign Keys[09]
Kylin supports star schema and snowflake schema. A user needs to specify fact tables and lookup tables before building cubes. Kylin pre-joins the tables when building data cubes.
Joins[10]
On cube building phase, Kylin use Hive to pre-join the fact table and lookup tables.
On query time, table joins are supported by the Apache Calcite. Calcite will decompose the join operator several single table lookup operators and each of them will be completed by Kylin.
Query Execution[12]
Kylin relies on HBase to execute queries. HBase is a tuple-at-a-time execution engine.
Query Interface[05]
Kylin supports a subset of Apache Calcite's supported queries. Since Kylin is a pure OLAP engine, it only supports SELECT queries. INSERT, UPDATE and DELETE are not supported.
Storage Architecture[13]
Kylin stores the data cubes in HBase, and stores metadata in HBase or MySQL (MySQL metastore is still under test).
System Architecture[14]
Kylin uses HBase to store data cubes, which stores data in HDFS. The raw table is still stored in the underlying system.
Citations
15 sources- http://www.kylin.io kylin.io
- GitHub - apache/kylin: Apache Kylin · GitHub github.com
- Index of /docs apache.org
- Apache Kylin - Wikipedia wikipedia.org
- http://kylin.apache.org/docs/gettingstarted/faq.html apache.org
- 403 Forbidden jianshu.com
- http://kylin.apache.org/blog/2015/08/13/kylin-dictionary/ apache.org
- 编程小梦|Apache Kylin Cube 构建原理 bcmeng.com
- http://kylin.apache.org/cn/docs/tutorial/create_cube.html apache.org
- https://zhuanlan.zhihu.com/p/29108193 zhihu.com
- Apache Kylin – Cubes on Hadoop | PPTX slideshare.net
- Apache HBase® Reference Guide apache.org
- http://kylin.apache.org/docs/tutorial/mysql_metastore.html apache.org
- https://dbdb.io/db/hbase dbdb.io
- Column family - Wikipedia wikipedia.org