SlideShare a Scribd company logo
Real-time analytics with
Flink and Druid
郭二文
資深經理 @ 緯創資通 企業應用系統
DataCon.TW 2017
緯創資通
有關講者
• 5年的生產管理/物料管理
• 3年的MES/SFC系統開發運維
• 3年的ERP (SAP-MM模組)/EAI 的導入開發Leader
• 2年的End-To-End Business Integration Analyst
• 1年的OEM Sales Team Leader
• 4年的企業營運分析/集團合併財報系統
• 4年的大數據新技術研究/推廣
• 超級鐵人三項226 Finisher
有關大數據技術研究/推廣
• 企業內部
• 方向
• 以公司需求出發, 從國內外社群找尋類似或可借鏡的案例分享
有關大數據技術研究/推廣
• 社群
• 取之於社會, 用之於社會
• 創立 http://eighty20.cc
• 方向
• 去除公司業務相關的資訊
• 專注技術整合/案例/經驗分享
• 2016 - SPARK 手把手 - 快速上手營 (6個session , 18小時)
• Taiwan R User Group/MLDM Monday 社群
• 2016 – Realtime WebApp 手把手 (3個session , 9小時)
• Taiwan Spark User Group 社群
• 2017 – ELK + Grafana手把手 (3個session , 9小時)
• Taiwan Spark User Group 社群
摘要
• 問題
• Business Intelligence Analytics For Time Series Data
• 可能的解決方案
• Choosing The Right Tools For The Job
• 架構
• End-to-end Data Pipeline
問題/挑戰
問題/挑戰
Source:http://www.dreamwerkztechnologies.com/dwz-inventory-management/
問題/挑戰
Source: https://logicyyc.com/2017/04/27/industry-4-0/
問題/挑戰
問題/挑戰
• Operational Information層級
• 使用人數最多, 常常因為軟體license的問題導致很多手動報表
• 需要非常動態的Query/Filter/Aggregation的功能
• 需要更及時的資料
• 需要底層的交易資料
要便宜
問題/挑戰
要快要好
功能
資料
速度
支援
人數
問題/挑戰
• 構建接近實時商業智能(BI)時間序列分析系統
• 很大量Operation層級的使用者
• Many users
• 很高的查詢/聚合需求的並發量
• High concurrency
• 很快的查詢/聚合結果產出
• Low latency , sub-second response
• 很大量的即時與歷史數據
• Large volume of history & current data
問題/挑戰
• 構建接近實時商業智能(BI)時間序列分析系統
• 當要處理資料量是很巨大的時候, 要用什麼架構呢?
• 外面有許許多的的解決方案、手法及廠商, 該選什麼呢?
• 要如何選擇對工具呢?
要快
要便宜
要好
可能的解決方案
使用RDBMS的解決方案
Business Intelligence Application
RDBMS
Event Data
ETL
使用RDBMS的解決方案
• 傳統資料倉儲
• Row store
• Start schema
• Aggregate tables
• Query cache
• Scanning raw data is slow and expensive
使用Apache Kylin的解決方案
Business Intelligence Application
Kylin / HBase
Event Data
ETL
使用Apache Kylin的解決方案
• 分布式多维分析(OLAP)引擎
• 串流資料導入的案例較少
** 尚未進行深入研究與測試 **
(值得關注的專案)
使用一般化的大數據解決方案
Business Intelligence Application
Spark SQL / Impala
Event Data
ETL
使用一般化的大數據解決方案
• 把資料載入到Hadoop
• 透過Spark SQL或Impala的工具
來查詢/過濾/聚合
• 利用Tableau或PowerBI來作資
料視覺化的呈現與互動性的分
析
使用一般化的大數據解決方案
• 構構建接近實時商業智能(BI)時間序列分析系統
• 很大量Operation層級的使用者
• Many users (有license的考量 Tableau, PowerBI)
• 很高的查詢/聚合需求的並發量
• High concurrency (Spark / Impala不易支持上百個使用者的同時操作)
• 很快的查詢/聚合結果產出
• Low latency , sub-second response (不容易調優到秒級的回應)
• 很大量的即時與歷史數據
• Large volume of history & current data (新的資料必需累積到128MB或10分鐘
才能以Parquet 的格式轉入HDFS)
使用Elastic的解決方案
Business Intelligence Application
Elasticsearch
Event Data
ETL
使用Elastic的解決方案
• Pros:
• 集群架設簡單
• 很高的查詢/聚合需求的並發量
• 很快的查詢/聚合結果產出
• 可查詢即時與歷史數據
• Cons:
• 展現層的out-of-box元件較少
• 難與傳統的BI工具結合使用
• 權限管理/認證需要commercial 的
license
• 需具備二次開發的能力與人才
• 資料實時的Ingestion Rate需要調優
使用Druid的解決方案
Event Data
Druid
Business Intelligence Application
ETL
使用Druid的解決方案 – 架構
Event
enrichment
Batch Data
Preprocess
Meta data
cache
展現層 - Superset
• Superset是一個視覺/互動的數據探索平台
• 由Airbnb開源, 現為Apache 孵化專案
• 豐富的視覺化元件及簡單直覺數據探索的操作
• 有彈性的authentication/authorization, 可與LDAP做整合
• 與Druid有深度的整合, 利用Druid超快的slice & dice的能力來提
升用者體驗
資料儲存/查詢層 - Druid
• Druid是一個用於大數據實時查詢和分析的高容錯、高性
能開源分佈式系統
• 為分析而設計—Druid是為OLAP工作流的探索性分析而構建,
它支持各種過濾、聚合和查詢
• 快速的交互式查詢—Druid的低延遲數據攝取架構允許事件在它
們創建後毫秒內可被查詢到
• 高可用性—Druid的數據在系統更新時依然可用,規模的擴大和
縮小都不會造成數據丟失
• 可擴展—Druid已實現每天能夠處理數十億事件和TB級數據
Fast Response Time
• Critical for interactive user experience
• Avg query times ~500ms
• 90% percentile under 1 sec
• 99% percentile under 10 sec
• Handle 1000’s of concurrent queries
Arbitrary slicing n’ dicing
• 支持任意過濾、分割和匯總數據的能力
Scalability
• Ability to handle
• petabytes of data
• billions of events/day
• Largest druid cluster
• 50 Trillion+ events
• 50PB+ of raw data
• Over 500TB of compressed query-able data
• Ingestion Rate over 500,000 events/sec
• 10-100K events/sec/core
誰在用Druid?
資料串流處理層- Flink
• Apache Flink是分佈式高性能、高可用與提供準確
的數據流計算的開源流處理框架
• High Performance & Low Latency
• Support for Event Time and Out-of-Order Events
• Exactly-once Semantics for Stateful Computations
• Highly flexible Streaming Windows
• Continuous Streaming Model with Backpressure
• Fault-tolerance via Lightweight Distributed Snapshots
串流處理
串流處理 – Event Enrichment
Event
Event after Enrichment
PART_A 4 2017-09-30 09:31:54SO#04
CATEGORY 4 2017-09-30 09:31:54SO#04 Customer USA PART_A TYPE..
串流處理 – Event Enrichment
Local Cache
(LRU)
Local Cache
(LRU)
Remote Cache
Or
Key/Value Store
參考: https://martin.kleppmann.com/2015/04/23/bottled-water-real-time-postgresql-kafka.html
M
M
M
快取裡頭的資料
會被更新的資料
所取代
M
檢查內部的LRU快取是否存在
相同的鍵值, 如果”是”則以最
新的資料取代
M
要被lookup的主檔資料是怎麼被即時處理與保存的?
串流處理 – Event Enrichment
Local Cache
(LRU)
Local Cache
(LRU)
Remote Cache
Or
Key/Value Store
參考: https://martin.kleppmann.com/2015/04/23/bottled-water-real-time-postgresql-kafka.html
E
E
E
1. 檢查local cache是否存在所需要的鍵值, 如果
有就取出使用
2. 如果沒有, 則從remote cache取回所需要的參
考資料, 並將資料保留在local cache
3. Local cache的資料如果超過設定的size, LRU的
機制會移除最不常使用的資料
M
M
E
E
E
Event是怎麼被豐富化?
總結 - 功能性需求
• 構建接近實時商業智能(BI)時間序列分析系統
• 很大量Operation層級的使用者
• Many users
• 很高的查詢/聚合需求的並發量
• High concurrency
• 很快的查詢/聚合結果產出
• Low latency , sub-second response
• 很大量的即時與歷史數據
• Large volume of history & current data
總結 - 非功能性需求
可維護性
Maintainability
可移植性
Portability
可靠性
Reliability
可擴展性
Scalability
靈活性
Flexibility
審查能力
Auditability
相關說明文件
Documentation
性能
Performance
安全
Security
可用性
Usability
Source: https://www.outsystems.com/blog/2013/03/the-truth-about-non-functional-requirements-nfrs.html
總結 - 功能性+非功能需求
Source: https://www.outsystems.com/blog/2013/03/the-truth-about-non-functional-requirements-nfrs.html
要快
要便宜
要好
白雪公主的故事裡..如果少了這些小矮
人, 那會精彩嗎?
Source: https://devilsadvocatepaper.com/2016/04/06/the-end/

