To accomplish this, I have restricted myself to SQLite as storage and use Litestream for replication. On start, Litestream reconstructs the last known state before the application starts. [Source](https://github.com/LukasKnuth/homeserver/blob/912cbc0111e44d...)
It works very well for my workloads (user interaction driven web apps) but there are theoretical situations in which data loss can occurr.