To ensure this we need to maintain state of the component in a store that is reliable and persists accross crash. While there are multiple ways to persist the state, a naive could be to take a snapshot of the entire data every time we do an update. This can be a expensive operation if updates are frequent and state is too big. But this will be useful when updates are periodic and less frequent and update path doesn't block the read path (mostly by maintaining a version of the data all the time to be served). Other way of persisting the entire state is to maintain a log of all the updates happened from the begining thus on update we just have to log the update command. This greatly reduces the amount of time taken to persist the update but recovery can take a lot of time. This process of Write-Ahead-Logging helps when updates are frequent enough that you can't maintain a different version of whole data each time.
Some drawbacks of logging is that logs can grow indefinitely unlike snapshots hence we might need to do periodic snapshoting to maintain a low watermark beyond which data is stored in a snapshot and rest of updates needs to replayed from the log. This will also ease the load recovery time as most of the data is recovered from the alsnapshot and only recent logs are replayed.
Write-Ahead-Logging can be used for wide variety of applications, from a simple key value store to a huge database.