I see a lot of people using the backups option for their HA database. This works I guess but it’s really not great at it. The problem is this:
- if you want to backup your data you probably need to take a backup at least daily. Then you won’t lose more then 1 day of data on a restore.
- it’s pretty inefficient and wasteful with disk space. If you take a backup daily then each backup contains all the db data from the previous backup plus a day. Which effectively means most of the previous backup is now useless. You might want to rollback the config to a point in the past but you’d always want to minimize data loss so you’d always want to restore history from the newest backup
In addition if you use the default sqlite3 option for the database it makes using your backups more complicated. A user might expect to be able to take a backup before making a large config change and then rollback from the backup if that didn’t go well. Except if they do that then that reverts their database to that same point in the past and now they lost a bunch of data.
It seems like it would be much better if recorder had a replica option. So everytime it wrote something to the db it wrote the same thing to one or more replicas. And then users could exclude the db from their backups entirely and just use those for config backup and recovery. Since if their system died they could simply point HA to one of the replicas.