Problem
the shutdown can take very long and this can lead to corrupted databases (e.g. when docker kills it hard after waiting too little time)
Ideas to solve it
- 2 ways of shutdown (User initiated: write latest state / System initiated: throw away latest state)
- Make it configurable if the latest state is written (slow shutdown) or thrown away (faster shutdown)
- make the shutdown quicker (write it in a different way / flushing out raw)
- more ideas welcome