Naiad (Timely Dataflow) & Streaming Systems CS 848: Models and - - PowerPoint PPT Presentation

naiad timely dataflow streaming systems
SMART_READER_LITE
LIVE PREVIEW

Naiad (Timely Dataflow) & Streaming Systems CS 848: Models and - - PowerPoint PPT Presentation

Naiad (Timely Dataflow) & Streaming Systems CS 848: Models and Applications of Distributed Data Systems Mon, Nov 7th 2016 Amine Mhedhbi What is Timely Dataflow ?! What is its significance? Dataflow ?! Dataflow?! Dataflow?!


slide-1
SLIDE 1

Naiad (Timely Dataflow) & Streaming Systems

CS 848: Models and Applications of Distributed Data Systems Mon, Nov 7th 2016

Amine Mhedhbi

slide-2
SLIDE 2

What is ‘Timely’ Dataflow ?! What is its significance?

slide-3
SLIDE 3

Dataflow ?!

slide-4
SLIDE 4

Dataflow?!

slide-5
SLIDE 5

Dataflow?!

slide-6
SLIDE 6

Dataflow?!

slide-7
SLIDE 7

Dataflow?!

slide-8
SLIDE 8

Dataflow?!

slide-9
SLIDE 9

Dataflow?!

slide-10
SLIDE 10

Dataflow

  • Batch Processing e.g. MapReduce, Spark
  • Asynchronous Processing e.g. Storm, MillWheel
  • Variations for Graph Processing e.g. Pregel, GraphLab
slide-11
SLIDE 11

Dataflow: Batch Processing

slide-12
SLIDE 12

Dataflow: Batch Processing

slide-13
SLIDE 13

Dataflow: Batch Processing

slide-14
SLIDE 14

Dataflow: Batch Processing

slide-15
SLIDE 15

Dataflow: Batch Processing

slide-16
SLIDE 16

Dataflow: Batch Processing

  • Iterations make use of synchronization.
  • The cost is latency.
slide-17
SLIDE 17

Dataflow: Asynchronous Processing

slide-18
SLIDE 18

Dataflow: Asynchronous Processing

  • Compared with batch:

○ latency is lower. ○ Aggregations are incremental and data changes over time.

  • More efficient for distributed systems.

○ Stages do not need coordination.

  • Correspondence between input & output is lost.
slide-19
SLIDE 19

So, what is (Naiad) Timely dataflow ?!

slide-20
SLIDE 20

Timely Dataflow?!

slide-21
SLIDE 21

Timely Dataflow

  • Reconcile both models batch and async.
  • Low-latency and high-throughput.
slide-22
SLIDE 22

Where does Naiad fit?!

slide-23
SLIDE 23

Naiad?!

  • It is the prototype built by Microsoft Research

underlying Timely dataflow Computational model.

  • Iterative and incremental computations.
  • The logical timestamps allow coordination.
  • Provides efficiency, maintainability and simplicity.
slide-24
SLIDE 24

Let’s look at a computational example

slide-25
SLIDE 25
slide-26
SLIDE 26

Naiad?!

  • It is the prototype built by Microsoft Research

underlying Timely dataflow Computational model.

slide-27
SLIDE 27

The Timely Dataflow Graph Structure

slide-28
SLIDE 28

Graph Structure

slide-29
SLIDE 29

Graph Structure

slide-30
SLIDE 30

Graph Structure

slide-31
SLIDE 31

Graph Structure

  • input comes in as (data, 0), (data, 1), (data, 2)

○ Within a loop, I adds a loop counter so it is (data, epoch, 0) F in each iteration increments the loop counter (data, epoch, 1) etc. E removes the loop counter and it is back to (data, epoch)

slide-32
SLIDE 32

Programming Model Using the timestamps

slide-33
SLIDE 33

Programming Model

slide-34
SLIDE 34

Programming Model

slide-35
SLIDE 35

Programming Model

slide-36
SLIDE 36

Programming Model

slide-37
SLIDE 37

Programming Model

slide-38
SLIDE 38

Programming Model Summary

  • SendBy(edge, message, timestamp)
  • OnRecv(edge, message, timestamp)
  • NotifyAt(timestamp)
  • OnNotify(timestamp)
slide-39
SLIDE 39

Programming Model In Practice

slide-40
SLIDE 40

Notice

  • Project was discontinued in 2014.

Silicon Valley lab closed.

  • The paper uses C#.

The latest one is open sourced and is in Rust.

slide-41
SLIDE 41

Word Count Example

Class V<Msg, Time>: Vertex<Time> { ... }

slide-42
SLIDE 42

Word Count Example

{ Dict<Time, Dict<Msg, int> > counts; ... }

slide-43
SLIDE 43

Word Count Example (2 Different Implementations)

{ void OnRecv (Edge e, Msg m, Time t) { ... } void OnNotify (Time t) { ... } }

