Flink’s two execution runtime modes are streaming mode and batch-mode. The main difference is that in Streaming mode, as the data is unbounded and arrives continuously, all operators are executed concurrently, while in batch mode they are executed sequentially.
The runtime mode can be specified both from the command line or programmatically
$ bin/flink run -Dexecution.runtime-mode=BATCH examples/streaming/WordCount.jarStreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env.setRuntimeMode(RuntimeExecutionMode.BATCH);Important
IIn both Streaming and Batch modes, Flink runs tasks in parallel across different partitions. Each task (operator instance) works on its own partition. This parallelism is determined by the number of slots in the cluster and the parallelism set for the job.
In Batch Mode, multiple tasks instances for the same stage will process different partitions, while in streaming mode all operators at all stages, and therefore all task instances, are continuously running
State management
In Batch processing, state is ephemral and |local state* is used, since it is possible to replay all the dataset and reproduce the results. Batch jobs are deterministic, since data is bounded. No checkpointing is required