Data engineering·Time and correctness in streams
the running total is kept per customer id, so scaling out just moves whole customers between workers.
Keyed state
Also calledper-key state, partitioned state
State scoped to a partition key, so each worker owns a disjoint slice of it. Making state keyed is what makes a streaming job parallelisable at all, because two workers never need to see the same counter. The consequence is that your key choice is now a partitioning decision, an ordering decision and a memory-hotspot decision at once — one enormous customer becomes one enormous worker.