Analytics Stream Analytics premium field-manual-complete field-manual-complete

Tumbling window

A tumbling window is a clean way to cut a stream of events into equal time boxes. Five-minute windows, hourly windows, and daily windows are common examples. Unlike a hopping window, the boxes do not overlap. Unlike a sliding window, a new result does not appear every time the contents change. Each event is counted in one window only. That makes tumbling windows easy to explain to business users: this total belongs to this exact period, and the next total belongs to the next period.

Aliases
TumblingWindow, TUMBLINGWINDOW, tumbling window function, fixed non-overlapping window
Difficulty
intermediate
CLI mappings
5
Last verified
2026-05-28

Microsoft Learn

In Azure Stream Analytics, a tumbling window groups events into fixed-size, non-overlapping, contiguous time intervals. Each event belongs to only one window, making the function useful for periodic aggregations such as counts, averages, totals, or alerts over live streaming data.

Microsoft Learn: Tumbling Window - Stream Analytics Query2026-05-28

Technical context

In Azure Stream Analytics, a tumbling window is used in the query GROUP BY clause to aggregate events by event time. It relies on timestamp handling, late-arrival policy, input ordering, and job output timing. The query emits a result at the end of each window, usually using System.Timestamp as the window end time. Tumbling windows are part of streaming query design, but they also affect output sinks, dashboards, alerts, and downstream storage partitioning because every aggregate is aligned to fixed intervals.

Why it matters

Tumbling windows matter because many streaming metrics need stable period boundaries. Operations teams ask for events per minute, average temperature per ten seconds, orders per hour, or failures per day. If the windowing rule is unclear, dashboards disagree, alerts fire twice, and downstream tables receive overlapping totals. Tumbling windows avoid overlap and make backtesting easier, but they also force a decision about window size, timestamp field, late data, and output delay. The choice directly affects alert freshness, aggregate accuracy, storage partitioning, and how confidently teams compare one period with the next. It becomes a shared definition for operations, analytics, and incident review.

Where you see it

Signals, screens, and Azure surfaces where this term usually becomes operational.

Signal 01

In Stream Analytics SQL, TumblingWindow appears inside GROUP BY with time unit, window size, and optional offset controlling each aggregate period. for production query reviews.

Signal 02

In transformation previews or query tests, sample events map into fixed non-overlapping windows and show output timestamps at the window end. before release approval checks.

Signal 03

In dashboards and output tables, tumbling-window results appear as regular time buckets such as per-minute counts, hourly averages, or daily totals. for operations review periods.

When this becomes relevant

Specific situations where this term helps solve real Azure design, operations, migration, security, reliability, cost, or governance problems.

  • Calculate non-overlapping per-minute counts for operations dashboards where each event must be counted once.
  • Trigger alerts when average sensor temperature crosses a threshold within a fixed 15-second interval.
  • Write hourly stream summaries to lake or warehouse tables without overlapping totals that confuse reporting.
  • Compare telemetry periods consistently during incident review, capacity planning, or service-level reporting.
  • Reduce raw event volume by aggregating stream data before it reaches storage, BI, or downstream analytics jobs.

Real-world case studies

Different enterprise-style examples that show the term being used to hit measurable objectives.

Case study 01

Airport operations team gets reliable baggage alerts

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

An airport monitored bag-tag scans from conveyor sensors, but alert counts differed between dashboards and control-room displays. One query used overlapping windows, causing the same spike to appear several times.

Business/Technical Objectives
  • Count delayed bag scans once per fixed two-minute period.
  • Align control-room alerts with the airport operations dashboard.
  • Reduce false escalation during brief sensor bursts.
  • Keep aggregate output latency under one window after each boundary.
Solution Using Tumbling window

The data team rewrote the Stream Analytics query to use a TumblingWindow grouped by terminal, belt, and delay category. Event time came from the scanner message rather than ingestion time, and the job projected System.Timestamp as the window end. CLI checks exported the transformation query from production and test so reviewers could confirm the same window duration, grouping keys, and output sink. A replay file with known scan times validated bucket boundaries before release. Operators watched watermark delay, late input events, and output errors during the first peak travel weekend.

Results & Business Impact
  • Duplicate spike alerts fell 83% because each scan belonged to one fixed window.
  • Control-room and dashboard counts matched within one event for 98.7% of sampled periods.
  • Average alert-review time dropped from 12 minutes to 4 minutes during peak baggage flow.
  • Output latency stayed under 70 seconds after each two-minute window closed.
Key Takeaway for Glossary Readers

A tumbling window gives operations teams stable period boundaries when overlapping stream results would create confusion.

Case study 02

