A watermark is a monotonically increasing timestamp injected into a data stream that tracks event-time progress. It declares to the stream processor that all events with a timestamp earlier than the watermark have been observed, allowing the system to close tumbling or sliding windows and emit final results. Without watermarks, a system would wait indefinitely for late data, preventing timely output.
Glossary
Watermark

What is a Watermark?
A watermark is a threshold timestamp in stream processing that declares a point after which the system expects no more late-arriving data for a given window, triggering final calculations.
Watermarks are typically generated heuristically, such as by subtracting a bounded lateness threshold from the maximum observed event time. When a watermark passes the end of a window, the window operator triggers computation and discards window state. This mechanism is fundamental to achieving correct, low-latency results in distributed engines like Apache Flink and Google Dataflow, balancing completeness against the need for real-time fraud scoring decisions.
Key Characteristics of Watermarks
Watermarks are the critical mechanism that allows stream processing systems to handle out-of-order data and make deterministic progress. They act as a declaration of stream completeness, enabling the system to finalize window calculations and release results.
Temporal Progress Tracking
A watermark is a monotonically increasing timestamp that flows through the stream alongside data records. It declares that all events with a timestamp less than the watermark value have been observed, allowing operators to close windows and emit results. Unlike wall-clock time, watermarks track event time, which is the time embedded within the data itself. This decoupling is essential for handling out-of-order events caused by network delays, clock skew, or distributed system latencies. The watermark advances based on observed event timestamps, often using a heuristic such as the maximum observed timestamp minus a configured allowed lateness bound.
Watermark Generation Strategies
Watermarks are generated using periodic or punctuated strategies:
- Periodic Watermarks: A timer fires at fixed intervals, inspecting the current maximum event timestamp and emitting a new watermark. This is the most common approach in systems like Apache Flink.
- Punctuated Watermarks: Specific events in the stream trigger watermark generation. For example, a special 'end-of-session' marker or a sensor reading indicating a batch is complete.
- Idle Source Handling: If a source partition becomes idle (no data), it must be marked as idle to prevent it from holding back the watermark for the entire pipeline. Without this, a single idle partition can stall all window outputs indefinitely.
Distributed Watermark Propagation
In a distributed stream processor with multiple parallel source tasks, the operator watermark is the minimum of all input watermarks. This ensures correctness: a downstream operator cannot close a window until every upstream shard has confirmed it has processed all relevant data. This watermark alignment is a critical bottleneck. A single slow or straggling source task can stall the entire pipeline's watermark progress. Advanced systems implement watermark skew mitigation techniques, such as ignoring idle sources or applying per-partition watermarks with a configurable alignment timeout.
Watermarks vs. Triggers
While often conflated, watermarks and triggers serve distinct roles. A watermark is a declaration of input completeness. A trigger is a mechanism that determines when window results are materialized. Watermarks are the default and most common trigger, but triggers can also be based on:
- Processing time: Fire every N seconds regardless of data completeness.
- Element count: Fire after a certain number of records.
- Composite triggers: Fire on watermark or early, then update on late arrivals. This separation allows systems to provide speculative early results before the watermark arrives, improving perceived latency while still providing a definitive final result.
Frequently Asked Questions
Clear, technically precise answers to the most common questions about watermarks in real-time fraud detection pipelines, designed for platform engineers and payment systems architects.
A watermark is a threshold timestamp that declares a point after which the stream processing system expects no more late-arriving data for a given window, triggering final calculations. It is the mechanism by which a system asserts, "I have observed all events with timestamps less than or equal to X." In the context of real-time fraud scoring pipelines, the watermark is critical because it determines when a sliding window aggregation of transaction velocity can be finalized and emitted to the risk scoring engine. Without a watermark, the system would wait indefinitely for out-of-order events, making it impossible to block a transaction before the authorization flow completes. The watermark is typically generated by the stream processing engine based on the maximum observed event time minus a configured allowed lateness bound.
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
Core concepts that interact with watermarks to guarantee accurate, deterministic results in real-time fraud detection pipelines.
Sliding Window Aggregation
A continuous computation technique that calculates metrics over a dynamically updating, overlapping time interval. Unlike fixed windows, sliding windows require watermarks to determine when an event falls out of the window's scope.
- Trigger: Recalculation occurs on every new event or at periodic intervals
- Use case: Computing rolling 5-minute velocity checks for a card number
- Watermark role: Ensures late-arriving transactions are not excluded from the window if they fall within the allowed lateness threshold
Complex Event Processing (CEP)
A method of tracking and analyzing streams of information to identify meaningful patterns and causal relationships across multiple data sources. CEP engines rely on watermarks to define temporal boundaries for pattern matching.
- Detects composite events like '3 failed logins followed by a password reset within 60 seconds'
- Uses event time rather than processing time for accuracy
- Watermarks signal when a pattern sequence can be finalized and emitted downstream
Backpressure Handling
A flow control mechanism that prevents a fast data producer from overwhelming a slower consumer. When a downstream operator is waiting for a watermark to advance before computing a window result, backpressure signals propagate upstream.
- Prevents out-of-memory errors in stateful stream processors
- Buffering strategy: Temporarily holds events until the watermark advances
- Critical in fraud pipelines where a single slow enrichment service can stall the entire scoring window
Exactly-Once Semantics
A data processing guarantee ensuring each record is processed precisely one time, eliminating data loss or duplication. Watermarks are integral to checkpointing mechanisms that enable exactly-once delivery in stateful operations.
- Checkpoint barrier: A special marker injected into the stream that aligns with watermarks
- Ensures window results are committed atomically
- Prevents duplicate fraud alerts if a streaming node fails and restarts mid-window
P99 Latency
A performance metric indicating the maximum response time experienced by the fastest 99% of requests. In streaming fraud systems, watermark propagation delay directly impacts P99 latency for windowed aggregations.
- Tail latency: The 1% of requests slower than P99 are often caused by waiting for late data
- Watermark heuristics balance completeness against latency
- A strict watermark of 500ms ensures P99 scoring latency stays within the authorization window
Dead Letter Queue (DLQ)
A secondary queue where messages that cannot be processed successfully are routed for manual inspection. Events arriving after the watermark has advanced beyond their event time are often sent to a DLQ rather than silently dropped.
- Late data policy: Defines whether to discard, reroute, or partially update results
- Preserves audit trails for transactions excluded from real-time windows
- Enables offline reconciliation to identify systemic clock skew issues across payment terminals

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