Re: Backup is hard. Doesn't mean it should be ignored.
"t turned out that referential integrity is important. Who knew? Backing up files while they were in use, then trying to use the restored backup caused all sorts of problems. This was before the days of journalling file systems and snapshots."
Don't roll your own encryption and don't roll your own database.
This was a solved problem years ago without depending on journalling file systems and snapshots. Use a proper database engine that does this for you.