Data Engineering Reference/Deep Cuts (Platform)

Apache Beam & the Unified Model

PCollections, PTransforms, runners (Dataflow, Flink, Spark), and the portability layer Google uses for batch+stream unification.

5/5Overview: 25m

Why Beam exists

Different engines (MapReduce, Spark, Flink, Dataflow) had incompatible APIs. Apache Beam provides a portable programming model — write once, run on multiple runners.

Google Cloud Dataflow is the managed Beam runner; the theory is the Dataflow Model (same as Streaming Systems book).

Core abstractions

AbstractionMeaning
PCollectionDistributed dataset (bounded or unbounded)
PTransformOperation on PCollection
PipelineDAG of transforms
RunnerExecutes on Spark, Flink, Dataflow, etc.

Windowing and watermarks are first-class in the API — not bolted on.

Runners

RunnerNotes
DataflowGCP managed, autoscale, streaming-first
FlinkSelf-hosted streaming
SparkBatch-oriented runner
DirectLocal dev

Same pipeline code for batch backfill (bounded source) and streaming (unbounded) — strong Kappa story.

When Beam vs native Spark/Flink

Choose BeamChoose native
Multi-cloud portabilityTeam deep on Spark only
GCP Dataflow standardDatabricks-native Spark
Unified batch+stream one codebaseSimple batch job

Link to Topic 4

Event time and windows — Beam implements the model; Flink and Spark implement similar concepts natively.

Interview answer template

"We'd prototype on Direct runner, prod on Dataflow for autoscaling streaming. Bounded ReadFromText for backfill, unbounded ReadFromKafka for live — same ParDo transforms. Switch runner to Flink if we leave GCP."

Further Reading

Hands-On Tasks (Optional)

Pipeline design drills and whiteboard exercises — DAG sketches, partition plans, backfill strategies. Assumes Databases and SQL fundamentals are in place.

  • Pick a Beam runner

    Same pipeline for batch backfill and streaming ingest. Compare running on Dataflow vs Flink runner — ops, cost, and state backend implications.

    10m