Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup...
Transcript of Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup...
![Page 1: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/1.jpg)
Yunhao Zhang, Rong Chen, Haibo Chen
Institute of Parallel and Distributed Systems (IPADS)Shanghai Jiao Tong University
Sub-millisecondStatefulStreamQueryingoverFast-evolvingLinkedData
![Page 2: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/2.jpg)
Stream Query is Important
2
Multiple data sources are continuously generating streaming data in high velocity
![Page 3: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/3.jpg)
Stateful Stream Query
A stateful stream query needs to integrate streaming data with stored data
Real-timeUser Activity
DurableSocial Graph
3
![Page 4: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/4.jpg)
Stateful Stream Query
A stateful stream query needs to integrate streaming data with stored data
Real-timeUser Activity
DurableSocial Graph
Streaming Data: high velocity
Stored Data: large & evolving
4
![Page 5: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/5.jpg)
5
Example Dataset for Stateful Stream Query
IPADS
System@Cornell
Stored DataStreaming Data
<Rong, creates, Feed>. 12:30<Feed, hash_tag, SOSP>. 12:30<Yunhao, likes, Feed>. 12:31<Haibo, likes, Feed>. 12:40
![Page 6: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/6.jpg)
6
Connectivity Property of Data
Streaming Data
Feed 12:30
Like12:31
12:40
Rong
Feed
#SOSP#
Yunhao
Haibo
Linked data represents information as entitiesand relations between the entities
Stored Data
Haibo
IPADS
Rong
Yunhaomember_of
Cornell
![Page 7: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/7.jpg)
7
Example Continuous Query
In the last 30 minutes, which IPADS members created feeds that are liked by other IPADS members?
?Y
IPADS
?X
?Feed
timeRegisteredbyuser
TriggeredbysystemTriggeredbysystem
TriggeredbysystemCanceledbyuser
…
![Page 8: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/8.jpg)
8
Example Continuous Query
Feed 12:30
Like
12:40
Rong
Feed
Haibo
Streaming Data
Yunhao12:31
Stored Data
Rong
Haibo
IPADS
Rong
Feed
Haibo
In the last 30 minutes, which IPADS members created feeds that are liked by other IPADS members?
![Page 9: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/9.jpg)
Workload Characteristics
Connectivityproperty
Stateful queries integrate Storedand Streaming
Data
Stored dataevolves by absorbing
streaming data
9
![Page 10: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/10.jpg)
10
Conventional Approach
StreamingData
StoredData
StreamProcessingSystem
GraphStoreSystem
ContinuousQuery
One-shotQuery
![Page 11: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/11.jpg)
11
Composite Design
Apache Storm
WukongOSDI’16
StreamProcessingSystem
GraphStoreSystem
Composite Design Example
![Page 12: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/12.jpg)
12
Composite Design Observations1. Cross-system Cost
~40% execution time wasted due to data transformation and transmission
2. Inefficient Query PlanSemantic gap between the two systems impair query optimization
3. Limited ScalabilityStream processing systems dedicate all resources to the improve performance ofa single job
![Page 13: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/13.jpg)
13
Composite Design Observations1. Cross-system Cost
~40% execution time wasted due to data transformation and transmission
2. Inefficient Query PlanSemantic gap between the two systems impair query optimization
3. Limited ScalabilityStream processing systems dedicate all resources to the improve performance ofa single job
Composite Design: high latency
low throughput
![Page 14: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/14.jpg)
14
Design Overview
Wukong+S uses a novel integrated design for stateful stream query over fast-evolving linked data
Integrated Design manages streaming data and stored data in a single system
► Eliminate cross-system cost► Global semantics for query optimization► Better scalability by sharing data between the queries
![Page 15: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/15.jpg)
15
Design Outline
Implementing integrated design is not trivial
Decisions for efficient integrated design:► Hybrid Store: efficiently handle streaming data and fast-
evolving stored data► Stream Index: fast path to access streaming data in a
certain time interval► Consistent Data View: through decentralized vector
timestamps and bounded snapshot scalarization
![Page 16: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/16.jpg)
16
Wukong+S Architecture
Data is partitioned and stored on multiple servers
ContinuousQuery
One-shotQuery
Engine
Store
Engine
Store
Engine
Store
Serve queries
Hold data partition
![Page 17: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/17.jpg)
17
Hybrid Store
How to gracefully integrate streaming data and stored data?
Strawman: using different graph stores according to “where from”, namely streaming and stored data
Hybrid Store: using different graph stores according to “how to use”, namely timeless and timed data
![Page 18: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/18.jpg)
18
Explicit Separation of Streaming DataStreamingData
StoredData
user-definedpredicate
Timed
One-shotQuery
TimelessContinuous
Query
![Page 19: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/19.jpg)
19
Benefit of Hybrid Store
No interference between timeless data and timed data
Design data stores separately and optimize for different operation pattern:
► Timeless Data: continuous persistent store► Timed Data: time-based transient store
![Page 20: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/20.jpg)
20
Hybrid StoreContinuous Persistent Store ► Continuously absorb the timeless portion of streams ► Goal: support stateful continuous query and up-to-
date one-shot query
TimedData
![Page 21: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/21.jpg)
21
Hybrid StoreTime-based Transient Store ► Timed data will only be accessed by relevant
continuous queries in a time interval► Goal: support fast garbage collection (GC) for the
timed portion of streams
TimedData
![Page 22: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/22.jpg)
22
How to provide consistent view over dynamic data with memory efficiency?
Consistent Data Snapshot
► Streaming data contains order information
► Early output from a stream source should always be visible before later output
► No order relation across data sources
![Page 23: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/23.jpg)
Decentralized Vector Timestamp (VTS)
Source0:
Source1:
Server0
Server1
11
11
12
12
Local_VTS
Local_VTS
Stable_VTS
Continuous Query
4
4 5
5
Data is partitioned and stored on multiple servers
8:00 8:01 8:02
4 5
11 12
Time
23
![Page 24: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/24.jpg)
24
One-shot Query
Key
Snapshot Scalarization
Server0
11 124
[4,10]
5
[4,11]
[4,12]
××
√
[5,12]√
2
3
Encoded in KeySN:SnapshotNumberVTS:VectorTimestamp
SN=2:[4,10]SN=3:[5,12]
SN-VTS PlanVisible
snapshotSN=4:[7,14]
![Page 25: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/25.jpg)
25
Benefit of Snapshot ScalarizationMemoryEfficiency
Staleness ofStoredData
InjectionSpeed
streamquery
scenario
boundnumber of
visible snapshot
decoupledata sources from
underlying store
controlstaleness bySN_VTS Plan
![Page 26: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/26.jpg)
26
► Stream index & locality-aware partitioning
► Data-driven query trigger
► One-shot query execution
► Fault tolerance
► Leveraging RDMA
Other Designs of Wukong+S
![Page 27: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/27.jpg)
27
EvaluationBaseline: 6 state-of-the-art systems□ CSPARQL-engine, Heron+Wukong, Storm+Wukong□ Spark Streaming, Spark Structured Streaming, Wukong/ext
Platforms: a rack-scale 8-machine cluster□ Each: two 12-core Intel Xeon, 128GB DRAM, w/ RDMA
Mellanox 56Gbps InfiniBand NIC, 40Gbps IB Switch
Benchmarks:□ LSBench: Social Networking Benchmark w/ 3.75B initial
stored data & 5 streams totally 134K tuple/second stream□ CityBench: Smart City Benchmark w/ 11 real-world data
streams
![Page 28: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/28.jpg)
28
Single Query LatencyOutperform: state-of-the-art systems□ Wukong+S: sub-millisecond□ 13.7X speedup vs. Storm+Wukong□ 3 orders of magnitude speedup vs. Spark Streaming
0
10
20
30
40
50
L1 L2 L3 L4 L5 L6Wukong+S Storm+Wukong SparkStreaming
219 527 712 346 2215 1422
late
ncy
(mse
c)
0.10 0.08 0.110.23 1.64 2.62
31.14
40.77
49.03
1.78 3.50 1.68
![Page 29: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/29.jpg)
29
Single Query LatencyUnavoidable reason for high latency□ Cross-system Cost for Storm+Wukong□ Joining large stored data (3.75B) for Spark Streaming
0
10
20
30
40
50
L1 L2 L3 L4 L5 L6Wukong+S Storm+Wukong SparkStreaming
219 527 712 346 2215 1422
late
ncy
(mse
c)
0.10 0.08 0.110.23 1.64 2.62
31.14
40.77
49.03
1.78 3.50 1.68
![Page 30: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/30.jpg)
30
Throughput of Mixed Workloads
□ Wukong+S: ~1M queries/second on 8 nodes□ Mixture of 3 queries: 1.08M queries/second□ Add complex queries: 802K queries/second
Mixture of LSBench 1-6
0
200
400
600
800
0 2 4 6 8#machine
0
200
400
600
800
1000
0 2 4 6 8
Mixture of LSBench 1-3#machine
thro
ughp
ut(k
iloqu
ery/
seco
nd)
thro
ughp
ut(k
iloqu
ery/
seco
nd)
![Page 31: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/31.jpg)
31
Other Evaluations
► Influence of different stream rate
► Data insertion latency
► Performance of one-shot queries
► Memory consumption
► Fault-tolerance overhead
![Page 32: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/32.jpg)
32
: A distributed stream querying engine adopting a novel integrated desgin for statefulstream queries over fast-evolving linked data
Wukong+S
Existingsystemscannotsatisfydemandsofstateful streamqueryoverfast-evolvinglinkeddata
Conclusion
http://ipads.se.sjtu.edu.cn/projects/wukong
Achieving sub-millisecond latency and throughputexceeding one million queries per second
![Page 33: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/33.jpg)
33
Questions
Thanks
Institute of Parallel and Distributed Systems
Wukong+Shttp://ipads.se.sjtu.edu.cn/projects/wukong
![Page 34: Sub-millisecond Stateful Stream Querying over Fast-evolving …S... · 2017-11-08 · 13.7X speedup vs. Storm+Wukong 3 orders of magnitudespeedup vs. Spark Streaming 0 10 20 30 40](https://reader036.fdocuments.in/reader036/viewer/2022070710/5ec6b2dc438b495ec4625ca2/html5/thumbnails/34.jpg)
34
Backup: LSBench w/o RDMA