Food distributor proves cold-chain compliance

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A refrigerated food distributor collected trailer temperature events every few seconds. Auditors wanted ten-minute average temperatures, but raw data volumes made manual warehouse aggregation slow and expensive.

Business/Technical Objectives
  • Create non-overlapping ten-minute temperature summaries for every trailer.
  • Reduce raw-event processing in the reporting warehouse.
  • Flag temperature excursions quickly enough for dispatchers to intervene.
  • Preserve an auditable timestamp for every compliance summary.
Solution Using Tumbling window

Architects used Azure Stream Analytics with TumblingWindow minute intervals grouped by trailer ID and route. The query calculated average, maximum, and event count per window and wrote summaries to a storage-backed compliance table. TIMESTAMP BY used the device reading time, and late-arrival policy was tuned to tolerate normal cellular delay without hiding stale devices. CLI exported job, input, output, and transformation settings into the release record. Dispatch dashboards read the summary table, while raw events remained available for targeted investigations rather than every routine report.

Results & Business Impact
  • Warehouse rows for compliance reporting dropped 94% compared with storing only raw event queries.
  • Dispatchers received excursion summaries within 11 minutes, down from a prior 45-minute batch delay.
  • Audit preparation time decreased from two days to four hours for monthly cold-chain evidence.
  • Streaming-unit utilization stayed below 68% after grouping keys and window size were load tested.
Key Takeaway for Glossary Readers

Tumbling windows can turn high-volume telemetry into period-based evidence without forcing every report to scan raw events.

Case study 03

Game studio tunes matchmaking incident telemetry

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A multiplayer game studio tracked matchmaking failures during new season launches. Existing rolling queries produced noisy alerts, and engineers struggled to compare one traffic burst with another.

Business/Technical Objectives
  • Measure matchmaking failures per region in consistent one-minute buckets.
  • Cut duplicate incident alerts during predictable launch surges.
  • Feed clean aggregates into capacity planning after each season event.
  • Keep window results aligned across live dashboards and postmortems.
Solution Using Tumbling window

The studio changed its Stream Analytics transformation to group matchmaking events by region, platform, and error family using one-minute tumbling windows. The query emitted count, unique session estimate, and failure rate metrics at each window end. CLI comparisons ensured that staging and production used the same transformation before the launch. Engineers replayed synthetic launch traffic to test late events, output sink pressure, and dashboard labels. Alert rules were rewritten around non-overlapping window totals, while longer retention of raw events stayed available for root-cause investigations.

Results & Business Impact
  • Duplicate launch alerts decreased 69% after overlapping windows were removed from the primary signal.
  • Engineers identified a regional capacity imbalance 18 minutes earlier than the previous season launch.
  • Postmortem metric reconciliation time fell from six hours to 90 minutes.
  • Dashboard and exported lake summaries matched exactly for all audited one-minute buckets.
Key Takeaway for Glossary Readers

Tumbling windows make streaming metrics easier to compare when teams need clean period-over-period incident evidence.

Why use Azure CLI for this?

Azure CLI is useful for tumbling windows because the window expression lives inside a Stream Analytics transformation, but the production behavior depends on the job, inputs, outputs, compatibility level, streaming units, and runtime state. As an experienced Azure engineer, I use CLI to show the transformation query, confirm inputs have the expected timestamp field, inspect job diagnostics, and restart jobs only after reviewing output start time. CLI is also useful for comparing query text across environments and capturing evidence during alert disputes. The portal can edit queries; CLI makes query configuration reviewable and repeatable. before any production restart or query update.

CLI use cases

  • Show the Stream Analytics transformation query and confirm the TumblingWindow expression before deployment.
  • List jobs, inputs, outputs, and transformations to verify that the windowed query is attached to the right job.
  • Start or stop a job with a reviewed output start time after changing window size or timestamp handling.
  • Export job definitions and compare tumbling-window query text across dev, test, and production.
  • Inspect metrics and diagnostics for watermark delay, late events, output errors, and streaming unit pressure.

Before you run CLI

  • Confirm tenant, subscription, resource group, Stream Analytics job name, transformation name, and target region.
  • Check whether you are only inspecting query text or about to start, stop, or update a production streaming job.
  • Understand the event timestamp field, late-arrival policy, output start time, and downstream sink capacity before changing windows.
  • Review streaming-unit quota and cost impact if the new window increases grouping cardinality or output frequency.
  • Use JSON output for query comparison and avoid pasting sensitive connection strings or event samples into logs.

