persistent data sketching
play

Persistent Data Sketching Ge Luo Ke Yi Zhewei Wei The Hong Kong - PowerPoint PPT Presentation

Persistent Data Sketching Ge Luo Ke Yi Zhewei Wei The Hong Kong University of The Hong Kong University of Renmin University of China Science and Technology Science and Technology Xiaoyong Du Ji-Rong Wen Renmin University of China Renmin


  1. Persistent Data Sketching Ge Luo Ke Yi Zhewei Wei The Hong Kong University of The Hong Kong University of Renmin University of China Science and Technology Science and Technology Xiaoyong Du Ji-Rong Wen Renmin University of China Renmin University of China

  2. Streaming Algorithms • A data stream is a (massive) sequence of data Summary in Memory Data Stream (Approximate) Stream Processing Answer query Engine

  3. Streaming Algorithms • A data stream is a (massive) sequence of data - Single Pass: Each record is examined at most once Summary in Memory Data Stream (Approximate) Stream Processing Answer query Engine

  4. Streaming Algorithms • A data stream is a (massive) sequence of data - Single Pass: Each record is examined at most once - Small Space: Log or polylog in data stream size Summary in Memory Data Stream (Approximate) Stream Processing Answer query Engine

  5. Streaming Algorithms • A data stream is a (massive) sequence of data - Single Pass: Each record is examined at most once - Small Space: Log or polylog in data stream size - Small time: Low per-record processing time (O(1) to polylog N) Summary in Memory Data Stream (Approximate) Stream Processing Answer query Engine

  6. Sketches • Sub-linear space - Fast update and query time • Answer queries approximately • Linear transformation of the data frequencies

  7. Sketches • Count-Min Sketch [Cormode and Muthukrishnan 2005] - Point queries, heavy hitters (frequent items) • AMS Sketch [Alon et. al. 1999] - Frequency moments • Count Sketch [Charikar et. al. 2002] - Join size queries, self join size queries [Rusu and Dobra 2007] • …

  8. Sketches • Sub-linear space - Fast update and query time • Answer queries approximately • Linear transformation of the data frequencies

  9. Sketches • Sub-linear space - Fast update and query time • Answer queries approximately • Linear transformation of the data frequencies • Ephemeral - Answer queries on current version of data stream

  10. Query Back in Time • The ability to query on historical data is necessary for analyzing trends&change pattern of data

  11. Persistent Database/ Data Structure • Answer queries on the past version of the database

  12. Persistent Database/ Data Structure • Answer queries on the past version of the database • General technique to make data structure persistent [Driscoll et al. 1989], Multi-version B-tree [Becker et al. 1996, 
 , Brodal et al. 2012], Time-Split B-tree [Lomet and Salzberg 1989]

  13. Persistent Database/ Data Structure • Answer queries on the past version of the database • General technique to make data structure persistent [Driscoll et al. 1989], Multi-version B-tree [Becker et al. 1996, 
 , Brodal et al. 2012], Time-Split B-tree [Lomet and Salzberg 1989] • Microsoft Immortal DB [Lomet et. al. 2005], SNAP [Shrira and Xu 2005], Ganymed [Plattner et. al. 2006], Skippy [Shaull et. al. 2008] and LIVE[Sarma et. al. 2010]

  14. Persistent Database/ Data Structure • Answer queries on the past version of the database • General technique to make data structure persistent [Driscoll et al. 1989], Multi-version B-tree [Becker et al. 1996, 
 , Brodal et al. 2012], Time-Split B-tree [Lomet and Salzberg 1989] • Microsoft Immortal DB [Lomet et. al. 2005], SNAP [Shrira and Xu 2005], Ganymed [Plattner et. al. 2006], Skippy [Shaull et. al. 2008] and LIVE[Sarma et. al. 2010] • Space linear in # of updates - Large storage - Storage on disk (not in streaming setting)

  15. Persistent Database Sketch Query on historical data Query on current data Linear space Sub-linear space

  16. Persistent Database Sketch Query on historical data Query on current data Linear space Sub-linear space Persistent Sketch Query on historical data Sub-linear space

  17. Persistent Sketch • Historical window query Time Stream

  18. Persistent Sketch • Historical window query Time Stream Start time s End time t

  19. Persistent Sketch • Historical window query Time Stream Start time s End time t • Given a time interval ( s , t ], return a sketch for substream f( s , t ) • What is the top-k/frequency moment/join size of the stream between s and t ?

  20. High Level Ideas & Our Results

  21. Count-Min Sketch [Cormode and Muthukrishnan 2005] • Given an error parameter 𝜁 • Choose a hash function h : [ n ] ➝ [2/ 𝜁 ] and build a hash table of size 2/ 𝜁

  22. Count-Min Sketch [Cormode and Muthukrishnan 2005] • Given an error parameter 𝜁 • Choose a hash function h : [ n ] ➝ [2/ 𝜁 ] and build a hash table of size 2/ 𝜁

  23. Count-Min Sketch [Cormode and Muthukrishnan 2005] • Given an error parameter 𝜁 • Choose a hash function h : [ n ] ➝ [2/ 𝜁 ] and build a hash table of size 2/ 𝜁 h ( i ) C [ h ( i )]

  24. Count-Min Sketch [Cormode and Muthukrishnan 2005] • Given an error parameter 𝜁 • Choose a hash function h : [ n ] ➝ [2/ 𝜁 ] and build a hash table of size 2/ 𝜁 h ( i ) C [ h ( i )] C [ h ( i )] = C [ h ( i )] + 1

  25. Linear Transformation i 0, 1, 0,…, 0,…, 0, 0, f 1 f 2 … f 3 h ( i ) 0, 0, 0,…, 1,…, 0, 0, … = C [ h ( i )] f i … … f N 0, 0, 0,…, 0,…, 1, 0,

  26. Linear Transformation Stream Start time s End time t

  27. Linear Transformation C s C t Stream Start time s End time t

  28. Linear Transformation C t - C s C s C t Stream Start time s End time t

  29. Linear Transformation C t - C s C s C t • Linear Space Stream Start time s End time t

  30. Linear Transformation C t - C s C s C t • Linear Space • Sketch is already an approximation Stream Start time s End time t

  31. Baseline Solution Ephemeral sketch: C [ i ]

  32. Baseline Solution Ephemeral sketch: C [ i ] C [ i ] at time t 1 C [ i , t 1 ] Historical Lists: C [ i , t 2 ] - C [ i , t 1 ] ≈ Δ C [ i ] at time t 2 C [ i , t 2 ] C [ i ] at time t 3 C [ i , t 3 ]

  33. Baseline Solution Ephemeral sketch: C [ i ] C [ i ] at time t 1 C [ i , t 1 ] Historical Lists: C [ i , t 2 ] - C [ i , t 1 ] ≈ Δ Query time t C [ i ] at time t 2 C [ i , t 2 ] C [ i ] at time t 3 C [ i , t 3 ]

  34. Baseline Solution Ephemeral sketch: C [ i ] C [ i ] at time t 1 C [ i , t 1 ] Historical Lists: C [ i , t 2 ] - C [ i , t 1 ] ≈ Δ Query time t C [ i ] at time t 2 C [ i , t 2 ] C [ i ] at time t 3 C [ i , t 3 ]

  35. Baseline Solution • Historical window point/heavy hitters query: - What is frequency of “/images/space.gif” between day 34 and day 37 - What are the mostly requested URLs between day 34 and day 37”

  36. Baseline Solution • Historical window point/heavy hitters query: - What is frequency of “/images/space.gif” between day 34 and day 37 - What are the mostly requested URLs between day 34 and day 37” • Error: 𝜁 || f ( s,t )|| 1 (ephemeral error) + Δ (persistent error)

  37. Baseline Solution • Historical window point/heavy hitters query: - What is frequency of “/images/space.gif” between day 34 and day 37 - What are the mostly requested URLs between day Size of the stream 34 and day 37” between s and t • Error: 𝜁 || f ( s,t )|| 1 (ephemeral error) + Δ (persistent error)

  38. Baseline Solution • Historical window point/heavy hitters query: - What is frequency of “/images/space.gif” between day 34 and day 37 - What are the mostly requested URLs between day Size of the stream 34 and day 37” between s and t • Error: 𝜁 || f ( s,t )|| 1 (ephemeral error) + Δ (persistent error) • Space: proportional to (1/ 𝜁 + m / Δ )

  39. Baseline Solution • Historical window point/heavy hitters query: - What is frequency of “/images/space.gif” between day 34 and day 37 - What are the mostly requested URLs between day Size of the stream 34 and day 37” between s and t • Error: 𝜁 || f ( s,t )|| 1 (ephemeral error) + Δ (persistent error) • Space: proportional to (1/ 𝜁 + m / Δ ) • Cannot handle (self) join size queries

  40. Piece-wise Linear Approximation • Counter changes by at most 1 at each timestamp • Each counter is a discrete function according to timestamps v ( t ) 0 t

  41. PLA-based Persistent Sketch Ephemeral sketch: C [ i ] v ( t ) PLA generator: 0 t

  42. PLA-based Persistent Sketch Ephemeral sketch: C [ i ] v ( t ) PLA generator: 0 t Query time t

  43. PLA-based Persistent Sketch • Historical window point/heavy hitters query: - What is frequency of “/images/space.gif” between day 34 and day 37 - What are the mostly requested URLs between day 34 and day 37” • Error: 𝜁 || f ( s,t )|| 1 (ephemeral error) + Δ (persistent error)

  44. PLA-based Persistent Sketch • Historical window point/heavy hitters query: - What is frequency of “/images/space.gif” between day 34 and day 37 - What are the mostly requested URLs between day 34 and day 37” • Error: 𝜁 || f ( s,t )|| 1 (ephemeral error) + Δ (persistent error) • Space: proportional to (1/ 𝜁 + m / Δ 2 ) in random stream model

  45. Estimating Join Size • Estimating (self) join size in an ephemeral sketch: Σ i C[i] 2

  46. Estimating Join Size • Estimating (self) join size in an ephemeral sketch: Σ i C[i] 2 • Estimating (self) join size in a persistent sketch:

  47. Estimating Join Size • Estimating (self) join size in an ephemeral sketch: Σ i C[i] 2 • Estimating (self) join size in a persistent sketch: Σ i (C[i] + error of Δ ) 2

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend