A watermark is a timestamp-based progress indicator in stream processing that signifies how much event time data a system believes it has processed. It is a core mechanism for handling out-of-order data arrival and reasoning about when a time-based window can be considered complete for aggregation. Watermarks are typically propagated through the dataflow graph, allowing downstream operators to trigger computations, such as windowed aggregation, once the watermark passes the window's end boundary, assuming no more data for that window will arrive.
Glossary
Watermark

What is Watermark?
A watermark is a timestamp-based mechanism in stream processing that signifies the progress of event time, used to reason about completeness of data and trigger windowed computations.
Watermarks are essential for balancing data freshness and result completeness. A perfect watermark would precisely track event time, but in practice, they are heuristics, often configured with a bounded delay to accommodate late data. Systems like Apache Flink and Apache Beam implement watermarks to manage state efficiently and enable exactly-once semantics. Incorrect watermark generation can lead to premature result emission or excessive latency, making it a critical tuning parameter for data observability in real-time pipelines.
Key Characteristics of Watermarks
In stream processing, a watermark is a timestamp-based mechanism that signifies the progress of event time, used to reason about data completeness and trigger windowed computations. These cards detail its core technical properties and operational roles.
Event Time vs. Processing Time
A watermark is fundamentally tied to event time, the timestamp when an event actually occurred in the real world. This is distinct from processing time, when the system ingests the event. Watermarks track the progress of event time, allowing the system to handle events that arrive out-of-order from the network. For example, an event with an event time of 12:05:00 might be processed at 12:07:00 due to network latency.
Mechanism for Handling Late Data
A watermark establishes a frontier in the event time stream. It is a monotonically increasing timestamp that asserts: "No more events with an event time less than T are expected." Events arriving with a timestamp earlier than the current watermark are considered late data. Systems can be configured with a allowed lateness period, where late data within a grace period can still be incorporated into window results, after which it may be directed to a side output for analysis.
Trigger for Window Emission
The primary function of a watermark is to determine when a time-based window's computation can be finalized and its result emitted. For a window covering event times [12:00, 12:05), the system waits for the watermark to pass 12:05 (plus any configured allowed lateness) before concluding that all relevant data has likely arrived. This enables correct, deterministic results from out-of-order streams, as opposed to emitting speculative results based solely on processing time.
Sources and Heuristics
Watermarks can be generated in two primary ways:
- Perfect Watermarks: Require complete knowledge of the event stream (e.g., from a deterministic source like a replayable log). This is often impractical.
- Heuristic Watermarks: The common approach, where watermarks are inferred by observing event timestamps and tracking source progress. A simple heuristic is:
Current Watermark = Max Observed Event Time - Fixed Delay. More advanced systems like Apache Flink or Google Cloud Dataflow use source-specific operators to create these estimates, which balance latency with completeness.
Impact on Result Completeness vs. Latency
Configuring watermarks involves a fundamental trade-off. An aggressive (fast-advancing) watermark reduces output latency but increases the risk of incorrectly declaring data complete, leading to missed late data and inaccurate results. A conservative (slow-advancing) watermark increases result completeness and accuracy but introduces higher latency before window results are emitted. Tuning this is critical for meeting specific Service Level Objectives (SLOs) for data freshness.
Integration with Stateful Processing
Watermarks are essential for managing state in long-running streaming jobs. As the watermark advances, the system can trigger timer-based operations and perform state cleanup for windows that are now guaranteed to be complete. This prevents unbounded state growth. The combination of watermarks, checkpointing (for fault tolerance), and state management forms the backbone of robust, exactly-once stream processing architectures.
Watermark vs. Related Concepts
A comparison of the watermark mechanism with other key concepts for managing data timeliness, completeness, and processing guarantees in streaming architectures.
| Feature / Concept | Watermark | Service Level Objective (SLO) | Checkpointing | Exactly-Once Semantics |
|---|---|---|---|---|
Primary Purpose | Track progress of event time to reason about data completeness and trigger window computations. | Define a measurable target for system reliability or performance (e.g., freshness, latency). | Periodically save processing state to durable storage for failure recovery. | Guarantee each event is processed effectively exactly one time, despite failures. |
Time Domain Focus | Event Time (when the event occurred). | Processing Time or End-to-End Latency (system observation). | Processing Time (time of state snapshot). | Processing Time (ensuring deterministic state updates). |
Mechanism Type | Progressive, heuristic timestamp embedded in the data stream. | Contractual threshold defined in a policy or agreement. | Scheduled snapshot of operator state to external storage. | Protocol combining idempotent writes and transactional coordination. |
Handles Late Data | ||||
Enables Aggregation/Window Closure | ||||
Failure Recovery Role | No. Watermarks are part of the stream's progress and are not persisted for recovery. | No. SLOs are measurement targets, not recovery mechanisms. | Often implemented using checkpointing as a foundational mechanism. | |
Key Metric Output | Watermark lag (wall time - watermark). | Error budget (allowed violations vs. target). | Checkpoint duration and interval. | Duplicate or lost message count. |
Typical Implementation Scope | Within a single stream processing job or pipeline stage. | Across an entire service or data product. | Within a stateful stream processing framework (e.g., Apache Flink, Spark). | Across the entire pipeline from source to sink. |
Watermark Implementation in Major Frameworks
Watermarks are a core mechanism for handling event-time semantics in modern stream processing. This section details how leading frameworks implement and expose watermark logic for managing out-of-order data and triggering computations.
Frequently Asked Questions
A watermark is a timestamp-based mechanism in stream processing that signifies the progress of event time, used to reason about completeness of data and trigger windowed computations. These FAQs address its core function, mechanics, and role in data observability.
A watermark is a timestamp-based mechanism in stream processing that signifies the progress of event time, used to reason about the completeness of data and trigger windowed computations. It is a monotonically increasing timestamp that flows through the data stream, representing the system's belief that no events with an event time earlier than the watermark will arrive. This allows the processing engine to know when it can safely emit results for a given time window, as it assumes all relevant data for that period has been observed. Watermarks are essential for handling out-of-order data and providing deterministic, correct results in systems where processing time and event time are not aligned.
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
Understanding a watermark requires familiarity with the core stream processing concepts it interacts with, from time semantics to fault tolerance.
Event Time
Event time is the timestamp indicating when an event or transaction actually occurred in the real-world system that generated the data. This is distinct from processing time and is the fundamental temporal domain for watermarks. Watermarks are defined relative to event time to reason about data completeness.
- Example: A sensor reading timestamped at
2024-05-15T10:00:00Zhas that as its event time, even if it arrives at the processing system at10:05. - Critical for: Defining windows, calculating latencies, and ensuring correct temporal aggregations.
Late Data
Late data refers to events that arrive at a stream processing system after the system's watermark has already advanced past the event's timestamp. Handling late data is a primary design consideration for stateful streaming applications.
- Causes: Network delays, clock skew, or mobile device offline periods.
- Handling Strategies: Systems can use allowed lateness configurations to hold window state open, route late events to a side output for special processing, or simply discard them.
- Impact: Unhandled late data can lead to incorrect results in windowed computations.
Windowed Aggregation
Windowed aggregation is a core stream processing operation that groups and computes aggregates (sum, count, average) over events that fall within a defined time-based window. Watermarks are the primary mechanism for determining when a window is complete and its aggregation can be emitted.
- Window Types: Tumbling windows (fixed, non-overlapping), sliding windows (overlapping), and session windows (activity-based).
- Triggering: A watermark passing the end timestamp of a window triggers the computation and output of the aggregated result for that window.
Exactly-Once Semantics
Exactly-once semantics is a processing guarantee that ensures each event in a data stream is processed effectively and its resulting state updates are applied precisely one time, despite potential failures and retries. Watermarks interact closely with the state checkpointing mechanisms that enable this guarantee.
- Mechanism: Systems like Apache Flink use distributed snapshots (checkpoints) aligned with watermark generation to create consistent global state.
- Role of Watermark: Checkpoints often wait for a watermark to pass, ensuring all relevant events for a period are included in the snapshot, enabling deterministic recovery.
Checkpointing
Checkpointing is the process of periodically saving the state of a long-running, stateful data processing job to durable storage. This enables recovery from failures by restarting from the last saved consistent state rather than reprocessing the entire stream. Watermarks coordinate with checkpoints to ensure state consistency.
- Alignment: To ensure recovery is deterministic, a checkpoint barrier is propagated through the dataflow only after the watermark for a given time has been processed, guaranteeing all events up to that point are included.
- Trade-off: Frequent checkpoints reduce recovery time but increase runtime overhead.
Backpressure
Backpressure is a flow control mechanism in data streaming systems where a fast data source is signaled to slow down its data emission rate to match the processing capacity of a slower downstream consumer. This prevents system overload, queue blow-ups, and out-of-memory errors. Watermark progression can be indirectly affected by backpressure.
- Cause: A bottleneck in processing, network I/O, or sink writing speed.
- Effect on Watermarks: If a task is stalled due to backpressure, it cannot process watermarks from its inputs, causing watermark progression to stall across the entire dataflow graph. This can delay window computations and output.

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