Table of Contents
Fetching ...

Low-Latency Stateful Stream Processing through Timely and Accurate Prefetching

Eleni Zapridou, Anastasia Ailamaki

Abstract

Mission-critical applications often run "forever" and process large data volumes in real time while demanding low latency. To handle the large state of these applications, modern streaming engines rely on key-value stores and store state on local storage or remotely, but accessing such state inflates latency. As today's engines tightly couple the data path with state I/O, a tuple triggers state access only when it reaches a stateful operator, placing I/O on the critical path and stalling the CPU. However, the keys used to access the state are frequently known earlier in the query plan. Building on this insight, we propose Keyed Prefetching, which decouples the data path from state access by extracting future access keys at upstream operators and proactively staging the corresponding state in memory before tuples arrive. This overlaps I/O with ongoing computation and hides the latency of large-state accesses. We pair Keyed Prefetching with Timestamp-Aware Caching, a cache-eviction policy that jointly manages previously accessed and prefetched entries to use memory efficiently. Together, these techniques reduce latency for long-running, real-time queries without sacrificing throughput.

Low-Latency Stateful Stream Processing through Timely and Accurate Prefetching

Abstract

Mission-critical applications often run "forever" and process large data volumes in real time while demanding low latency. To handle the large state of these applications, modern streaming engines rely on key-value stores and store state on local storage or remotely, but accessing such state inflates latency. As today's engines tightly couple the data path with state I/O, a tuple triggers state access only when it reaches a stateful operator, placing I/O on the critical path and stalling the CPU. However, the keys used to access the state are frequently known earlier in the query plan. Building on this insight, we propose Keyed Prefetching, which decouples the data path from state access by extracting future access keys at upstream operators and proactively staging the corresponding state in memory before tuples arrive. This overlaps I/O with ongoing computation and hides the latency of large-state accesses. We pair Keyed Prefetching with Timestamp-Aware Caching, a cache-eviction policy that jointly manages previously accessed and prefetched entries to use memory efficiently. Together, these techniques reduce latency for long-running, real-time queries without sacrificing throughput.
Paper Structure (31 sections, 5 equations, 11 figures, 2 tables)

This paper contains 31 sections, 5 equations, 11 figures, 2 tables.

Figures (11)

  • Figure 1: Keyed Prefetching in fraud detection. A card transaction goes through a pipeline of attribute extraction, data normalization, and risk assessment. Existing systems would start fetching the card-specific state (which grows with the number of cards) only when the tuple reaches the risk-assessment operator. Keyed Prefetching eliminates the state-access latency by accurately prefetching state in response to hints from the upstream attribute-extraction operator.
  • Figure 2: A parallel dataflow graph corresponding to the query of Figure \ref{['fig:intro']} with embedded key--value stores for subtasks of stateful operators. Tuples between the data-normalization and risk-assessment operators are partitioned by the card ID attribute, and the same attribute is used to partition the state of the risk-assessment operator. For simplicity, we present the source, attribute-extraction, and data-normalization operator with a single subtask.
  • Figure 3: Keyed Prefetching Overview
  • Figure 4: Timestamp-Aware Cache Design
  • Figure 5: Dataflow graphs of the evaluated queries. Thicker arrows connect pipelined operators.
  • ...and 6 more figures

Theorems & Definitions (2)

  • Definition 1: Lookahead operator
  • Definition 2: Prefetch hint