Running Node Red on a Raspberry Pi 4 with a USB SSD for file storage.
The Raspberry Pi is powered via a small UPS to protect it from short power outages
I use Context Global storage on file to the USD, for approx 50 values numbers, and normally it works without any issue, even in a controlled reboot of the system.
In 2 cases this year there has been long power outage, beyond the capacity of the UPS, causing the Raspberry Pi to shut down and then restart when the power comes back.
In these two cases I have lost 5 to 10 values that very stored using Context Global storage on file.
The values no longer appears in the Context List in the side panel.
As I only have a partial loss I wonder if anyone has any tips on how to minimise (or eliminate) this data loss issue?
No, it is not a controlled shut down in case of a longer power outage.
I've thought on ideas to do a controlled shut down if a power outage last more than x minutes, but I would not be able to restart it then unless I'm on site. (installation is in a secondary home).
I've not set any flush interval so I assume it is the default 30 seconds
Most of the data the is written to "file" are only update on an hourly to daily interval.
Some Context data that were lost had been written long (hours) before the uncontrolled stop of the Raspberry Pi
Currently running Node Red version 3.0.2 and nodes version v16.18.0.
The USB SSD is a "SanDisk 64GB Ultra Fit Unidad Flash, USB 3.2" plugged into the Raspberry Pi.
The USB SSD stores the Node Red Context data and text files with logs written via Node Red.
Log some log files can periodically be updated every 10s but normally is it only a few update per hour, with text appended to the existing log files.