HyperAIHyperAI

Command Palette

Search for a command to run...

Jeu De Données

Le Modèle Dataflow : une approche pratique pour équilibrer l'exactitude, la latence et le coût dans le traitement de données massives, non bornées et hors ordre

Résumé

Les jeux de données non bornés, non ordonnés et à l'échelle mondiale sont de plus en plus courants dans le monde de l'entreprise (par exemple, journaux web, statistiques d'utilisation mobile et réseaux de capteurs). Parallèlement, les consommateurs de ces jeux de données ont développé des exigences sophistiquées, telles que l'ordonnancement par temps d'événement et le fenêtrage selon les caractéristiques des données elles-mêmes, en plus d'une soif insatiable de réponses plus rapides. Or, la réalité pratique impose qu'il est impossible d'optimiser simultanément toutes les dimensions d'exactitude, de latence et de coût pour ce type d'entrée. Les praticiens du traitement de données se retrouvent ainsi face à une problématique complexe : concilier les tensions entre ces propositions apparemment contradictoires, ce qui conduit souvent à des implémentations et des systèmes disparates. Nous soutenons qu'un changement fondamental d'approche est nécessaire pour répondre à ces exigences évolutives du traitement moderne des données. En tant que communauté, nous devons cesser de vouloir façonner des jeux de données non bornés en ensembles finis d'information qui deviennent éventuellement complets, et accepter pleinement l'hypothèse que nous ne saurons jamais si, ni quand, nous avons vu toutes nos données, mais simplement que de nouvelles données arriveront, que d'anciennes pourront être retirées, et que la seule manière de rendre ce problème traitable est de recourir à des abstractions rigoureuses offrant au praticien le choix de compromis appropriés le long des axes qui l'intéressent : l'exactitude, la latence et le coût. Dans cet article, nous présentons l'une de ces approches, le Modèle Dataflow, accompagnée d'un examen détaillé de la sémantique qu'il permet, d'une vue d'ensemble des principes fondamentaux ayant guidé sa conception, et d'une validation du modèle lui-même à travers les expériences concrètes qui ont conduit à son développement.

One-sentence Summary

Google proposes the Dataflow Model, a set of principled abstractions for processing unbounded, unordered, out-of-order datasets that enables practitioners to explicitly choose tradeoffs along correctness, latency, and cost rather than forcing data into finite, complete pools, validated through real-world production experience.

Key Contributions

  • The paper introduces the Dataflow Model, a unified model for unbounded datasets that lets practitioners make explicit tradeoffs among correctness, latency, and cost through principled abstractions such as event-time ordering, unaligned windows, flexible triggering, integrated accumulation, and retraction.
  • The paper defines the model's core semantics and design principles by separating what results are computed, where they are computed in event time, when they are materialized in processing time, and how earlier results relate to later refinements, while abstracting away differences among batch, micro-batch, and streaming engines.
  • The paper supports the model with analysis and real-world Google-scale unbounded data processing experiences, including MillWheel and large log joining pipelines, showing how the model addresses event-time skew, weakly consistent streaming results, and unified streaming and batch implementations.

Introduction

Modern data processing systems must handle massive, unbounded, and frequently out of order data streams while producing timely, correct results for use cases such as advertising analytics, operations monitoring, and near real time decision making. The authors explain that existing batch systems can be too slow because they process collected inputs, while many streaming systems struggle with fault tolerance, exactly once correctness, expressive event time windowing, session windows, or simplicity at global scale. To address these gaps, the authors leverage a unified programming model that decouples the logical pipeline from the underlying batch, micro batch, or streaming engine. The model supports unaligned event time windows, flexible triggering, incremental updates and retractions, and explicit control over the tradeoff among correctness, latency, and cost.

Method

The authors leverage a unified dataflow model that describes batch, micro batch, and streaming pipelines with a single set of semantics. In this model, pipeline data are conceptually treated as tuples of the form (key,value,eventtime,window)(key, value, event time, window)(key,value,eventtime,window). The event time timestamp can be assigned at input or modified during processing, while the window field determines where in event time a datum is grouped. This representation allows the same pipeline definition to express pure batch computations, low latency stream processing, and hybrid patterns similar to Lambda Architecture pipelines.

At the core of the framework are two parallel primitives. The first is ParDo, which applies a user defined DoFn to each input element. A DoFn may emit zero or more output elements for each input, so ParDo supports map, filter, expand, and other element wise transformations. The second primitive is GroupByKey, which collects all values associated with the same key. GroupByKey is powerful, but it becomes problematic on unbounded streams because the system cannot know when the last value for a key has arrived. The model therefore couples grouping with time bounded windows, so that aggregation is performed over a key and a window rather than over a key alone.

The authors make windowing a first class part of the model by separating it into two operations. AssignWindows places each input element into zero or more windows based on its timestamp. For example, an element assigned to sliding windows may be duplicated into each window that contains its timestamp. MergeWindows is applied during grouping and allows overlapping or adjacent windows to be combined. This separation is essential for data driven windowing schemes such as sessions. In session windowing, each element initially creates a provisional window extending beyond its event time, and later grouping can merge overlapping session windows into a single session.

To make this concrete, the authors consider a summation pipeline where GroupByKey becomes a composite GroupByKeyAndWindow operation. This operation conceptually consists of DropTimestamps, GroupByKey, MergeWindows, GroupAlsoByWindow, and ExpandToElements. The DropTimestamps step is useful because window membership becomes the primary grouping signal after assignment. MergeWindows implements strategy specific merging, such as combining overlapping sessions. GroupAlsoByWindow produces per key, per window groups of values, and ExpandToElements materializes grouped results back into timestamped elements. The authors design the model so that all windows are treated as unaligned from the model perspective, while execution engines may still apply optimizations when aligned window patterns are detected.

The example input data are useful for understanding how the model behaves over time. The data contain ten integer observations for a single key. The horizontal axis represents event time, meaning when the event actually occurred, while the vertical axis represents processing time, meaning when the pipeline observes the event. The visualization also shows two watermark paths: an ideal watermark that advances in perfect lockstep with event time, and a realistic watermark that can be delayed or inaccurate because of distributed systems skew. One observation, with value 9, arrives behind the watermark and is therefore late. This motivates the need for mechanisms that do not assume perfect completeness.

When this pipeline is run in classic batch mode, the behavior is straightforward. The system waits until the bounded input is complete, groups all values for the key into one bundle, and emits a single sum. Because classic batch processing is usually event time agnostic, the default window is a global window covering all event time, and the result covers the full processing time of the job. The shaded region in the next visualization represents the total sum of 51, materialized after all inputs have been processed.

For unbounded streaming sources, the same global window cannot rely on the default watermark trigger alone, because a global window never becomes complete. The authors solve this by introducing triggers, which determine when in processing time the current result for a window should be emitted as a pane. A pane is not necessarily the final answer for a window; it can be an estimate, a partial result, or a refined result. This trigger mechanism is complementary to windowing. Windowing chooses where data are grouped in event time, while triggering chooses when grouped results are observed in processing time.

If the goal is to maintain a global per key sum and receive periodic updates, the authors can apply a repeating periodic trigger and use accumulating mode. In accumulating mode, each new pane is a refinement of the previous pane, because the window contents remain available and newer results overwrite or update older results downstream. The visualization of this execution shows updated global sums at one minute processing time boundaries. The overlapping output regions reflect that each emission includes data accumulated from prior processing time intervals.

Changing the accumulation mode to discarding changes the output semantics while preserving the trigger structure. In discarding mode, each trigger fire emits the result for the current pane and then clears the window state. Later panes are therefore independent of earlier panes, and the output represents deltas rather than cumulative totals. This pattern closely matches processing time windowing behavior found in many streaming systems, even though it is implemented through the unified trigger and windowing model. The visualization shows non overlapping output regions whose sums correspond to data observed between trigger fires.

The model can also express tuple based windows by using data driven triggers. Instead of triggering based on time, a trigger can fire when a certain count of elements has been observed. When the authors set the trigger to fire after every two records and use discarding mode, each pane contains the sum of two adjacent observations by processing time. This produces tuple window semantics without introducing a separate windowing abstraction. The final visualization illustrates this execution, where output panes are generated in response to data arrival counts rather than periodic clocks or event time boundaries.

Beyond time based and count based triggers, the authors support watermark triggers, percentile watermark triggers, processing time triggers, and custom external signals. Triggers can also be composed using logical operations, loops, and sequences. This composability allows a pipeline to emit an early partial result when data arrive, then later emit a more complete result when the watermark advances, and optionally emit an updated result when late data arrive. The refinement relationship among multiple panes is controlled by discarding, accumulating, and accumulating with retracting modes. In accumulating and retracting mode, each update is accompanied by a retraction of the previous value, which is important when a window produces multiple results that are later grouped again downstream. This design lets the pipeline adapt to both early approximate results and delayed corrections without relying on a separate batch recovery pathway.


Créer de l'IA avec l'IA

De l'idée au lancement — accélérez votre développement IA avec le co-codage IA gratuit, un environnement prêt à l'emploi et le meilleur prix pour les GPU.

Codage assisté par IA
GPU prêts à l’emploi
Tarifs les plus avantageux

HyperAI Newsletters

Abonnez-vous à nos dernières mises à jour
Nous vous enverrons les dernières mises à jour de la semaine dans votre boîte de réception à neuf heures chaque lundi matin
Propulsé par MailChimp