Stream partitioning determines how records are distributed among parallel processing tasks. In Kafka Streams, partitioning by key follows the underlying Kafka topic partitions. In Apache Flink, it is a logical distribution during execution, independent of Kafka or another external system. section 8.4.2
Orders by region
To count orders per region, use region as the key and group events accordingly. Flink’s keyed state associates the resulting state with each key, while its execution plan and task parallelism determine how work is distributed. section 8.4.2
Figure 8.21 The Flink architecture. The Flink Client is responsible for transforming a program into a graph, which is submitted to the JobManager. JobManager converts it into an ExecutionGraph and deploys tasks to available TaskManagers.
The architecture diagram shows how an ExecutionGraph deploys tasks to TaskManagers, providing context for Flink’s task-level distribution. section 8.4.2
