Windowing: Sliding and Session Windows

Learn about sliding and session windows in Kafka Streams.

We'll cover the following

Sliding windows

Sliding windows are also time-based windows. Like tumbling and hopping windows, they have a fixed size, but unlike them, they are not epoch-aligned. Instead, their boundaries are defined by the timestamp of incoming events. Additionally, their boundaries are inclusive both at the start and the end.

As the window is sliding over the input stream, a new window is created for each record that enters the sliding window and for each record that drops out of the sliding window.

Below is an example of a sliding window with a fixed size of 5000 ms:

Get hands-on with 1200+ tech skills courses.