More Related Content

PDF
Data Modeling Best Practices - Business & Technical Approaches
PDF
[Oracle DBA & Developer Day 2012] 高可用性システムに適した管理性と性能を向上させるASM と RMAN の魅力
PPTX
Master the Multi-Clustered Data Warehouse - Snowflake
PDF
InnoDB Internal
PDF
Getting Started with Delta Lake on Databricks
PDF
GraphTalks Frankfurt - Graph-based Metadata Management & Data Governance
PPTX
Elsevier: Empowering Knowledge Discovery in Research with Graphs
PDF
Expanding the control over the operating system from the database
Data Modeling Best Practices - Business & Technical Approaches
[Oracle DBA & Developer Day 2012] 高可用性システムに適した管理性と性能を向上させるASM と RMAN の魅力
Master the Multi-Clustered Data Warehouse - Snowflake
InnoDB Internal
Getting Started with Delta Lake on Databricks
GraphTalks Frankfurt - Graph-based Metadata Management & Data Governance
Elsevier: Empowering Knowledge Discovery in Research with Graphs
Expanding the control over the operating system from the database

What's hot (20)

PDF
Log analytics with ELK stack
PDF
Oracle RAC 19c - the Basis for the Autonomous Database
PDF
How to upgrade like a boss to MySQL 8.0 - PLE19
PDF
Data catalog
PPTX
Splunk Distributed Management Console
PDF
AnalytiX DS - Master Deck
PDF
McAfee - MVISION Cloud (MVC) - Cloud Access Security Broker (CASB) - POC Docu...
PPTX
MongoDB 101
PDF
The three layers of a knowledge graph and what it means for authoring, storag...
PDF
DevSecOps: essential tooling to enable continuous security 2019-09-16
PDF
Snowflake Architecture
PDF
Combining a Knowledge Graph and Graph Algorithms to Find Hidden Skills at NASA
PDF
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...
PPTX
Oracle sharding : Installation & Configuration
PDF
Optimizing the Supply Chain with Knowledge Graphs, IoT and Digital Twins_Moor...
PPTX
You Need a Data Catalog. Do You Know Why?
PDF
Introduction to Microsoft Fabric.pdf
PDF
Oracle GoldenGate Cloud Serviceユーザーズガイド
PPT
Less14 br concepts
Log analytics with ELK stack
Oracle RAC 19c - the Basis for the Autonomous Database
How to upgrade like a boss to MySQL 8.0 - PLE19
Data catalog
Splunk Distributed Management Console
AnalytiX DS - Master Deck
McAfee - MVISION Cloud (MVC) - Cloud Access Security Broker (CASB) - POC Docu...
MongoDB 101
The three layers of a knowledge graph and what it means for authoring, storag...
DevSecOps: essential tooling to enable continuous security 2019-09-16
Snowflake Architecture
Combining a Knowledge Graph and Graph Algorithms to Find Hidden Skills at NASA
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...
Oracle sharding : Installation & Configuration
Optimizing the Supply Chain with Knowledge Graphs, IoT and Digital Twins_Moor...
You Need a Data Catalog. Do You Know Why?
Introduction to Microsoft Fabric.pdf
Oracle GoldenGate Cloud Serviceユーザーズガイド
Less14 br concepts
Ad

