Keyed state is Flink-managed state associated with a specific key. Events are grouped by key before a stateful operation accesses or updates that key’s state. Unlike Kafka partitioning, Flink’s partitioning distributes data logically among parallel tasks and does not depend on Kafka. section 8.4.2
Orders by region
To count orders per region, use the region as the key. Each region’s events are grouped so its count can be updated separately. section 8.4.2
State storage affects recovery. In-memory state with checkpoints held by the JobManager can recover from a TaskManager failure but is lost if the JobManager or cluster fails. For larger, longer-lived state, RocksDB can store state on disk, while checkpoints can be saved externally to HDFS or S3. section 8.4.2
