Inferensys

Glossary

Event Time

Event time is the timestamp at which an event actually occurred in the real world, as recorded in the event's data, as opposed to the time the system processed it.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
STREAM PROCESSING FUNDAMENTALS

What is Event Time?

Event time is the timestamp at which an event actually occurred in the real world, as recorded in the event's data payload, as opposed to the time the system processed it.

Event time is the immutable, real-world timestamp embedded within an event's data record, representing the moment an action—like a click or sensor reading—actually happened. This is distinct from processing time, which is the wall-clock time when the event is observed by the stream processor. The difference between these two timestamps is known as skew, and managing it is the central challenge of accurate stream processing.

Relying on processing time leads to nondeterministic results because network latency and system load vary. Event time guarantees a repeatable, semantically correct computation. To handle out-of-order data caused by skew, stream processors use watermarks—heuristic thresholds that declare all events up to a specific event time have arrived, allowing windows to close and results to be emitted.

TEMPORAL FOUNDATIONS

Key Characteristics of Event Time

Event time is the definitive timestamp of when an action occurred in the real world, serving as the immutable anchor for accurate stream processing and sessionization.

01

Immutable Source of Truth

Event time is embedded in the event payload at the point of origin and cannot be altered by downstream processing. Unlike processing time, it is impervious to network lag, backpressure, or system clock skew. This immutability makes it the only reliable basis for:

  • Replaying historical data with exact fidelity
  • Auditing user behavior for compliance
  • Correlating events across geographically distributed producers
02

Handling Out-of-Order Data

In distributed systems, events rarely arrive in the exact sequence they occurred. Watermarks are the primary mechanism for managing this disorder. A watermark is a threshold timestamp that advances as the system observes event time progress, declaring that all data earlier than T should have arrived. Key behaviors:

  • Perfect Watermarks: Require total knowledge of input (rare in practice)
  • Heuristic Watermarks: Estimate progress using bounded delay assumptions
  • Late events arriving after the watermark can be discarded, logged to a side output, or used to recompute results
03

Windowing Boundaries

Event time enables meaningful temporal grouping through windowing. Without it, aggregations would reflect only the order of ingestion. Common window types include:

  • Tumbling Windows: Fixed-size, non-overlapping intervals (e.g., every 5 minutes)
  • Sliding Windows: Fixed-size windows that advance by a step smaller than the window size, creating overlap
  • Session Windows: Dynamic windows defined by a gap of inactivity, ideal for grouping user interactions into a single session All window boundaries are calculated against the event time, not the system clock.
04

Deterministic Replay

Because event time is a fixed attribute of the data, reprocessing a stream from a persistent log like Apache Kafka or Amazon Kinesis yields identical results every time. This property is critical for:

  • Backtesting new personalization models against historical user behavior
  • Correcting logic errors in a downstream processor without data loss
  • Migrating stream processing jobs between frameworks (e.g., from Apache Flink to a new engine) The system must read the original event timestamps, not the time of the replay operation.
05

Sessionization Logic

Sessionization relies entirely on event time to group discrete clicks, views, and actions into a single user session. A session window is defined by a timeout gap (e.g., 30 minutes of inactivity). The algorithm:

  1. Assigns each event to a key (user ID)
  2. Sorts events by event time
  3. Merges events into a session if the gap between consecutive events is less than the timeout Using processing time would fracture sessions due to arbitrary delivery delays, corrupting metrics like session duration and conversion paths.
06

Temporal Joins and Correlation

Joining multiple streams requires aligning them by event time to ensure correctness. For example, correlating an ad impression with a purchase requires matching the click event time, not the server receipt time. Interval joins in stream processors use event time bounds to match records across streams within a defined window. Without event time alignment, a fast stream would be joined with stale data from a lagging stream, producing nonsensical attribution.

TEMPORAL SEMANTICS IN STREAM PROCESSING

Event Time vs. Processing Time vs. Ingestion Time

A comparison of the three distinct timestamps used to reason about data in distributed streaming systems, each representing a different moment in an event's lifecycle.

FeatureEvent TimeProcessing TimeIngestion Time

Definition

Timestamp when the event actually occurred in the real world, embedded in the event payload.

Timestamp when the event is observed and processed by the stream processor operator.

Timestamp when the event first enters the streaming platform (e.g., broker or ingestion gateway).

Source of Truth

Client device or source system clock.

Stream processor's system clock.

Broker or ingestion server's system clock.

Determinism

Deterministic for a given event; independent of system lag.

Non-deterministic; varies with network delay, backpressure, and restart timing.

Deterministic for a given ingestion run; stable once recorded by the broker.

Handles Out-of-Order Data

Clock Skew Sensitivity

High; requires clock synchronization or correction logic.

None; uses a single local clock.

Medium; depends on clock sync between ingestion nodes.

Primary Use Case

Accurate temporal aggregations, sessionization, and business logic tied to user actions.

System monitoring, latency tracking, and operational alerting.

Fallback when event time is unavailable; provides a stable, monotonic alternative.

Required for Windowing

Watermark Generation Basis

Event time progress tracked via heuristic watermarks.

Not applicable; processing time is always current.

Ingestion time progress tracked via ingestion watermarks.

EVENT TIME CLARIFIED

Frequently Asked Questions

Clear, technical answers to the most common questions about event time semantics in streaming data pipelines, designed for data engineers and backend developers building real-time personalization infrastructure.

Event time is the timestamp at which an event actually occurred in the real world, as recorded in the event's data payload. Processing time is the wall-clock time at which the event is observed and handled by the stream processor. The critical distinction is that event time is immutable and grounded in reality, while processing time is subject to system lag, network delays, and infrastructure variability. In a global e-commerce personalization pipeline, a user's 'add to cart' action in Tokyo has an event time of 2024-01-15T14:32:00+09:00, but due to a regional network hiccup, it might arrive at the central decisioning engine with a processing time several seconds or even minutes later. Relying on processing time for windowed aggregations like 'items viewed in the last 5 minutes' would produce incorrect results, as late-arriving events would be assigned to the wrong temporal bucket, corrupting the real-time user profile and degrading recommendation accuracy.

Prasad Kumkar

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.