Over the past few months I have lost valuable statistical data that I am not able to access any more. As time goes on the statistics are more and more important but HA does very little to help when things go wrong
More robustness in the database design to prevent failures from corrupting the database, and when a corruption does occur more effort by HA to recover and restore.
There needs to be a repair alert when the database has an issue. At present a corrupt database is simply renamed and a new one added… this error does show up in the log but unless you look there every day its easily missed. If you restart its lost all together. from the a active log.
Users should have an easy to use method of recovering data from a backup version of the database and merging data from the recovered database into the new one,
Worst case, If I knew the database had been corrupted when the system started, I could recover from backup and restore… I may loose a day of data but that’s better than loosing months of statistics.
Better case would be to be able to restore up to the last write from a database log.
ideal would be, in the event of failure, for HA to offer recover from backup and data recovery during startup rather than just renaming and continuing.
I think it’s the 3 small dots but maybe a mod will merge it instead.
@ snigehere
The default database for home assistant is SQLite.
Im sure our issues are touched on here:
SQLite, which is lightweight and easy to set up but has limitations:
Corruption Risk:
Automatic Renaming:
Write-Ahead Logging (WAL):
There are other alternatives MariaDB/MySQL or PostgreSQL.
What hardware do you use? For me, I’ve been thinking of getting a Raspberry Pi NVME setup with MariaDB.
Id be interested to hear how a pro with a time-tested setup to give some info on how they achieved it.
Honestly, I was shocked to learn SQLite was still around.