Adaptable Stream Processing
Total Page:16
File Type:pdf, Size:1020Kb
A PROCRUSTEAN APPROACH TO STREAM PROCESSING by Nikolaos Romanos Katsipoulakis Bachelor of Science, National Kapodistrian University of Athens, 2011 Submitted to the Graduate Faculty of the School of Computing and Information in partial fulfillment of the requirements for the degree of Doctor of Philosophy University of Pittsburgh 2018 UNIVERSITY OF PITTSBURGH SCHOOL OF COMPUTING AND INFORMATION This dissertation was presented by Nikolaos Romanos Katsipoulakis It was defended on December 18th 2018 and approved by Dr. Alexandros Labrinidis, Department of Computer Science, University of Pittsburgh Dr. Panos K. Chrysanthis, Department of Computer Science, University of Pittsburgh Dr. John Lange, Department of Computer Science, University of Pittsburgh Dr. Andrew Pavlo, Department of Computer Science, Carnegie Mellon University Dissertation Advisors: Dr. Alexandros Labrinidis, Department of Computer Science, University of Pittsburgh, Dr. Panos K. Chrysanthis, Department of Computer Science, University of Pittsburgh ii Copyright © by Nikolaos Romanos Katsipoulakis 2018 iii A PROCRUSTEAN APPROACH TO STREAM PROCESSING Nikolaos Romanos Katsipoulakis, PhD University of Pittsburgh, 2018 The increasing demand for real-time data processing and the constantly growing data volume have contributed to the rapid evolution of Stream Processing Engines (SPEs), which are designed to continuously process data as it arrives. Low operational cost and timely delivery of results are both objectives of paramount importance for SPEs. Given the volatile and uncharted nature of data streams, achieving the aforementioned goals under fixed resources is a challenge. This calls for adaptable SPEs, which can react to fluctuations in processing demands. In the past, three techniques have been developed for improving an SPE’s ability to adapt. Those techniques are classified based on applications’ requirements on exact or ap- proximate results: stream partitioning, and re-partitioning target exact, and load shedding targets approximate processing. Stream partitioning strives to balance load among proces- sors, and previous techniques neglected hidden costs of distributed execution. Load Shedding lowers the accuracy of results by dropping part of the input, and previous techniques did not cope with evolving streams. Stream re-partitioning is used to reconfigure execution while processing takes place, and previous techniques did not fully utilize window semantics. In this dissertation, we put stream processing in a procrustean bed, in terms of the man- ner and the degree that processing takes place. To this end, we present new approaches, for window-based aggregate operators, which are applicable to both exact and approxi- mate stream processing in modern SPEs. Our stream partitioning, re-partitioning, and load shedding solutions offer improvements in performance and accuracy on real-world data by exploiting the semantics of both data and operations. In addition, we present SPEAr, the iv design of an SPE that accelerates processing by delivering approximate results with accu- racy guarantees and avoiding unnecessary load. Finally, we contribute a hybrid technique, ShedPart, which can further improve load balance and performance of an SPE. v TABLE OF CONTENTS PREFACE ......................................... xvii 1.0 INTRODUCTION .................................1 1.1 Challenges....................................2 1.1.1 Partitioning................................3 1.1.2 Load Shedding..............................4 1.1.3 Re-partitioning (Scale-out).......................5 1.2 Our Approach..................................5 1.2.1 Exact Stream Processing.........................6 1.2.2 Approximate Stream Processing.....................7 1.2.3 Combination of methods.........................7 1.3 Research Contributions.............................7 1.4 Road Map....................................8 2.0 BACKGROUND ..................................9 2.1 System Model..................................9 2.2 Query Model.................................. 11 2.3 Execution Plan Generation........................... 14 2.3.1 Logical Plan............................... 14 2.3.2 Physical Execution Plan......................... 15 2.4 Stateful Execution in a SPE.......................... 17 2.4.1 Tuple Arrival............................... 18 2.4.2 Watermark Arrival............................ 19 2.5 Result Approximation in Stream Processing................. 20 vi 2.5.1 Error Metrics............................... 21 2.5.1.1 Algebraic and Distributive:................... 22 2.5.1.2 Holistic:............................. 23 2.6 Experimental Infrastructure.......................... 23 2.6.1 Real-world datasets........................... 23 2.6.2 Storm Runtime.............................. 24 3.0 STREAM PARTITIONING ........................... 27 3.1 A new formulation for Parallel Stateful Operations.............. 27 3.2 Proposed partitioning cost model....................... 29 3.3 The pitfall of ignoring aggregation costs.................... 31 3.3.1 Partition Algorithm Taxonomy..................... 32 3.3.2 Mapping existing Partition Algorithms to each Category....... 32 3.3.2.1 Shuffle.............................. 32 3.3.2.2 Hash (or Field)......................... 33 3.3.2.3 Partial-Key............................ 34 3.4 Minimizing imbalance with low aggregation cost............... 34 3.4.1 Incorporating Cardinality in Partitioning................ 35 3.4.1.1 Incorporating Cardinality in measuring Imbalance...... 35 3.4.1.2 Incorporating Cardinality in Measuring Aggregation Cost.. 36 3.4.2 Cardinality Estimation data structures................. 37 3.4.2.1 Naive............................... 37 3.4.2.2 Hyperloglog........................... 37 3.5 Proposed Cardinality-aware Partitioning algorithms............. 38 3.5.1 Cardinality Imbalance Minimization (CM)............... 40 3.5.2 Group Affinity and Imbalance Minimization (AM & cAM)...... 40 3.5.3 Hybrid Imbalance Minimization (LM)................. 43 3.6 Experimental Setup............................... 44 3.6.1 Stream Partitioning Algorithms..................... 45 3.6.2 Data sets and Workloads........................ 45 3.7 Experimental Results.............................. 47 vii 3.7.1 Performance............................... 47 3.7.1.1 TPCH Query 1 (Figure 12)................... 48 3.7.1.2 TPCH Query 3 (Figure. 13- 14)................ 48 3.7.1.3 DEBS Query 1 (Figure. 15a- 15c)............... 49 3.7.1.4 DEBS Query 2 (Figure. 16a- 16c)............... 50 3.7.2 Scalability................................. 51 3.7.2.1 GCM Query 1 (Figs. 17& 18)................. 52 3.7.2.2 GCM Query 2 (Fig. 19)..................... 53 3.7.3 Partition algorithm cost......................... 53 3.7.3.1 Partition latency (Figure. 20a- 20c).............. 54 3.7.3.2 Partition Memory (Table4).................. 54 3.8 Discussion.................................... 55 3.9 Related Work.................................. 58 3.10 Summary.................................... 59 4.0 STREAM RE-PARTITIONING ........................ 60 4.1 Synefo: Elasticity in Storm........................... 60 4.1.1 Architecture Overview.......................... 61 4.1.1.1 Synefo Server.......................... 64 4.1.1.2 Synefo Spout........................... 65 4.1.1.3 Synefo Bolt............................ 66 4.1.2 Synefo Summary............................. 68 4.2 Unimico..................................... 68 4.2.1 Migration timestamp........................... 70 4.2.2 Stoping and resuming continuous queries................ 73 4.2.2.1 Stopping the query at the originating node.......... 73 4.2.2.2 Starting the query at target node............... 74 4.2.3 Experimental Evaluation......................... 75 4.2.3.1 Experimental Setup....................... 75 4.2.3.2 Simple CQ migration (Figures 28, 29, 30,& 31)....... 76 4.2.3.3 Complex CQ migration (Figure 32).............. 77 viii 4.2.4 UniMiCo Related Work......................... 78 4.2.5 UniMiCo Summary............................ 79 5.0 APPROXIMATE STREAM PROCESSING (WITHOUT GUARAN- TEES) ........................................ 82 5.1 Continuous Queries with Service Level Objectives.............. 82 5.2 The need for Load Shedding.......................... 83 5.2.1 Shortcomings of existing techniques................... 83 5.2.2 Concept Drift Evidence......................... 84 5.3 Concept Drift Definition............................ 85 5.4 Load Shedding................................. 87 5.4.1 Focal point of this work: what to shed................. 88 5.5 Existing Shedding Algorithms......................... 89 5.5.1 Normal Execution (Baseline)...................... 89 5.5.2 Uniform Shedding (State of the Art).................. 89 5.6 Concept-Driven Load Shedding Algorithm.................. 90 5.6.1 Designing CoD to eliminate overhead.................. 91 5.6.2 Implementation for different query types................ 93 5.6.2.1 Scalar User-Defined Aggregations............... 94 5.6.2.2 User-Defined Aggregations................... 94 5.6.2.3 Two-way Equality Joins..................... 94 5.7 Experimental Evaluation............................ 95 5.7.1 Experimental Setup........................... 95 5.7.2 Datasets.................................. 96 5.7.3 Experimental Results.......................... 97 5.7.3.1 Scalability (Figure 37)...................... 98 5.7.3.2 Performance (Figure 38).................... 98 5.7.3.3 Accuracy (Figure 39)...................... 99 5.7.3.4 Data Volume Reduction (Figure 40).............