slide-44
SLIDE 44

Writing Programs in General

  • It is possible to write programs against the Timely

Dataflow abstraction.

  • It is possible to use libraries (MapReduce, Pregel,

PowerGraph, LINQ etc.)

  • In General:

○ Define Input, computational & Output vertices. ○ Create a timely dataflow graph using the appropriate interface. ○ Supply labeled data to input stages. ○ Stages follow a push-based model.

slide-45
SLIDE 45

Timely Guarantees

slide-46
SLIDE 46

How is timely dataflow achieved

slide-47
SLIDE 47

How is timely dataflow achieved

  • Key point: timestamps at which future message can occur

depends on: 1. Unprocessed events & 2. Graph Structure.

slide-48
SLIDE 48

How is timely dataflow achieved

  • Pointstamp of an event (timestamp, location: E or V)

○ SendBy -> Msg event of pointstamp (t, e) ○ NotifyAt -> Notif event of pointstamp (t, v)

slide-49
SLIDE 49

How is timely dataflow achieved

  • Pointstamp(t1, l1) could-result-in Pointstamp(t2, l2)

If there is a path between l1 and l2 presented by f() i.e. f(t1) <= t2

slide-50
SLIDE 50

How is timely dataflow achieved (Correctness Guarantees)

  • Path Summary between A and C: “”
slide-51
SLIDE 51

How is timely dataflow achieved (Correctness Guarantees)

  • Path Summary between A and C: “add” or “add-increment(n)”
slide-52
SLIDE 52

Single-Threaded Implementation

  • Scheduler that needs to deliver events.
slide-53
SLIDE 53

Single-Threaded Implementation

  • Scheduler has active pointstamps <-> unprocessed events.
slide-54
SLIDE 54

Single-Threaded Implementation

  • Scheduler has active pointstamps <-> unprocessed events.
  • Scheduler has two counts:

○ Occurrence count of not resolved event. ○ Precursor count of how many active pointstamps precede it in the could-result-in order.

slide-55
SLIDE 55

Single-Threaded Implementation

  • Pointstamp(t, l) becomes active.

Precursor count to number of existing active pointstamps that could result in it. Increment precursor count of any pointstamp it could-result-in. Becomes not active when occurrence is zero. When not active, decrement the precursor count for any pointstamp that it could-result-in.

slide-56
SLIDE 56

The Distributed Environment

slide-57
SLIDE 57

Distributed Implementation

slide-58
SLIDE 58

Distributed Progress Tracking

  • Initial protocol: same as single multi-threaded.

○ Broadcast occurrence count updates.

  • Do not immediately update local occurrence count.

○ Broadcast progress updates to all workers including myself. ○ Broadcast from a worker to another delivered in a FIFO manner.

  • Use of a projected timestamp.
  • A technique to buffer and accumulate updates.
slide-59
SLIDE 59

Micro-Stragglers

  • Have a big effect on overall performance.

○ Packet Loss (Networking) ○ Contention on concurrent data ○ Garbage collection

slide-60
SLIDE 60

Performance Evaluation

slide-61
SLIDE 61

Performance Evaluation

  • I invite you to read: “Scalability! BUT at what Cost”
slide-62
SLIDE 62

Performance Evaluation

  • Comparison with:

○ SQL Server Parallel Data Warehouse (RDBMS) ○ Scalable HyperLink Store ( distributed in-memory DB for storing large portions of the web graph) ○ DryadLINQ (data parallel computing using a declarative / high level programming language)

  • Algos i.e. PageRank, SCC etc.
slide-63
SLIDE 63

Conclusion: “Our prototype outperforms general-purpose batch processors and often outperforms state-of-the-art async systems which provide few semantic guarantees.”

slide-64
SLIDE 64

Conclusion: “Our prototype outperforms general-purpose batch processors and often outperforms state-of-the-art async systems which provide few semantic guarantees.”

slide-65
SLIDE 65

Streaming Systems as of today

slide-66
SLIDE 66

Streaming Systems

  • Systems that have unbounded data in mind.
  • They are a superset of batch processing systems.
slide-67
SLIDE 67

Streaming Systems

Reference: Fig-1: Example of time domain mapping. Streaming 101

slide-68
SLIDE 68

Streaming Systems

Design Questions:

  • What results are calculated?

The types of transformations within the pipeline.

  • Where in event time are results calculated?

The use of event-time windowing within the pipeline.

  • When in processing time are results materialized? The

use of watermarks and triggers.

  • How do refinements of results relate?

Discard or accumulate or accumulate and retract.

slide-69
SLIDE 69

Fin.

Thank you!

slide-70
SLIDE 70

Resources

  • Link to transcribed talk in pdf format.
  • Timely Dataflow (Rust Implementation)
  • Frank blog posts:

○ Timely dataflow ○ Differential dataflow

  • The world beyond batch: Streaming 101
  • The world beyond batch: Streaming 102