Apache Flink Next-gen data analysis. Kostas Tzoumas ktzoumas@apache.org @kostas_tzoumas



Similar documents
The Flink Big Data Analytics Platform. Marton Balassi, Gyula Fora" {mbalassi,

Apache Flink. Fast and Reliable Large-Scale Data Processing

Unified Big Data Analytics Pipeline. 连 城

Introduction to Spark

Apache Spark 11/10/15. Context. Reminder. Context. What is Spark? A GrowingStack

Scaling Out With Apache Spark. DTL Meeting Slides based on

The Stratosphere Big Data Analytics Platform

Big Data Research in Berlin BBDC and Apache Flink

Systems Engineering II. Pramod Bhatotia TU Dresden dresden.de

Hadoop Ecosystem Overview. CMSC 491 Hadoop-Based Distributed Computing Spring 2015 Adam Shook

Beyond Hadoop with Apache Spark and BDAS

Hadoop Ecosystem B Y R A H I M A.

Spark in Action. Fast Big Data Analytics using Scala. Matei Zaharia. project.org. University of California, Berkeley UC BERKELEY

Apache Spark : Fast and Easy Data Processing Sujee Maniyam Elephant Scale LLC sujee@elephantscale.com

Big Data looks Tiny from the Stratosphere

Unified Big Data Processing with Apache Spark. Matei

Moving From Hadoop to Spark

Big Data Analytics. Lucas Rego Drumond

Big Data and Scripting Systems build on top of Hadoop

How Companies are! Using Spark

Lambda Architecture. Near Real-Time Big Data Analytics Using Hadoop. January Website:

Spark: Making Big Data Interactive & Real-Time

CS555: Distributed Systems [Fall 2015] Dept. Of Computer Science, Colorado State University

Fast and Expressive Big Data Analytics with Python. Matei Zaharia UC BERKELEY

Big Data and Scripting Systems beyond Hadoop

Real Time Data Processing using Spark Streaming

Spark. Fast, Interactive, Language- Integrated Cluster Computing

Welcome to the first Workshop on Big data Open Source Systems (BOSS)

How To Create A Data Visualization With Apache Spark And Zeppelin

brief contents PART 1 BACKGROUND AND FUNDAMENTALS...1 PART 2 PART 3 BIG DATA PATTERNS PART 4 BEYOND MAPREDUCE...385

Big Data at Spotify. Anders Arpteg, Ph D Analytics Machine Learning, Spotify

Spark and Shark. High- Speed In- Memory Analytics over Hadoop and Hive Data

Hadoop Job Oriented Training Agenda

Hadoop & Spark Using Amazon EMR

A Brief Introduction to Apache Tez

Big Data Analytics with Spark and Oscar BAO. Tamas Jambor, Lead Data Scientist at Massive Analytic

Hadoop2, Spark Big Data, real time, machine learning & use cases. Cédric Carbone Twitter

Map Reduce & Hadoop Recommended Text:

Developing Scalable Smart Grid Infrastructure to Enable Secure Transmission System Control

Ali Ghodsi Head of PM and Engineering Databricks

Architectures for massive data management

Outline. High Performance Computing (HPC) Big Data meets HPC. Case Studies: Some facts about Big Data Technologies HPC and Big Data converging

Introduction to Big Data! with Apache Spark" UC#BERKELEY#

Managing large clusters resources

Programming Hadoop 5-day, instructor-led BD-106. MapReduce Overview. Hadoop Overview

YARN, the Apache Hadoop Platform for Streaming, Realtime and Batch Processing

Big Data Frameworks: Scala and Spark Tutorial

Big Data Analytics. Chances and Challenges. Volker Markl

Architectural patterns for building real time applications with Apache HBase. Andrew Purtell Committer and PMC, Apache HBase

Apache Spark and Distributed Programming

CSE-E5430 Scalable Cloud Computing Lecture 11

Apache MRQL (incubating): Advanced Query Processing for Complex, Large-Scale Data Analysis

Spark ΕΡΓΑΣΤΗΡΙΟ 10. Prepared by George Nikolaides 4/19/2015 1

