Dataflow Shuffles and Co-Located Keys
Follow a key from a producer to a grouping operator and use safe local combining to reduce cross-machine traffic.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
A shuffle moves inputs into a new partitioning
A grouping operation requires all records for a key to reach a compatible downstream partition. If upstream placement is by date and the grouping key is device, many records cross worker boundaries. The exchange may include hashing, serialization and buffering. Processing often depends on the slowest receiving partition or stage worker. Existing compatible placement can sometimes avoid the exchange.
Local combining changes the number of transferred values
For a per-key sum, a worker can sum local values first and send one partial summary per repeated key. A global mean requires sums and counts, not just local means. A nonassociative update may not permit that rewrite. Mergeable aggregates establish the algebra. Stream partitioning explains key skew when one destination still receives a large share.[1][2]