Checkpointing
Checkpointing is the mechanism to save the state of the application to make it recoverable in the event of failure. Apex saves snapshots of the state periodically, and can use them for recovery. Checkpointing state is not a new concept; many systems have the concept of state saving that can be used for recovery.
However, since Apex executes as a distributed system with operators in different worker containers, the mechanics of state saving involves subtleties that go well beyond conventional checkpointing so that it results in a consistent snapshot that allows the application to continue after some or all of those containers have failed. This bookkeeping complexity is not something that the application developer should have to deal with; it should be handled by the platform behind the scenes. So, what is the magic of checkpointing in Apex?
There are several pieces to this, and before we come to the actual details of how data is saved to a durable storage, we will look at the...