Hadoop MapReduce and Spark. Giorgio Pedrazzi, CINECA-SCAI School of Data Analytics and Visualisation Milan, 10/06/2015

Pilot-Streaming: Design Considerations for a Stream Processing Framework for High- Performance Computing

Apache Ignite TM (Incubating) - In- Memory Data Fabric Fast Data Meets Open Source

Upcoming Announcements

Introduction to Hadoop

Introduction to Big Data with Apache Spark UC BERKELEY

COURSE CONTENT Big Data and Hadoop Training

Introduction to Hadoop. New York Oracle User Group Vikas Sawhney

Hadoop: The Definitive Guide

Why Spark on Hadoop Matters

Hadoop 只 支 援 用 Java 開 發 嘛? Is Hadoop only support Java? 總 不 能 全 部 都 重 新 設 計 吧? 如 何 與 舊 系 統 相 容? Can Hadoop work with existing software?

How To Scale Out Of A Nosql Database

Hadoop in the Enterprise

HiBench Introduction. Carson Wang Software & Services Group

GraySort on Apache Spark by Databricks

Case Study : 3 different hadoop cluster deployments

Cloud Application Development (SE808, School of Software, Sun Yat-Sen University) Yabo (Arber) Xu

Workshop on Hadoop with Big Data

How To Optimize Data Processing In A Distributed System

3 Reasons Enterprises Struggle with Storm & Spark Streaming and Adopt DataTorrent RTS

Analytics on Spark &

Building Scalable Big Data Infrastructure Using Open Source Software. Sam William

In-memory data pipeline and warehouse at scale using Spark, Spark SQL, Tachyon and Parquet

Big Data Primer. 1 Why Big Data? Alex Sverdlov alex@theparticle.com

Implement Hadoop jobs to extract business value from large and varied data sets

Hadoop IST 734 SS CHUNG

MapReduce and Hadoop. Aaron Birkland Cornell Center for Advanced Computing. January 2012

FP-Hadoop: Efficient Execution of Parallel Jobs Over Skewed Data

Big Data Approaches. Making Sense of Big Data. Ian Crosland. Jan 2016

Hadoop and Map-Reduce. Swati Gore

Machine- Learning Summer School

Apache Kylin Introduction Dec 8,

Pro Apache Hadoop. Second Edition. Sameer Wadkar. Madhu Siddalingaiah

Big Data and Apache Hadoop s MapReduce

Big Data With Hadoop

Spark and the Big Data Library

How To Choose A Data Flow Pipeline From A Data Processing Platform

International Journal of Advancements in Research & Technology, Volume 3, Issue 2, February ISSN

Conquering Big Data with BDAS (Berkeley Data Analytics)

Monitis Project Proposals for AUA. September 2014, Yerevan, Armenia

CSE 590: Special Topics Course ( Supercomputing ) Lecture 10 ( MapReduce& Hadoop)

TRAINING PROGRAM ON BIGDATA/HADOOP

Beyond Hadoop MapReduce Apache Tez and Apache Spark

Shark Installation Guide Week 3 Report. Ankush Arora

Transcription:

Apache Flink Next-gen data analysis Kostas Tzoumas ktzoumas@apache.org @kostas_tzoumas

What is Flink Project undergoing incubation in the Apache Software Foundation Originating from the Stratosphere research project started at TU Berlin in 2009 http://flink.incubator.apache.org 58 contributors (doubled in ~ 4 months) Has a cool squirrel for a logo 2

This talk Data processing engines in Hadoop Flink from a user perspective Tour of Flink internals Closing 3

DATA PROCESSING IN THE HADOOP ECOSYSTEM 4

Open source data infrastructure an era of choice Hive Cascading Applications Mahout Pig Data processing engines MapReduce Spark Storm Flink Tez App and resource management Yarn Mesos Storage, streams HDFS HBase Kafka 5

