27
Blink:阿里新一代实时计算引擎 马国维 2017.4

Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Blink:阿里新一代实时计算引擎

马国维

2017.4

Page 2: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM
Page 3: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Who am I?

2010 – 2017 Alibaba Search

• iStream

• Blink

2007 – 2010 Baidu Web Search

Page 4: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Outline

1 The Streaming Architecture

2 What is Flink

3 What is Blink

4 Future Plans

Page 5: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

The streaming architecture

Part I

Page 6: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

What is streaming?

What is streaming?

• Unbounded data

What is streaming process engine?

• The data process engine that is

designed with infinite data set in

mind

Your code

Your code

Your code

Your code

Page 7: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

What is stateful streaming

Computation and state

• E.g., counters, windows of past events,

state machines, trained ML models

Result depends on history of stream

Stateful stream processor gives the

tools to manage state

• Recover, roll back, version, upgrade, etc

Your code

state

Page 8: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

What is event-time streaming

Data records associated with timestamps (time

series data)

Processing depends on timestamps

Event-time stream processor gives you the

tools to reason about time

• E.g., handle streams that are out of order

• Core feature is watermarks – a clock to measure

event time

Your code

state

t3 t1 t2t4 t1-t2 t3-t4

Page 9: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Streaming Subsumes Batch

2016-3-112:00 am

2016-3-11:00 am

2016-3-12:00 am

2016-3-1111:00pm

2016-3-1212:00am

2016-3-121:00am

2016-3-1110:00pm

2016-3-122:00am

2016-3-123:00am

partition

partition

Stream (low latency)

Batch

(bounded stream)Stream (high latency)

Page 10: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

What is Flink?

Part 2

Page 11: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Flink - Streaming Compute Engine

Latency

Volume/

Throughput

State &

Accuracy

Exactly-once semantics

Event time processing

10s of millions evts/sec

for stateful applications

Latency down to the milliseconds

http://flink.apache.org

Page 12: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Flink – Unified Compute Engine

Flink

Streaming topologies

Long batch pipelines Machine Learning at scale

Graph Analysis

Low latency

resource utilization iterative algorithms

Mutable state

Page 13: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Flink EcosystemST

OR

AG

E

FilesLocal, HDFS, …

DatabasesCassandra, HBase, …

Streams Flume, Kafka, …

LocalSingle JVM

ClusterStandalone, YARN, Mesos, …

CloudGoogle’s GCE, Amazon’s EC2, …

DEP

LOY

Runtime - Distributed Streaming Dataflow

Ru

nti

me

DataSet (Java/Scala)Batch Processing

DataStream (Java/Scala)Stream Processing

Tab

le(R

elat

ion

al)

AP

Is &

LIB

RA

RIE

S

CEP

(Eve

nt

Pro

cess

ing)

Tab

le(R

elat

ion

al)

FLin

kML

(Mac

hin

eLe

arn

ing)

Gel

ly(G

rap

hP

roce

ssin

g)

Page 14: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Checkpoint/Recovery

9/2/2016 stream_barriers.svg

file:///Users/kkloudas/Desktop/stream_barriers.svg 1/1

checkpointbarrier n­1

data stream

stream record(event)

checkpointbarrier n

newer records

part ofcheckpoint n­1

part ofcheckpoint n

part ofcheckpoint n+1

older records

• Chandy-Lamport algorithm

• Periodic asynchronous consistent snapshots of application state

• Provide exactly-once state guarantees under failures

Page 15: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Stateful Steam Processing

Scalable embedded state

Access at memory speed &

scales with parallel operators

Page 16: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

What is Blink?

Part 3

Page 17: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Blink – Alibaba’s version of Flink

Looked into Flink two years ago• best choice of unified computing engine

• a few of issues in flink that can be problems for large scale applications

Started Blink project• aimed to make Flink work reliably and efficiently at the very large scale at Alibaba

Made various improvements in Flink runtime• native run on yarn cluster

• failover optimizations for fast recovery

• incremental checkpoint for super large state

• async operator for high throughputs

Working with Flink community to contribute back since last August• several key designs

• hundreds of patches

Page 18: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Blink in Alibaba Production

In production for almost one year

More than 3000 nodes are running Blink

The largest Blink cluster is more than 1000 nodes

There are hundreds of production jobs supported by Blink

Supported key online Service on last Nov 11th

• The largest Blink job has 5000 concurrent, 10TB state, billions of QPS

• Based on the Blink machine learning platform to significantly increase the transaction

conversion

Page 19: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Blink Ecosystem in Alibaba

Hadoop YARN (Resource Management)

Search

HDFS (Persistent Storage)

Table APIBlink

Alibaba Apps Recommendation BI Security

DataStream API

Runtime Engine

Ads

DataSet API

Machine Learning Platform (Porsche)

SQL

Ant

Page 20: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Use Case — Search Index Build & Update

Page 21: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Use Case — Realtime A/B Test

Page 22: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Use Case — Online Machine Learning

Page 23: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Blink Architecture

YARN (Resource Management)

HDFS (Persistent Storage)

Blink Runtime

YARN App Master

Resource Manager

Job Manager

Task Manager

Tasks

Rocksdb State Backend

Web Monitor

Flink Client

Alibaba Data Lake

Submit Job

Launch AM Request TM Launch TM

Metrics

Apache Flink Alibaba Blink

Alibaba Monitor SystemMetric Reporter

ConnectorsRead/Write

Checkpoint Incrementally

Debug

Task Scheduling

CheckpointCoordination

Page 24: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Improvements to Flink Runtime

Native integration with Resource Managment for dynamic resource allacation and more

larger scale

Performance Improvements

• Incremental Checkpoint

• Asynchronous Operator

Failover Optimization

• Fine-grained Recovery for Task Failures

• Allocation Reuse for Task Recovery

• Non-disruptive JobManager Failures via Reconciliation

Page 25: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Future Plans

Section 4

Page 26: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

Future Plans

Blink is already popular in the streaming scenarios

• more and more streaming applications will run on blink

Make batch applications run on production

• increase the resource utilization of the clusters

Blink as Service

• Alibaba Group Wide

Cluster is growing very fast

• cluster size will double

• thousands of jobs run on production

Page 27: Blink:阿里新一代实时计算引擎 - Huodongjia.com€¦ · Flink Ecosystem GE Files Local, HDFS, … Databases Cassandra, HBase, … Streams Flume, Kafka, … Local Single JVM

THANKS--------- Q&A Section --------