data stream processing in the cloud - uclouvainpvr/grascompcloudday2012/kalyvianakitalk.pdf · •...

45
[email protected] Data Stream Processing in the Cloud Eva ngelia Kalyvianaki joint work with Raul Castro Fernandez, Marco Fiscato, Matteo Migliavacca and Peter Pietzuch Large-Scale Distributed Systems Group http://lsds.doc.ic.ac.uk Doctoral School Day in Cloud Computing, Université catholique de Louvain – November 2012 Department of Computing [email protected]

Upload: others

Post on 17-May-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Peter R. Pietzuch [email protected]

Data Stream Processing in the Cloud

Evangelia Kalyvianaki

joint work with Raul Castro Fernandez, Marco Fiscato, Matteo Migliavacca and Peter Pietzuch

Large-Scale Distributed Systems Group

http://lsds.doc.ic.ac.uk

Doctoral School Day in Cloud Computing, Université catholique de Louvain – November 2012

Department of Computing

[email protected]

Page 2: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

The Data Deluge

• Big data –  150 Exabytes (billion GBs) in 2005 à 1200 Exabytes in 2010 –  real-time big data analytics in UK £25 billions à £216 billions in 2012-17

Many new sources of data become available –  Sensors, mobile devices –  Web feeds, social networking –  Cameras –  Scientific instruments

• E How can we make sense of all data ? –  Most data is not interesting –  New data supersedes old data –  Challenge is not only storage but also querying

2

Page 3: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Real Time Traffic Monitoring

3

•  Instrumenting country’s transportation infrastructure

Time-EACM (Cambridge)

–  Many parties interested in data •  Road authorities •  Traffic planners •  Commuters

–  High-level queries •  “What is the best time/route for

my commute from London to Cambridge at 7-8am?”

Page 4: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Web/Social Feed Mining

4

Social Cascade Detection

• Detection and reaction to social cascades

Page 5: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Astronomic Data Processing

5

• Analysing transient cosmic events: γ-ray bursts

•  Large Synoptic Survey Telescope (LSST)

–  Generates 1.28 Petabytes per year

Page 6: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

6

Global Sensor Applications: EarthScope

• Using sensors to understand geological evolution –  Many sources: seismometers, GPS stations, …

http://www.earthscope.org

E How do you process all this data?

Page 7: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Traditional Databases

• Database Management System (DBMS): •  Data relatively static but queries dynamic

7

DBMS

Data

Queries Results

Index

–  Persistent relations •  Radom access •  Low update rate • Unbounded disk storage

–  One-time queries •  Finite query result • Queries exploit (static) indices

Page 8: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Data Stream Processing System

• SPSs: Queries static but data dynamic •  Data represented as time-dependant data stream

8

SPS

Queries

Stream Results

Working Storage

–  Transient streams •  Sequential access •  Potentially high rate •  Bounded main memory

–  Continuous queries •  Time-dependant res. stream •  Indexing?

E Process data streams on the fly without storage

Page 9: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Data Stream Processing

9

E Process tuple streams on-the-fly by operators:

Distributed Stream Processing Systems

Page 10: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

This talk is about ...

• Data Stream Processing in the Cloud

• Scalable and Fault-tolerance Stream Processing in the Cloud –  Increasing workload rates –  Stateful operators

•  Fair Stream Processing in Federated SPSs under Overload –  Tuple shedding user-feedback metric –  Fair tuple shedding under overload

10

Page 11: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

• Scalable and Fault-tolerant Stream

• Processing in the Cloud

11

Page 12: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Stream Processing in the Cloud

• Clouds provide virtually infinite pools of resources –  Fast and cheap access to new machines for operators

•  In a utility-based pricing model:

–  Needlessly over-provisioning system is expense –  Using too few resources leads to poor performance

12

E How do you use the optimal number of resources?

Page 13: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Challenges in Cloud-Based Stream Processing

• Intra-query parallelism –  Provisioning for workload peaks unnecessarily conservative

• Failure resilience –  Active fault-tolerance requires 2x resources –  Passive fault-tolerance leads to

long recovery times

13

0%"

20%"

40%"

60%"

80%"

100%"

09/07" 09/08" 09/09" 09/10" 09/11" 09/12" 09/13"

Util

isat

ion E  Dynamic scale out:

increase resources when peaks appear

E  Hybrid fault-tolerance: low resource overhead with fast recovery

Date

E  both mechanisms must support stateful operators

Cour

tesy

of

MSR

C

Page 14: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Operator State Management

Operator state: –  A summary of past tuples’ processing, e.g. max result –  It cannot be lost, or stream results are affected

On scale out: –  Partition operator state correctly, maintaining consistency

• On failure recovery: –  Restore state of failed operator –  Define primitives for state management and build other mechanisms on

top of them

14

E  Make operator state an external entity that can be managed by the stream processing system