Engine paradigms & systems MapReduce (OSDI 04) Apache Hadoop 1 Dryad, Nephele (EuroSys 07) Apache Tez PACTs (SOCC 10, VLDB 12) Apache Flink (incubating) RDDs (HotCloud 10, NSDI 12) Apache Spark 6

Dryad Small recoverable tasks Sequential code inside map & reduce functions Extends map/reduce model to DAG model Backtracking-based recovery Functional implementation of Dryad recovery (RDDs) Restrict to coarsegrained transformations Direct execution of API Embed query processing runtime in DAG engine Extend DAG model to cyclic graphs Incremental construction of graphs 7

Engine comparison API MapReduce on k/v pairs k/v pair Readers/Writers Transformations on k/v pair collections Iterative transformations on collections Paradigm MapReduce DAG RDD Cyclic dataflows Optimization none none Optimization of SQL queries Optimization in all APIs Execution Batch sorting Batch sorting and partitioning Batch with memory pinning Stream with out-of-core algorithms 8

USING FLINK 9

Data sets and operators Program DataSet A X DataSet B Y DataSet C Operator X Operator Y Parallel Execution A (1) X B (1) Y C (1) A (2) X B (2) Y C (2) 10

Rich operator and functionality set Map, Reduce, Join, CoGroup, Union, Iterate, Delta Iterate, Filter, FlatMap, GroupReduce, Project, Aggregate, Distinct, Vertex-Update, Accumulators Source! Map! Reduce! Iterate! Join! Reduce! Sink! Source! Map! 11

WordCount in Java ExecutionEnvironment!env!=!!!!ExecutionEnvironment.getExecutionEnvironment();! - DataSet<String>!text!=!readTextFile!(input);! - DataSet<Tuple2<String,!Integer>>!counts=!text! --.map-(l!a>!l.split( \\W+ ))!!!.flatmap!((string[]!tokens,!!!!!!!!!!!!!!!collector<tuple2<string,!integer>>!out)!a>!{!!!!!!arrays.stream(tokens)!!!!!!.filter(t!a>!t.length()!>!0)!!!!!!.foreach(t!a>!out.collect(new!tuple2<>(t,!1)));!!!!})!!!.groupby(0)!!!.sum(1);!! env.execute("word!count!example");!!!!!!!! text flatmap reduce counts 12

WordCount in Scala val-env!=!executionenvironment!!!.getexecutionenvironment!! val!input!=!env.readtextfile(textinput)!! val-counts!=!text!!!.flatmap!{!l!=>!l.split("\\w+")!!!!.filter!{!t!=>!t.nonempty!}!}!!!.map!{!t!=>!(t,!1)!}!!!.groupby(0)!!!.sum(1)! - env.execute()! text flatmap reduce counts 13

Long operator pipelines DataSet<Tuple...>!large!=!env.readCsv(...);! DataSet<Tuple...>!medium!=!env.readCsv(...);! DataSet<Tuple...>!small!=!env.readCsv(...);!! DataSet<Tuple...>!joined1!=!large!!!!!.join(medium)!!!!!.where(3).equals(1)!!!!!.with(new!JoinFunction()!{!...!});!! DataSet<Tuple...>!joined2!=!small!!!!!.join(joined1)!!!!!.where(0).equals(2)!!!!!.with(new!JoinFunction()!{!...!});!! DataSet<Tuple...>!result!=!joined2!!!!!.groupBy(3)!!!!!.max(2);!! large! γ!!! medium! small! 14

Beyond Key/Value Pairs DataSet<Page>!pages!=!...;! DataSet<Impression>!impressions!=!...;!!!! DataSet<Impression>!aggregated!=!!!impressions!!!.groupBy("url")!!!.sum("count");!!! pages.join(impressions).where("url").equalto("url")!!! //!custom!data!types!! class!impression!{!!!!!public!string!url;!!!!!public!long!count;! }! class!page!{!!!!!public!string!url;!!!!!public!string!topic;! }! 15

Beyond Key/Value Pairs Why not key/value pairs Programs are much more readable ;-) Functions are self-contained, do not need to set key for successor) Much higher reusability of data types and functions Within Flink programs, or from other programs 16