Viewers also liked (7)

PDF
SMACK Dev Experience
PPTX
TenMax Data Pipeline Experience Sharing
PDF
Game Analytics & Machine Learning
PPTX
Recency/Frequency and Predictive Analytics in the gaming industry
ODP
Developing Microservices with Apache Camel
PDF
數據營運與指標設計 web analytics 101 slideshare
PDF
運用MMLSpark 來加速Spark 上 機器學習專案
SMACK Dev Experience
TenMax Data Pipeline Experience Sharing
Game Analytics & Machine Learning
Recency/Frequency and Predictive Analytics in the gaming industry
Developing Microservices with Apache Camel
數據營運與指標設計 web analytics 101 slideshare
運用MMLSpark 來加速Spark 上 機器學習專案
Ad

Similar to Realtime analytics with Flink and Druid (20)

PDF
Hadoop con 2015 hadoop enables enterprise data lake
PDF
Etu DW Offload 解放資料倉儲的運算效能
PPTX
動態營運智慧分析 Operational intelligence analysis oia
PPT
民间秘方
PPTX
Big data, big challenge- splunk 幫你解決 big data 議題帶來的挑戰
PPT
Hadoop 與 SQL 的甜蜜連結
PDF
Data Engineering in Taiwan: PAST, NOW and FUTURE
PDF
淺談物聯網巨量資料挑戰 - Jazz 王耀聰 (2016/3/17 於鴻海內湖) 免費講座
PDF
Emc keynote 1130 1200
PPTX
Etu Data Lake
PDF
Trinity BDM - 橋接傳統與未來
PDF
Keynote: What Is the next Big Data?
PDF
ESD 2012 Keynote: What Is the next Big Data?
PPTX
Track A-3 Enterprise Data Lake in Action - 搭建「活」的企業 Big Data 生態架構
PDF
選擇正確的Solution 來建置現代化的雲端資料倉儲
PDF
Big Data 102 - Crossovers 成長之旅導覽 (Keynote for Big Data Taiwan 2013)
PPTX
Hadoop 介紹 20141024
PDF
ActWeis Technology Inc. 艾格亞士科技 簡介產品及服務 (20121026)
PDF
Hadoop Big Data 成功案例分享
PPTX
現代資料庫
Hadoop con 2015 hadoop enables enterprise data lake
Etu DW Offload 解放資料倉儲的運算效能
動態營運智慧分析 Operational intelligence analysis oia
民间秘方
Big data, big challenge- splunk 幫你解決 big data 議題帶來的挑戰
Hadoop 與 SQL 的甜蜜連結
Data Engineering in Taiwan: PAST, NOW and FUTURE
淺談物聯網巨量資料挑戰 - Jazz 王耀聰 (2016/3/17 於鴻海內湖) 免費講座
Emc keynote 1130 1200
Etu Data Lake
Trinity BDM - 橋接傳統與未來
Keynote: What Is the next Big Data?
ESD 2012 Keynote: What Is the next Big Data?
Track A-3 Enterprise Data Lake in Action - 搭建「活」的企業 Big Data 生態架構
選擇正確的Solution 來建置現代化的雲端資料倉儲
Big Data 102 - Crossovers 成長之旅導覽 (Keynote for Big Data Taiwan 2013)
Hadoop 介紹 20141024
ActWeis Technology Inc. 艾格亞士科技 簡介產品及服務 (20121026)
Hadoop Big Data 成功案例分享
現代資料庫