Page 15: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

State Management

• What is state in stream processing system?

–  Need to externalise processing state of operators 15

A

C

B

Processing state Routing state Buffer state

Page 16: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

State Management Primitives

16

Takes snapshot of state and makes it externally available

E  Restore

E  Backup

A

B

E  Checkpoint

E  Partition

Moves copy of state from one operator to another

Splits state in a semantically correct fashion for parallel processing

Page 17: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

State Management in Action, SEEP

17

EC2 stats

faultdetector

scale outcoordinator

deployment manager

query manager

queries

bottleneck detectorscaling policyVM pool

faults

UB+Ccoordinator

1

2

1. Dynamic Scale Out: Detect bottleneck, remove by adding new parallelised operator

2. Failure Recovery: Detect failure, replace with new operator

Page 18: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Dynamic Scale Out: Detecting bottlenecks

CPU utilisation

report

35%

85%

30%

Logical infrastructure view

35% 85% 30%

Bottleneck

Bottleneck detector

Page 19: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

The VM Pool: Adding operators

• Problem: Allocating new VMs takes minutes...

19

Bottleneck detector

Monitoring information

Cloud provider

VM1 VM2 Virtual Machine Pool

Decision to scale-out

Bottleneck detected

Select pre-provisioned VM (order of secs)

Provision VM from cloud (order of mins)

VM3

Add new VM to pool

VM2

VM3 (dynamic pool size)

Page 20: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Scaling Out Stateful Operators

20

A

A

Periodically, stateful operators checkpoint and back up state to designated upstream backup node

AA

A

For scale out, backup node already has state of operator to be parallelised

B

New operator

A

B

A

B

E  Checkpoint

E  Backup

E  Partition

E  Restore

Finally, upstream operators replay unprocessed tuples to update checkpointed state

Page 21: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

State Partitioning

• Processing state modeled as (key, value) dictionary

• State partitioned according to key k of tuples –  Same key used to partition incoming streams

• Tuples will be routed to correct operator –  x is splitting key that partitions state

B

0-50

50-100

stream 0-100 stream 0-50

stream 50-100

21

K1-V1 K2-V2 K3-V3 … Kn-Vn

A

A

Page 22: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Passive Fault-Tolerance Model

• Recreate operator state by replaying tuples after failure –  Send acknowledgements upstream for tuples processed downstream

• May result in long recovery times due to large buffers –  System is reprocessing streams after failure è inefficient

Upstream Backup

22

ACKs

data

Page 23: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Upstream Backup + Checkpointing

23

A

A

A

New instance

• Benefit from state management primitives –  Use periodically backed up state on upstream node to recover faster

A

A

State is restored and unprocessed tuples are replayed from buffer

Page 24: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

SEEP Evaluation

24

E  SEEP scales out to increasing workload in the Linear Road Benchmark

Page 25: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

• THEMIS: Max-min Fairness in Federated

• Stream Processing under Overload

25

Page 26: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Federated Stream Processing System

26

E  We cannot scale out to additional resources E  Permanent resource, skewed overload conditions E  Tuple shedding

Page 27: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Tuple Load Shedding à discard data!

27

Query: Which are the two rooms with the highest temperatures, every 5 minutes?

E  Reduces resource footprint E  Useful only when feedback is provided to user E  Shedding is controlled for fair processing among queries

Page 28: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Source Information Content (SIC) metric

28

E  SIC metric provides feedback on loss of source tuples E  SIC is query-independent

Page 29: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Unfair Processing in Federated SPSs

29

E  Random shedding à a wide spread in processing quality

–  3 nodes, 100 top-5 queries –  Traces from 40 PlanetLab nodes –  “Select the 5 nodes with the

highest free CPU and at least 500MB of MEM every second”

–  Skewed query deployment

Page 30: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Fair Stream Processing in Federated-SPSs

30

G1: Query-independent processing metric à SIC

• G2: Stream processing fairness à max-min SIC –  Some queries are less/more overloaded than others

Max-min SIC Fairness: The ordering of queries is max-min SIC fair if and if only an increase in the SIC value of a query must be at the expense of the decrease of the SIC value of an already smaller query.

• G3: Decentralised fairness à sites are autonomous

Page 31: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Max-min Decentralised Fairness Challenges

31

assume (node a) << (node b) Research question: how can we balance shedding so to maximise SIC values on (node a) queries?

Page 32: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Max-min Decentralised Fairness Solution

32

Solution insights: –  Each node solves a max-min problem for its running queries –  Each node is updated on the result SIC value of its queries

à nodes take informed local decisions for global fairness –  Each node always sheds the least SIC tuples

à save on resources –  Solve a small problem at-a-time and iterate with feedback

Page 33: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

THEMIS Evaluation

33

E  THEMIS max-min fairness is always better than random

–  18 nodes, 2,000 fragments –  Mix workload: cov, top-5,avg

