Real-world distributed systems generate continuous, unbounded streams of data—user clicks, IoT sensor readings, financial transactions, and server telemetry. In an ideal world, events would arrive at the processing engine instantaneously in the exact order they occurred.

In reality, mobile devices go into subway tunnels, network packets drop, and servers experience clock drift. Events arrive out-of-order, delayed by seconds, minutes, or days. Batch processing engines (Hadoop, MapReduce) introduce high latency by dividing data into arbitrary hourly chunks.

This module deconstructs modern stream processing foundations:

  • The Time Triad: Event Time (when the event occurred) vs. Ingestion Time (when it entered Kafka) vs. Processing Time (when the worker CPU executes it).
  • Watermark Mathematics: How watermarks act as temporal progress metrics, telling the engine when all events up to timestamp have arrived with high probability.
  • Windowing Topologies: Fixed/Tumbling windows, overlapping Sliding windows, and dynamic gap-based Session windows.
  • Stateful Snapshotting: How Apache Flink implements Chandy-Lamport asynchronous barrier snapshotting to recover state without replaying full message logs.

What you will learn

  • Distinguish Processing Time, Ingestion Time, and Event Time, and explain why distributed networks make event time the only reliable temporal foundation
  • Formulate bounded-out-of-orderness watermark generation heuristics to balance computation latency against late-arriving event completeness
  • Design tumbling, sliding, and session window aggregations with incremental state accumulators to minimize memory footprint
  • Analyze Chandy-Lamport distributed checkpointing algorithms used by Apache Flink to achieve end-to-end exactly-once state consistency
STAGE TOPICS

Topics in this chapter