A watermark is a monotonically increasing timestamp injected into a data stream to declare that no events with a timestamp earlier than the watermark will be observed. It serves as a heuristic assertion of completeness, allowing a stream processor to close windowing operations and emit results without waiting indefinitely for late-arriving data. The watermark advances based on observed event timestamps minus a configured allowed lateness bound.
Glossary
Watermark

What is a Watermark?
A watermark is a mechanism in stream processing that tracks the progress of event time, providing a threshold to indicate that all data up to a certain timestamp has been received, thus handling out-of-order data.
Watermarks are essential for handling the inherent skew between event time and processing time in distributed systems. When a stream processor receives a watermark T, it triggers computations for all windows with an end time less than or equal to T. This mechanism enables correct, deterministic results over unbounded, out-of-order data, balancing result latency against completeness in architectures like Apache Flink and Google Dataflow.
Key Characteristics of Watermarks
Watermarks are the fundamental mechanism that allows stream processors to reason about event time completeness in the face of out-of-order data. They provide a declarative threshold that tells the system, 'all events with a timestamp earlier than T have likely arrived,' enabling correct windowing and state management.
Event Time vs. Processing Time
Watermarks bridge the critical gap between event time (when something happened) and processing time (when the system observed it). In distributed systems, these timelines diverge due to network latency, clock skew, and backpressure. A watermark is a monotonically increasing timestamp that declares the system's best estimate of event time progress. It allows operators to say, 'I have observed all data up to 12:01:00,' even if the processing clock reads 12:05:00. This decoupling is essential for deterministic, reproducible results regardless of when computation executes.
Handling Out-of-Order Data
The primary purpose of a watermark is to define a grace period for late-arriving data. Without watermarks, a window operator would never know when to materialize results. Key behaviors include:
- Heuristic Generation: Watermarks are typically derived by observing the maximum event timestamp seen so far, minus a configurable allowed lateness bound.
- Idleness Handling: If a source partition goes silent, the watermark must not stall. Systems like Apache Flink use idle timeout mechanisms to mark partitions as idle and advance the watermark based on other active partitions.
- Late Data Routing: Events arriving after the watermark has passed their window are considered late. They can be discarded, logged to a side output, or used to issue corrective updates depending on the processing mode.
Watermark Propagation in DAGs
In a directed acyclic graph (DAG) of stream operators, watermarks flow downstream alongside data. When an operator consumes multiple input streams, it must compute an input watermark by taking the minimum of all upstream watermarks. This conservative approach ensures correctness: a multi-input join or union cannot safely process up to time T until all its inputs have reached T. This propagation logic is critical for maintaining exactly-once semantics in stateful operations and prevents premature window firings that would produce incomplete results.
Periodic vs. Punctuated Watermarks
Stream processors support two generation strategies:
- Periodic Watermarks: Generated at a fixed interval (e.g., every 200ms). The generator inspects the current maximum event time and emits a watermark. This is efficient for high-throughput streams where per-event overhead is prohibitive.
- Punctuated Watermarks: Generated in response to specific events in the stream. A sensor might emit a 'batch complete' marker, or a data file might contain an end-of-file record. This provides precise, data-driven progress tracking but requires the source to embed such signals. The choice involves a trade-off between latency (how quickly a window fires) and computational overhead.
Allowed Lateness and Side Outputs
The watermark defines the point of no return for a window, but systems often allow a configurable allowed lateness period beyond the watermark. During this grace period, a window remains in memory, and late events update the result. Once allowed lateness expires, the window state is cleaned up. Events arriving after this final deadline are routed to a side output—a separate stream that acts as a dead letter queue for late data. This pattern enables:
- Corrective updates to downstream sinks.
- Auditability of data quality issues.
- Separate business logic for processing stragglers without blocking the main pipeline.
Watermark Skew and Skew Mitigation
In a distributed system, different source partitions progress at different rates. A single slow partition can hold back the entire watermark, causing watermark skew and delaying all window outputs. Mitigation strategies include:
- Idle source detection: Automatically marking stalled partitions as idle after a timeout.
- Watermark alignment: In structured streaming, applying a maximum acceptable skew between partitions.
- Speculative execution: Proactively processing data assuming a partition is complete, with rollback mechanisms if late data later arrives. Without these techniques, a single straggling Kafka partition can stall a global aggregation indefinitely.
Frequently Asked Questions
Clear, technical answers to the most common questions about watermarks in stream processing, covering their role in handling out-of-order data and triggering computations.
A watermark is a mechanism in stream processing that tracks the progress of event time, providing a threshold to indicate that all data up to a certain timestamp has been received. It is a monotonically increasing timestamp injected into the data stream by the system or the application. When a watermark with timestamp T passes through a streaming operator, it signals that no more events with an event time earlier than T are expected to arrive, allowing the operator to finalize and emit results for time windows ending at or before T. This is critical for handling out-of-order data and ensuring correct, deterministic results in the face of network delays and distributed system imperfections.
Watermark vs. Related Concepts
How watermarks differ from other stream processing mechanisms for managing time and data completeness
| Feature | Watermark | Checkpointing | Windowing | Event Time |
|---|---|---|---|---|
Primary purpose | Track event-time progress and handle lateness | Save operator state for fault recovery | Divide unbounded streams into finite chunks | Timestamp when event actually occurred |
Handles out-of-order data | ||||
Triggers computation | ||||
Persists state to durable storage | ||||
Defines temporal boundaries | ||||
Recovers from failures | ||||
Typical granularity | Millisecond-level threshold | Application-defined interval | Fixed, sliding, or session windows | Per-event timestamp |
Late data handling | Discards or routes to side output | Not applicable | Updates window results if allowed | Not applicable |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Mastering watermarks requires a solid understanding of the core stream processing concepts they depend on. These terms define the temporal and architectural context in which watermarks operate.
Event Time
The timestamp of when an event actually occurred in the real world, embedded within the event record itself. This is distinct from processing time, which is the wall-clock time when the event is observed by the stream processor. Watermarks are fundamentally based on event time to correctly handle out-of-order data and provide deterministic, reproducible results regardless of when computation happens.
Out-of-Order Data
A condition where events arrive at the processing system in a sequence that differs from their chronological event time order. This is caused by network latency, distributed system clock skew, or partitioned sources. A watermark is the primary mechanism to define a bound on this disorder, telling the system how long to wait for late data before finalizing a computation.
Side Output
A secondary output stream from a dataflow operator that handles special-case data without stopping the main processing flow. In the context of watermarks, side outputs are commonly used to capture and log events that arrive after the allowed lateness period has expired. This pattern enables dead-letter analysis without corrupting the primary, timely results.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us