Key Partitioning and Stateful Stream Skew
Assign related events to the same state owner and decide when a heavy key can be split into independent partial aggregates.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
Co-location simplifies a per-key state transition
A pipeline can hash customer identifiers to partitions and process each key’s state at one owner under its ordering rules. A window balance for one key then has a clear history. More partitions can distribute many keys, but adding partitions does not reduce the load of a single key always mapped to one worker. Reassignment must transfer or reconstruct that key’s state.
Some operations permit a second aggregation step
A count can be split into several subkeys and merged by addition. A sequence-dependent decision may need the original per-key order, so arbitrary subdivision could change its result. Even for counts, duplicate and window semantics must be preserved during merge. Mergeable summaries provide the algebra. Distributed shard routing shows related tradeoffs when placement affects queries.[1][2]