What output tells you

  • transformation query text shows the TumblingWindow duration, offset, grouping keys, timestamp projection, and aggregate functions.
  • job state shows whether the streaming job is running, stopped, degraded, or waiting for inputs and outputs.
  • input and output configuration identify the event source and destination affected by the windowed aggregate.
  • diagnostic metrics show whether watermark delay, late events, backlog, or sink throttling are affecting window completion.
  • streamingUnits and compatibility settings help explain whether query performance changed after a window adjustment.

Mapped Azure CLI commands

Azure Stream Analytics tumbling window CLI commands

adjacent
az stream-analytics transformation show --job-name <job> --resource-group <resource-group> --name <transformation-name>
az stream-analytics transformationdiscoverAnalytics
az stream-analytics job show --name <job> --resource-group <resource-group>
az stream-analytics jobdiscoverAnalytics
az stream-analytics input list --job-name <job> --resource-group <resource-group>
az stream-analytics inputdiscoverAnalytics
az stream-analytics output list --job-name <job> --resource-group <resource-group>
az stream-analytics outputdiscoverAnalytics
az stream-analytics job start --name <job> --resource-group <resource-group> --output-start-mode JobStartTime
az stream-analytics joboperateAnalytics

Architecture context

Architecturally, a tumbling window defines the temporal contract of a streaming aggregate. I choose it when the business needs non-overlapping buckets: every event counts once, each result has one period boundary, and downstream consumers can store or alert on fixed intervals. The window size must match event frequency, tolerance for latency, late-arrival behavior, and the speed of downstream sinks. Too small creates noisy output and higher cost. Too large hides incidents. A good design documents the event timestamp, time zone assumption, allowed lateness, aggregation fields, output partitioning, and alert thresholds so operations and analytics interpret results the same way. Name it clearly.

Security

Security impact is mostly indirect. A tumbling window does not grant access, open a network path, or store secrets. The risk appears in the streaming job that uses it: inputs may contain sensitive events, outputs may land in storage or databases, and query results may expose aggregated customer or operational behavior. Operators should secure Event Hubs, IoT Hub, storage, and output sinks with managed identity, private networking, RBAC, and diagnostic controls. They should also avoid logging raw event payloads unnecessarily. Windowed aggregates can still be sensitive when they reveal traffic patterns, failures, or personal activity over time. in shared reports.

Cost

Cost impact is indirect but real. Smaller tumbling windows produce more frequent output, more writes, more alerts, and potentially more downstream processing. Larger windows reduce result frequency but can increase state held by the job and delay operational response. Streaming units, input volume, query complexity, output sink transactions, and retained diagnostics all affect spend. A poorly chosen window may create expensive noise in dashboards or incident systems. FinOps reviews should compare business freshness needs with result frequency, sink costs, alert volume, and whether aggregating earlier reduces downstream warehouse or lake processing. That comparison prevents paying for freshness nobody actually uses.

Reliability

Reliability depends on whether events are assigned to the intended window even under delay, reordering, or restart. Stream Analytics uses event time and windowing rules, so timestamp selection and late-arrival policy are critical. A bad timestamp can place events in the wrong period. A window that is too short can amplify late data problems; a window that is too long can delay detection. Operators should test job restart behavior, output start time, input backlog, late events, and output sink availability. Reliable tumbling-window design makes the definition of complete period explicit. The team should rehearse recovery using replayed samples before production cutover.

Performance

Performance depends on event rate, grouping cardinality, window size, query complexity, and output sink capacity. A tumbling window grouped by many keys can create many simultaneous aggregates at each boundary. If the job lacks enough streaming units or the sink cannot absorb bursts, output appears late. Too many small windows can create constant work, while very large windows can hold state longer. Operators should watch watermark delay, input backlog, late input events, resource utilization, and output errors. The practical performance question is whether each window closes and writes results before the next business decision depends on it. under peak load.

Operations

Operators inspect tumbling windows by reviewing the Stream Analytics query, job status, inputs, outputs, transformation, compatibility level, streaming units, and diagnostic metrics. Troubleshooting usually asks whether events have the expected timestamp, whether output appears at window end, whether late events are dropped or adjusted, and whether output sinks are throttling. During changes, operators compare query text in source control and production, then validate sample results against known event sets. Runbooks should include how to stop and start jobs safely, choose output start time, and verify no windows were missed. These checks prevent dashboard arguments from becoming blind production restarts during releases.

Common mistakes

  • Using arrival time when business logic requires event time, which places delayed events in misleading windows.
  • Choosing a one-second window for dashboards that only need minute-level visibility and then creating noisy outputs.
  • Forgetting that tumbling windows do not overlap, so they cannot express rolling average behavior by themselves.
  • Changing the window size without updating downstream table partitioning, alert thresholds, or dashboard labels.
  • Restarting a Stream Analytics job without checking output start time and then misinterpreting missing or duplicated windows.