Skip to main content

Apache Beam

At a glance
  • Problem solved: write a data pipeline once, with the same primitives for batch and streaming, then run it on the engine of your choice.
  • Era: Dataflow Model paper in 2015; proposal to the Apache Incubator on January 20, 2016, accepted on February 1, 2016 under the name Beam; top-level project on December 21, 2016; stable release 2.0.0 in May 2017.
  • Created by: Google (Cloud Dataflow team, including Tyler Akidau and Frances Perry), with Cloudera, data Artisans, Talend, Cask and PayPal for the donation.
  • Category: programming model, SDK and runners for data processing.

Historical context​

Beam is the latest link in a Google lineage. The incubator proposal sums it up: "The Beam model is a successor to MapReduce, FlumeJava, and Millwheel". After MapReduce, Google uses FlumeJava internally, "the FlumeJava batch engine" (PLDI 2010 paper), and MillWheel, "the MillWheel streaming engine" (VLDB 2013 paper). Google turns this into a managed service, Cloud Dataflow, whose SDK is open sourced "alongside commercialization of the idea and ahead of publishing papers".

In 2015, eleven Google engineers publish "The Dataflow Model" at VLDB. Their observation: "unbounded, unordered" data (web logs, mobile usage, sensors) is becoming the norm, users want event time and have an "insatiable hunger for faster answers", but one can never optimize correctness, latency and cost all at once. The Lambda Architecture, which doubles a batch pipeline with a streaming pipeline, fails in their view "on the simplicity axis". The paper proposes four questions to describe any computation: what, where in event time, when in processing time, and how results are refined.

On January 20, 2016, Frances Perry announces on the Google Cloud blog that Google, "along with participants from Cloudera, data Artisans, Talend, Cask and PayPal", is proposing Dataflow to the Apache Software Foundation. The proposal is accepted on February 1, 2016 "and the resulting project is now called Apache Beam". Google donates the model, the SDK and runners for Flink (written by data Artisans), Spark (Cloudera) and local execution; the runner for the managed Cloud Dataflow service stays at Google. The initial committers come from six organizations.

Beam leaves the incubator on December 21, 2016. Tyler Akidau takes stock in January 2017: "11 months ago, Google and a number of partners donated a giant pile of code", and since September no organization has exceeded about 50% of monthly contributors. Release 2.0.0, the first stable one, ships in May 2017.

Key idea​

A Beam pipeline describes what is computed, not how an engine runs it. The model separates four questions: What (which transformation), Where (in which event-time window), When (at which point in processing time to emit a result, thanks to watermarks and triggers) and How (how a late result corrects earlier ones). A batch is only a bounded stream: the same code serves batch and streaming. A runner then translates the pipeline for a given engine.

How it works​

  • Pipeline: the whole processing graph, from reading to writing.
  • PCollection: a distributed dataset, bounded (file) or unbounded (stream), where each element carries a timestamp.
  • PTransform: an operation on one or more PCollections (Map, GroupByKey, CombinePerKey, or a composite transform).
  • I/O: sources and sinks to read from and write to external systems.
  • Windowing and triggers: WindowInto slices event time (fixed, sliding, session windows); triggers decide when to emit.
  • Runners: in 2026 the site's capability matrix lists Google Cloud Dataflow, Flink, Spark, Hazelcast Jet, Kafka Streams (experimental), Twister2, Prism and local runners, each with its own level of support.
import apache_beam as beam
from apache_beam.transforms import window

# The engine is chosen at run time: --runner=FlinkRunner, SparkRunner...
with beam.Pipeline() as p:
(p
| beam.io.ReadFromText("clicks.csv")
| beam.Map(lambda line: (line.split(",")[0], 1)) # (page, 1)
| beam.WindowInto(window.FixedWindows(60)) # 60 s windows
| beam.CombinePerKey(sum) # clicks per page
| beam.Map(print))

By the numbers​

FigureContextSource
11Google authors of the paper "The Dataflow Model" (VLDB 2015)VLDB 2015 paper
6Organizations of the initial committers (2016)Beam proposal
4Runners presented with the proposal: Flink, Spark, local, Cloud Dataflow (January 2016)Google Cloud blog 2016
11 monthsLength of incubation, from February 1 to December 21, 2016Incubator page
5Officially supported runners when leaving the incubator (January 2017)Google Open Source blog 2017
About 22 and 10Large modules of the project, at least 10 written by the community (January 2017)Google Open Source blog 2017
About 50%Maximum share of a single organization among monthly contributors (since September 2016)Google Open Source blog 2017

Milestones​

  • 2010 and 2013: FlumeJava (batch) and MillWheel (streaming) papers, the Google engines the model derives from.
  • 2015: paper "The Dataflow Model" at VLDB (PVLDB vol. 8).
  • January 20, 2016: Google and its partners propose Dataflow to the Apache Incubator.
  • February 1, 2016: enters the incubator under the name Apache Beam.
  • June 15, 2016: first release, 0.1.0-incubating.
  • December 21, 2016: Apache top-level project (announced on January 10, 2017).
  • May 2017: Beam 2.0.0, the first stable release (distribution dated May 16, 2017).

Did you know?​

  • A portmanteau. According to an answer signed Frances, Beam comes from "Batch + strEAM" [S].
  • Google kept the service. The proposal states that the runner for the Cloud Dataflow service is not donated: Beam describes the pipeline, Google keeps selling the managed execution.
  • Born at Google, shared fast. Less than a year after the donation, at least 10 of the 22 large modules had been written by the community.
  • Flink, rival turned runner. The 2015 paper found Flink's event-time windows limited; a few months later, data Artisans was writing Beam's Flink runner.

Strengths and limitations​

StrengthsLimitations
Portability: the same pipeline on Dataflow, Flink, Spark and other runnersExtra abstraction layer on top of the engine
Batch and streaming unified in one modelFeatures vary by runner, hence an official capability matrix
Rich time model: windows, watermarks, triggers, late dataPerformance tied to the underlying engine
Open governance: no organization above about 50% of contributors (2017)The reference managed execution (Cloud Dataflow) stayed proprietary

What came next​

  • Runs on engines such as Flink and Spark; the capability matrix also lists an experimental Kafka Streams runner, at the crossroads with Kafka.
  • Answers the Lambda Architecture, put forward in 2011 by Nathan Marz, the creator of Storm, which keeps the same computation in a real-time layer and a batch layer: Beam expresses both in a single model.

Sources​

To do
  • Origin of the name "Batch + strEAM": only a Stack Overflow answer [S], no official Beam source found.
  • Official Beam 2.0.0 announcement not read; the date comes from the distribution archive.
  • "Performance tied to the underlying engine": carried over from the previous page, plausible but unsourced.
  • SDKs available today (Java and Python sourced in 2017; Go mentioned by the previous page): to confirm on the official site.