Rate LimitingFixed vs Sliding WindowMedium⏱️ ~3 min

Tumbling vs Hopping Windows in Stream Processing

In stream analytics, tumbling windows are fixed, nonoverlapping time intervals (for example, every 5 minutes from 00:00 to 00:05, 00:05 to 00:10, and so on). Each event belongs to exactly one window. Aggregations emit once per window close, producing periodic batch results. Hopping or sliding windows define both a window size and a hop interval; when the hop is smaller than the size, windows overlap and events contribute to multiple aggregates. Amazon Kinesis Data Analytics and Microsoft Azure Stream Analytics both support tumbling and hopping windows over event time with watermarking for late data handling. A common pattern is 5 minute tumbling windows for billing grade aggregates (deterministic cutoffs, exactly once semantics when paired with idempotent sinks) and 5 minute windows hopping every 30 seconds for operational dashboards (10 overlapping windows, updates every 30 seconds, fresher signals). Azure deployments process millions of events per second by partitioning streams; typical alerting latency is 2 to 10 seconds with moderate out of order tolerance. The state and compute cost of hopping windows is proportional to window_size divided by hop_size. A 10 minute window hopping every 1 minute maintains 10 overlapping panes per key. With 2 million keys, 64 bytes of state per pane, and 10 panes, you need 2,000,000 times 10 times 64 equals 1.28 GB per operator instance. More frequent hops mean more CPU to recompute aggregates and emit results. Tumbling windows keep only one pane per key, drastically reducing overhead but updating less frequently. Choose tumbling when you need deterministic, nonoverlapping reporting aligned with business logic (billing, compliance, service level agreement calculations). Choose hopping or sliding when you need near real time dashboards, anomaly detection, or moving averages where fresher updates justify the extra cost. Be explicit about the detection lag: a 5 minute tumbling window can add up to 5 minutes of latency before an anomaly is visible; a 5 minute window hopping every 30 seconds cuts that to 30 seconds but at 10 times the state and compute cost.
💡 Key Takeaways
Tumbling windows are nonoverlapping and emit once per window. State per key is O(1) pane. Ideal for billing, compliance, and batch aligned reporting where deterministic cutoffs matter.
Hopping windows overlap when hop interval is less than window size. A 10 minute window hopping every 1 minute has 10 overlapping panes, multiplying state and compute by 10 compared to tumbling.
Azure Stream Analytics processes millions of events per second using hopping windows for real time Key Performance Indicators (KPIs) with 2 to 10 second alerting latency and 30 second to 5 minute hop intervals depending on use case.
State sizing example: 2 million keys, 10 minute window, 1 minute hop (10 panes), 64 bytes per pane state. Total = 2,000,000 × 10 × 64 = 1.28 GB per operator instance before overhead.
Detection lag tradeoff: 5 minute tumbling window adds up to 5 minutes of latency before anomalies appear. Same window hopping every 30 seconds cuts lag to 30 seconds but costs 10 times more in state and Central Processing Unit (CPU).
Event time windows with watermarks handle out of order data but require tuning allowed lateness. Late events can trigger retractions and updates to already emitted results, requiring idempotent downstream consumers.
📌 Examples
Kinesis Data Analytics billing pattern: 5 minute tumbling windows for revenue aggregates (deterministic, once per window). One Kinesis shard supports 1 MB/sec or 1,000 records/sec; fan out to 100 shards for 100,000 records/sec throughput.
Azure Stream Analytics dashboard: 5 minute window hopping every 30 seconds for request rate monitoring. With 1,000,000 events/sec and 10 panes per key, operator processes 10,000,000 updates per second across all keys, requiring horizontal scale out.
Watermark configuration: 10 minute tumbling window, allow 2 minutes of lateness. Events with timestamps up to 2 minutes behind watermark are included; later events are dropped or sent to late data side output. Adds up to 2 minutes of extra detection lag.
← Back to Fixed vs Sliding Window Overview
Tumbling vs Hopping Windows in Stream Processing | Fixed vs Sliding Window - System Overflow