Rice mill: 20 levels of streaming ETL: tumbling, sliding and session windows, watermarks, late events, stream joins, exactly-once. A deterministic stream sim.
On the mill's belt, data keeps coming like sacks: there is never a moment when all the data is in. That is a stream. The simplest stages handle one sack at a time. Filter checks one condition and sets aside what fails it. Map turns one sack into one new result. Tap a stage in the palette to put it on the belt, set its numbers, then start the belt. Once today matches, Mr. Sabar runs the same belt with another day's sacks.
Combining many elements into one number is called a combine: counting them, adding them up, averaging them. On a stream, a combine always works per window. Without a window the belt never finishes and the number can never be written; Beam even refuses to build such a pipeline.
A window cuts an endless stream into pieces that can be finished. Fixed windows are bins of the same size side by side, with no gap and no overlap. A sack goes into a bin by its harvest time, not by when it arrived. A bin's bounds are written [start, end): the start is in, the end is not.
A session window has no fixed size. Each element opens a window as wide as the gap, and windows that overlap merge into one session. A session ends after a gap with no new element. Sessions are per key: Mr. Tono's trips and Grandma Marni's trips never mix.
Every sack has two times: when it was harvested (event time) and when it reached the mill (processing time). On the road, one sack can overtake another. Windows divide by the timestamp given to each element. For a sack to land in the right hour, its timestamp has to be the harvest time.
A stream engine never knows for sure whether all the 07 sacks are in. A watermark is its answer for now: a hand that says "everything before this time has arrived". As soon as the hand passes a bin's end, that bin is weighed. A hand too close to the newest label leaves late sacks behind. A hand too far back keeps every board waiting.