# Windowing (Stream Processing)

> Cutting an endless stream into pieces of time, so you can count.

**Field:** Data Engineering  
**Category:** Processing  
**Also known as:** Windowing, Stream Window, Time Window

## Think of it like

It is like counting cars that pass your house, five minutes at a time. Each five minutes gets its own count.

## Definition

Windowing cuts an endless stream into finite pieces of time, so totals can be worked out. Each window has a start and an end, and events fall into windows by their time. There are three main kinds: tumbling, sliding and session windows. A window's result is sent when the watermark passes its end. Without windows, a count over a stream would never finish.

## Example

A shop counts page views per page in 1-minute windows. The live chart shows a new bar each minute.

## Why it matters

Nearly every total on a stream is a window. Clicks a minute and sales an hour are both windows.

## Common mistake

Picking a window by habit. The size should match the question, such as one minute for alerts or one day for sales.

## Three principles

- **Finite pieces.** Of an endless stream.
- **Three main kinds.** Tumbling, sliding, session.
- **Closed by the watermark.** Then the result is sent.

## Related terms

- [Tumbling Window](https://learn.benibix.com/term/data/tumbling-window)
- [Sliding Window](https://learn.benibix.com/term/data/sliding-window)
- [Session Window](https://learn.benibix.com/term/data/session-window)
- [Watermark (Stream Processing)](https://learn.benibix.com/term/data/watermark)
- [Stream Processing](https://learn.benibix.com/term/data/stream-processing)

![Three timelines of the same dots. Tumbling windows cut the line into boxes that touch and never overlap. Sliding windows overlap, so one dot falls in more than one box. Session windows wrap each burst of dots and close after a gap.](https://learn.benibix.com/diagrams/stream-windows.svg)

---

Source: https://learn.benibix.com/term/data/windowing
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