Iterate operator Iterate Replace initial solution partial solution X Y partial solution iteration result other datasets Step function Built-in operator to support looping over data Applies step function to partial solution until convergence Step function can be arbitrary Flink program Convergence via fixed number of iterations or custom convergence criterion 17

Transitive closure in Java DataSet<Tuple2<Long,!Long>>!edges!=!!! IterativeDataSet<Tuple2<Long,Long>>!paths!=!!!!edges.iterate(10);!! DataSet<Tuple2<Long,Long>>!nextPaths!=!paths!!!.join(edges)!!!.where(1).equalTo(0)!!!.with((left,!right)!A>!{!!!!!!!!return-new-Tuple2<Long,!Long>(!!!!!!!!!!new!Long(left.f0),!!!!!!new!Long(right.f1));})!!!.union(paths)!!!.distinct();!! DataSet<Tuple2<Long,!Long>>!transitiveClosure!=!!!!paths.closeWith(nextPaths);! paths! edges! closure! dis4 nct! U! join! edges! 18

Transitive closure in Scala closure! val-edges!=!!! val-paths!=!edges.iterate!(10)!{!!!!prevpaths:!dataset[(long,!long)]!=>!!!!!prevpaths!!!!!!!.join(edges)!!!!!!!.where(1).equalto(0)!{!!!!!!!!!(left,!right)!=>!!!!!!!!!!!!!!(left._1,right._2)!!!!!!!}!!!!!!!.union(prevpaths)!!!!!!!.groupby(0,!1)!!!!!!!.reduce((l,!r)!=>!l)! }! paths! dis4 nct! U! join! edges! edges! 19

Delta Iterate operator Replace Delta-Iterate initial workset workset A B workset initial solution partial solution X Y delta set iteration result other datasets Merge deltas Compute next workset and changes to the partial solution until workset is empty Similar to semi-naïve evaluation in datalog Generalizes vertex-centric computing of Pregel and GraphLab 20

Using Spargel: The graph API ExecutionEnvironment!env!=!getExecutionEnvironment();!! DataSet<Long>!vertexIds!=!env.readCsv(...);! DataSet<Tuple2<Long,8Long>>!edges!=!env.readCsv(...);!! DataSet<Tuple2<Long,8Long>>!vertices!=!vertexIds!!!!!!.map(new!IdAssigner());!! DataSet<Tuple2<Long,8Long>>!result!=!vertices.runOperation(!!!!!!!!!VertexCentricIteration.withPlainEdges(!!!!!!!!!!!!!!!!!!!edges,!new!CCUpdater(),!new!CCMessager(),!100));!! result.print();! env.execute("connected!components");! Pregel/Giraph-style Graph Computation 21

Spargel: Implementation Spargel is implemented in < 500 lines of code on top of delta iterations 22

Hadoop Compatibility Flink supports out-of-the-box supports Hadoop data types (writables) Hadoop Input/Output Formats Hadoop functions and object model Input! Map! Reduce! Output! S DataSet Red DataSet Join DataSet Output! Input! DataSet Map DataSet 23

FLINK INTERNALS 24

Distributed architecture val-paths!=!edges.iterate!(maxiterations)!{!!!!prevpaths:!dataset[(long,!long)]!=>!!!val-nextpaths!=!prevpaths!!!!!.join(edges)!!!!!.where(1).equalto(0)!{!!!!!!!(left,!right)!=>!(left._1,right._2)!!!!!}!!!!!.union(prevpaths)!!!!!.groupby(0,!1)!!!!!.reduce((l,!r)!=>!l)!!!nextpaths! }! Job Manager Scheduling, resource negotiation, Task Manager Data node memory heap Client Optimization and translation to data flow Task Manager Data node memory heap Task Manager Data node memory heap 25

The growing Flink stack Apache MRQL Python API Graph API ( Spargel ) Scala API (batch) Java API (streaming) Java API (batch) Common API Batch Java Collections Flink Optimizer Apache Tez Streams Builder Hybrid Batch/Streaming Runtime Streaming Storage Streams Files HDFS S3 JDBC Azure Kafka Rabbit MQ Redis Local Execution Cluster Manager Native YARN EC2 26

