Apache Kylin 云原生架构 思考及规划
演讲人 史少锋
Kyligence 首席架构师 Apache Kylin PMC & Committer
Effective Cloud User Group www.ecug.org 关于 Apache Kylin
Extreme OLAP Engine for Big Data
Apache Kylin™ 是一个开源的分布式分析引擎,为 Hadoop 等大 型分布式数据平台之上的超大规模数据集通过标准 SQL 查询及多 维分析(OLAP)功能,提供亚秒级的交互式分析能力。
官方网站: https://kylin.apache.org
Effective Cloud User Group www.ecug.org 发展历史
2014年10月 2015年11月 2017年4月 开源并加入 毕业成为 Apache 发布 Kylin-2.0, 支持 Apache 孵化器项目 顶级项目 雪花模型和 Spark
2013年9月 2015年9月 2016年9月 2019年12月 项目启动 InfoWorld 二次获得 InfoWorld 发布 Kylin 3.0,支持 最佳开源大数据工具奖 最佳开源大数据工具奖 实时分析
Effective Cloud User Group www.ecug.org Apache Kylin 基础架构
- Build OLAP cube on Hadoop Data analytics Interactive Reporting Dashboard - Support TB to PB level data
- Sub-second query latency
- ANSI-SQL OLAP / Data mart Apache Kylin - JDBC / ODBC / REST API
- BI integration
Hive / Kafka / Hadoop MR/Spark HBase / Parquet - Web GUI RDBMS - LDAP/SSO
Effective Cloud User Group www.ecug.org OLAP 与 OLAP Cube
联机分析处理(英语:Online analytical processing),简称OLAP,是计算机技 术中快速解决多维分析问题(MDA)的一种方法。– 维基百科
Cube 是 OLAP 的核心数据结构,基本操作:
• 上卷 Roll-up
• 下钻 Drill-down
• 切片 Slice and dice
• 旋转 Pivot
Effective Cloud User Group www.ecug.org 理论基础:空间换时间
• Cuboid: 一种维度组合
• Cube: 所有的维度组合
• 每个 Cuboid 可以从上层 Cuboid 聚合计算而来
Kylin 会选择满足条件的最小的 Cuboid 回答查询
Effective Cloud User Group www.ecug.org 无 Cube 的 SQL 执行
select l_returnflag, o_orderstatus, Sort sum(l_quantity) as sum_qty, sum(l_extendedprice) as sum_base_price from Agg v_lineitem inner join v_orders on l_orderkey = o_orderkey Filter where l_shipdate <= '1998-09-16' 无预计算, 全部现场计算 group by Join l_returnflag, o_orderstatus order by l_returnflag, Table Table o_orderstatus;
时间复杂度 O(N)
Effective Cloud User Group www.ecug.org 使用 Cube 的 SQL 执行
Sort
Agg Sort
Filter Filter
有预计算,基于 出结果, Join Cube I/O 少,计算少,延迟低 Cube 预聚合数据 Table Table
时间复杂度 O(1)
Effective Cloud User Group www.ecug.org 性能对比
PB 级数据上的亚秒级查询能力