Menu Big Learning

Dataflow systems

A dataflow program names transformations and the data that passes between them. The shape of that flow helps explain why counting once and fitting a model over many passes can favor different systems.

A branching river delta viewed from above in two shades of green.
Branching and combining data streams

From records to keys

Consider counting the words in a collection of documents. Each map task reads documents locally and emits a word paired with a count. The system groups values for the same word. A reduce task adds those values. Separate words can be reduced independently, even when their first occurrences came from different machines.

In Dean and Ghemawat’s MapReduce model, the runtime divides the input, schedules tasks and arranges communication. The programmer supplies the two functions. The shuffle between them matters because records with matching keys need to reach the same logical group.

Word counts across documents
  1. Map words to counts
  2. Group by word
  3. Add each group

What changes on the second pass?

An iterative learner may use the same examples hundreds of times. Repeatedly loading and writing intermediate data can dominate the arithmetic. Hadoop made large batch jobs practical. Spark’s resilient distributed datasets, or RDDs, offered a way to keep commonly used partitions in memory.

An RDD describes a collection partitioned across workers. Transformations create new collections, and their lineage describes how a missing partition can be recomputed. Keeping data for reuse is most valuable when the next calculation can actually use it. A one-pass job offers little opportunity for that saving.

When time is part of the question

A stream of events keeps arriving. A temporal query might ask which events occurred within the same interval, or maintain an estimate that changes with each new observation. Waiting until the entire input exists is impossible for an unbounded stream.

Jonathan Goldstein’s 2012 talk addressed temporal analytics. In 2013, Derek Murray presented timely dataflow in Naiad, a system for low-latency and iterative work. Both talks made the structure of the computation visible in the choice of system.

Further reading