More from Erhwen Kuo (20)

PDF
Datacon 2019-ksql-kubernetes-prometheus
PDF
Cncf k8s Ingress Example-03
PDF
Cncf k8s Ingress Example-02
PDF
Cncf k8s Ingress Example-01
PDF
Cncf k8s_network_03 (Ingress introduction)
PDF
Cncf k8s_network_02
PDF
Cncf k8s_network_part1
PDF
Cncf explore k8s_api_go
PDF
CNCF explore k8s api using java client
PDF
CNCF explore k8s_api
PDF
Cncf Istio introduction
PDF
TDEA 2018 Kafka EOS (Exactly-once)
PDF
啟動你的AI工匠魂
PDF
Spark手把手:[e2-spk-s03]
PDF
Spark手把手:[e2-spk-s02]
PDF
Spark手把手:[e2-spk-s01]
PPTX
06 integrate elasticsearch
PPTX
05 integrate redis
PPTX
04 integrate entityframework
PPTX
03 integrate webapisignalr
Datacon 2019-ksql-kubernetes-prometheus
Cncf k8s Ingress Example-03
Cncf k8s Ingress Example-02
Cncf k8s Ingress Example-01
Cncf k8s_network_03 (Ingress introduction)
Cncf k8s_network_02
Cncf k8s_network_part1
Cncf explore k8s_api_go
CNCF explore k8s api using java client
CNCF explore k8s_api
Cncf Istio introduction
TDEA 2018 Kafka EOS (Exactly-once)
啟動你的AI工匠魂
Spark手把手:[e2-spk-s03]
Spark手把手:[e2-spk-s02]
Spark手把手:[e2-spk-s01]
06 integrate elasticsearch
05 integrate redis
04 integrate entityframework
03 integrate webapisignalr

Realtime analytics with Flink and Druid