Page 34: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Conclusions

34

• Data Stream Processing is efficient in the Cloud –  New challenges emerge from Cloud scalability

•  Scale out and fault-tolerance have to be integrated

–  New problems arise because of distribution •  Fairness in overload management requires feedback of processing

•  Future work -> Cloud is there but does not come cheap –  Large-scale management –  Competing requirements from multi-tenancy deployment –  Unknown changing workloads –  Pay-as-you-go model, is this the best? –  Minimise the cost for users, maximise Cloud providers’ revenue –  Novel architectural designs for data-centre management

• Thank you! [email protected]

Page 35: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Experimental Evaluation

• Goals –  Correlation of SIC metric with result correctness –  Effectiveness of the max-min fairness algorithm –  Scalability of the fairness algorithm –  Overhead of our shedder implementation

• Prototype system: THEMIS –  Implemented in Java

• Workload –  Aggregate workload (max, count, avg) –  Complex workload (top-5, avg-all, covariance) –  Synthetic data (uniform, Gaussian, exponential) –  PlanetLab data (CPU and memory usags, 1month, 40 nodes)

• Deployment on local and Emulab (18 nodes) test-beds

35

Page 36: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

THEMIS Evaluation

36

max query top-5 query

Page 37: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

THEMIS Evaluation

37

Page 38: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Experimental Evaluation • Goals

–  Investigate effectiveness of scale out mechanism –  Recovery time after failure using UBC –  Overhead of state management

• Prototype system: Scalable and Elastic Event Processing (SEEP) –  Implemented in Java; Storm-like data flow model

• Sample queries + workload –  Linear Road Benchmark (LRB) to evaluate scale out [VLDB’04]

•  Provides an increasing stream workload over time for given load factor •  Query with 8 operators; SLA: results < 5 secs

–  Windowed word count query to evaluate fault tolerance •  Induce failure to observe performance impact

• Deployment on Amazon AWS EC2 –  Sources and sinks on high-memory double extra large instances –  Operators on small instances

38

Page 39: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Scale Out: LRB Workload

39

Scales to load factor L=350 with 60 VMs on Amazon EC2 -  Automated query parallelisation L=512 highest report result [VLDB’12]

-  Hand-crafted query on dedicated cluster

Scale out leads to latency peaks, but remains within LRB SLA

Page 40: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

UB+C: Recovery Time

40

State backed up every 5 seconds in UB+C

Source Replay: Upstream Backup with tuples

replayed by source only

E  UB+C achieves faster recovery, especially for fast stream rates

Page 41: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Tradeoff of Checkpointing Interval

41

E  Shorter checkpointing interval leads to faster recovery times But also incurs more overhead, impacting tuple processing latency

Page 42: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Related Work

• Scalable stream processing systems –  Twitter Storm, Yahoo S4, Nokia Dempsey

Exploit operator parallelism mainly for stateless queries –  ParaSplit operator [VLDB’12]

Partition stream for intra-query parallelism

• Support for elasticity –  StreamCloud [TPDS’12]

Dynamic scale out/in for subset of relational stream operators –  Esc [ICCC’11]

Dynamic support for stateless scale out

• Resource-efficient fault tolerance models –  Active Replication at (almost) no cost [SRDS’11]

Use under-utilized machines to run operator replicas –  Discretized Streams [HotCloud’12]

Data is checkpointed and recovered in parallel in event of failure 42

Page 43: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Future Work

• Support for full elasticity –  Add dynamic scale in mechanism –  Bottlenecks easier to detect than spare capacity

• Cost-aware policies for elasticity –  Performance/cost tradeoff –  How to achieve user-provided SLAs

• High-level query languages –  Integrated support for processing stream & historic data –  Programming models

43

Page 44: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Distributed DSPS

• Interconnect multiple DSPSs with network –  Better scalability, handles geographically distributed stream sources

• Interconnect on LAN or Internet? –  Different assumptions about time and failure models

44

Scientific instruments

Webfeeds

Embedded sensors Wireless

sensor networks

Traffic monitors

Mobile sensing devices

Queries

RFID tags

Body sensor networks

Queries

Page 45: Data Stream Processing in the Cloud - UCLouvainpvr/GrascompCloudDay2012/KalyvianakiTalk.pdf · • Database Management System (DBMS): • Data relatively static but queries dynamic

Twitter Storm & Yahoo S4

• Yahoo! S4 (http://incubator.apache.org/s4/)

–  Java framework for implementing stream processing applications –  Hides stream “plumbing” from developers –  Uses Zookeeper for coordination

• Twitter Storm (https://github.com/nathanmarz/storm)

–  Focus on fault-tolerance: acknowledgement of processed tuples –  Spouts produce data; bolts process data –  Different mechanisms for stream partitioning and bolt parallelisation

• This is just the beginning... lots of open challenges...

45