A streaming job counting orders by region must retain each region’s running total. In Flink, that total is keyed state. A source operator may also retain its reading progress as operator state. Checkpointing periodically captures application state so the job can recover after a failure. section 8.4.2
Where checkpoints live determines what failures they can survive. Checkpoints held in JobManager memory can support recovery from a TaskManager failure, but are lost if the JobManager or cluster fails. Production jobs can save checkpoints to external storage such as HDFS or S3. RocksDB can hold large, long-lived Flink state on disk and work with checkpointing; Kafka Streams instead uses Kafka for changelogs and checkpoints. section 8.4.2





