1、Apache Flink的過去、現在和未來楊克特(魯尼)阿里巴巴高級技術專家過去一切從20142014年開始2009-20142014柏林工業大學博士生項目基于流式 runtimeruntime 的批處理引擎20142014 年 8 8 月份 發布 FlinkFlink 0.6.00.6.0Flink 0.7RuntimeDistributed Streaming DataflowDataStream APIStream ProcessingDataSet APIBatch Processing20142014 年 1212 月份 發布 開始正式支持 DataStreamDataStreamF
2、link 0.9SinkSource OffsetComputation StatePeriodic Snapshots20152015 年 6 6 月份 發布 開始內置支持 StateStateGlobal Checkpoint新數據老數據Checkpoint Barrier NCheckpoint Barrier N-1Part ofCheckpoint N+1Part ofCheckpoint NPart ofCheckpoint N-1吞吐和延遲不再是一個 tradeofftradeoff支持精準一次的語義,同時對性能的影響較低基于 ChandyChandy LamportLampor
3、t 算法Flink 1.0 版本基石Checkpoint基于 ChandyChandy-LamportLamport算法,實現了分布式一致性快照,提供了一致性的語義。豐富的 StateState APIAPI。ValueStateValueState,ListStateListState,MapStateMapStateBroadcastStateBroadcastState。支持基于事件時間的計算,實現 Watermark Watermark 機制。亂序數據處理,遲到數據容忍。開箱即用的滾動、滑動、會話窗口。以及靈活的自定義窗口。StateTimeWindow2015 年阿里巴巴開始使用 F
4、link 并持續貢獻社區重構分布式架構ClientDispatcherJob ManagerTask ManagerResource ManagerCluster ManagerTask Manager1.Submit job2.Start job3.Request slots4.Allocate Container5.Start Task Manager6.Schedule TaskYARN RMK8S RM增量 CheckpointCheckpoint時間全量狀態增量狀態增量 snapshot基于 creditcredit 的流控機制Streaming SQLStreaming SQL-|
5、USER_SCORES|-|User|Score|Time|-|Julie|7|12:01|Frank|3|12:03|Julie|1|12:03|Frank|2|12:06|Julie|4|12:07|-|-inf,12:01)|-|Name|Score|Time|-|-|-12:01,12:04)|-|Name|Score|Time|-|Julie|8|12:03|Frank|3|12:03|-|-12:04,now)|-|Name|Score|Time|-|Julie|12|12:07|Frank|5|12:06|-|-Stream Mode:12:01 SELECT Name,SUM(
6、Score),MAX(Time)FROM USER_SCORES GROUP BY Name;FlinkFlink 在阿里的服務情況集群規模超萬臺狀態數據PetaBytes事件處理十萬億/天峰值能力17億/秒FlinkFlink 的過去offlineReal-timeBatchProcessingContinuous Processing&Streaming AnalyticsEvent-drivenApplications現在Flink 1.9 Flink 1.9 的架構變化RuntimeDistributed Streaming DataflowQuery ProcessorDAG&Str
7、eamOperatorLocalSingle JVMCloudGCE,EC2ClusterStandalone,YARNRuntimeDistributed Streaming DataflowDataStream APIStream ProcessingDataSet APIBatch ProcessingTable API&SQLRelationalTable API&SQLRelationalLocalSingle JVMCloudGCE,EC2ClusterStandalone,YARNDataStreamPhysical統一 OperatorOperator 抽象Pull-based
8、 operatorPush-based operator算子可自定義讀取順序Table API&SQL 1.9 新特性全新的 SQL類型系統DDL初步支持Table API增強統一的Catalog APIBlink PlannerWhats new in Blink PlannerWhats new in Blink Planner數據結構二進制化更豐富的內置函數Minibatch聚合函數多種解熱點手段維表關聯支持TopN高效的流式去重完整的批處理支持批處理錯誤恢復(1 1)批處理錯誤恢復(2 2)批處理錯誤恢復(3 3)批處理錯誤恢復(4 4)批處理錯誤恢復(5 5)插件化 ShuffleS
9、huffle ManagerManager生態FlinkHiveFlinkZeppelin中文社區FlinkFlink 的現在offlineReal-timeBatchProcessingContinuous Processing&Streaming AnalyticsEvent-drivenApplications未來Micro ServicesO_0O_1I_0I_1I_2P_0P_1P_2S_0S_1OrderOrderInventoryInventoryPaymentPaymentShippingShippingFlow-ControlAsync CallAuto ScaleState ManagementEvent DrivenFlinkFlink 的未來offlineReal-timeBatchProcessingContinuous Processing&Streaming AnalyticsEvent-drivenApplications