Dataflow Engines 00:00:01 The railway planner for a computation A transit analyst asks for daily passenger totals by line. Her code describes transformations. A dataflow engine turns those dependencies into stages and tasks that run across machines. Read, filter, group and sum are only described. The shuffle is the border. Stage 1 reads, filters and sums in part. Stage 2 makes the final sum. The driver sends one task for each partition. Task 1 makes A 18. Task 2 has B 5 and C 3. The driver collects the result. Follow a single input partition. Filtering can discard rows locally, and a partial sum can shrink what travels. The final group still needs compatible keys to meet at the same destination. 00:00:55 Which tracks cross the network? A local filter can flow straight into a map. Grouping a key that is spread across machines usually requires a shuffle. Trace a value's destination and you can predict where the expensive boundary appears. Output 1 needs only input 1. No data moves. Filter then map run in one task, row by row, with nothing stored between. Output 1 needs a part of every input, so all must be ready: a shuffle. If both tables are partitioned by the join key, output 1 needs only partition 1 of each. Establish the physical partitioning before predicting a shuffle. Two tables already arranged on compatible join keys can sometimes reuse that layout instead of moving every row again. 00:01:43 Send a pocket timetable to the passengers The click collection is huge and the campaign lookup is tiny. Broadcast the little lookup to each executor so the enormous click partitions can stay in place. Clicks are 2 TB. Campaigns are 5 MB. Both tables are sent across the network by the join key: about 2 TB. Send the five-megabyte campaign lookup to each of the forty executors. The two-terabyte click data stays on its existing workers. Forty times five megabytes gives two hundred megabytes in total. If campaigns grew to 50 GB, each executor would need to hold all of it. Shuffle both, or partition both by the same key. Check the materialized lookup size, worker memory and number of copies. A file small enough on disk may expand when decoded. A broadcast that spills or exhausts memory loses its advantage. 00:02:36 Rebuild the missing carriage One executor disappears with a cached partition. The engine knows which input and transformations produced it. With replayable input and deterministic work, it can reconstruct that partition from lineage. Each executor has filtered one partition and cached it. Partition 1 and its cached copy are gone. Partition 1 came from block 1 of the input through one filter. Executor 3 reads block 1 and filters it. Partitions 0 and 2 are not touched. Lineage describes a computation. It cannot restore a vanished external input or retract an email sent inside a task. Treat input durability and external side effects as separate design decisions. 00:03:21 A checkpoint freezes the right combination A streaming job keeps a running count forever, so replaying its entire history after each failure gets expensive. Snapshot its state together with a consistent input position and restart from that pair. The source notes that it has read up to position 100, saves that, and sends barrier 7. The barrier reaches the sum, which is 42 by then. It saves 42. The sum starts from 42 and the source goes back to position 100. Events after 100 are read again. Each one is in the sum once. The state can then count each record once in its recovered view. For visible outputs, use a compatible transactional or idempotent sink. The checkpoint alone cannot govern an arbitrary external side effect.