Program lifecycle Scala API (batch) Java API (streaming) Apache MRQL Common API Python API Java API (batch) Graph API ( Spargel ) val-source1!=!! val!source2!=!! val!maxed!=!source1!!!.map(v!=>!(v._1,v._2,!!!!!!!!!!!!!!math.max(v._1,v._2))! val!filtered!=!source2!!!.filter(v!=>!(v._1!>!4))! val!result!=!maxed!!!.join(filtered).where(0).equalto(0)!!!!.filter(_1!>!3)!!!.groupby(0)!!!.reducegroup!{ }! Flink Optimizer Streams Builder Java Collections Apache Tez Hybrid Batch/Streaming Runtime Storage Streams Files HDFS S3 JDB C Azure Kafka Rabbit MQ Redis Local Execution Cluster Manager Native YARN EC2 27

Memory management JVM Heap Unmanaged Heap Flink Managed Heap empty! page! public-class-wc-{- --public-string-word;- --public-int-count;- }- Network Buffers Pool of Memory Pages Flink manages its own memory User data stored in serialize byte arrays In-memory caching and data processing happens in a dedicated memory fraction Never breaks the JVM heap Very efficient disk spilling and network transfers 28

Little tuning or configuration required Requires no memory thresholds to configure Flink manages its own memory Requires no complicated network configs Pipelining engine requires much less memory for data exchange Requires no serializers to be configured Flink handles its own type extraction and data representation Programs can be adjusted to data automatically Flink s optimizer can choose execution strategies automatically 29

Understanding Programs Visualize and understand the operations and the data movement of programs Analyze!a=er!execu4on! Screenshot from Flink s plan visualizer 30

Understanding Programs Analyze!a=er!execu4on!(4mes,!stragglers,! )! 31

Understanding Programs Analyze!a=er!execu4on!(4mes,!stragglers,! )! 32

Built-in vs driver-based iterations Client! Step Step Step Step Step Loop outside the system, in driver program Client! Step Step Step Step Step Iterative program looks like many independent jobs red.! Dataflows with feedback edges map! join! join! System is iterationaware, can optimize the job 33

Delta iterations Cover typical use cases of Pregel-like systems with comparable performance in a generic platform and developer API. #"Ver&ces"(thousands)" 1400! 1200! 1000! 800! 600! 400! 200! 0! Bulk Delta 0! 2! 4! 6! 8! 10!12!14!16!18!20!22!24!26!28!30!32!34! Itera&on" Computations performed in each iteration for connected communities of a social graph 6000! 5000! 4000! 3000! 2000! 1000! 0! TwiOer! Runtime (secs) Webbase!(20)! *Note: Runtime experiment uses larger graph 34

Optimizing iterative programs Pushing!work! out!of!the!loop! Caching!LoopSinvariant!Data! Maintain!state!as!index! 35

WIP: Flink on Tez Apache MRQL Python API Graph API ( Spargel ) Scala API (batch) Java API (streaming) Common API Flink Optimizer Java API (batch) Streams Builder First prototype will be available in the next release Java Collections Apache Tez Hybrid Batch/Streaming Runtime Flink has a modular design that makes it easy to add alternative frontends and backends Flink programs are completely unmodified System generates a Tez DAG instead of a Flink DAG 36

CLOSING 37

Upcoming features Robust and fast engine Finer-grained fault tolerance, incremental plan rollout, optimization, and interactive shell clients Alternative backends: Flink on * Tez backend Alternative frontends: * on Flink ML and Graph functionality, Python support, logical (SQL-like) field addressing Flink Streaming Combine stream and batch processing in programs 38

flink.incubator.apache.org @ApacheFlink Flink Stockholm week Wednesday Flink introduction and hackathon @ 9:00 Flink talk at Spotify (SHUG) @ 18:00 Thursday Hackathons at KTH (streaming & graphs) @ 9:00 40