❓ DISCUSSION: Should nodes save/restore their own context?

node-red-contrib-ui-state-trail has now been updated to restore it's chart data after a full deploy, node-RED restart or system reboot. I've just been trying it and it works great, thanks @hotNipi.
The changes implemented have also moved development potential further forward, as the node now has access to the node-RED's setting.js file, and therefore it's contextStorage settings, so rules have be introduced to ensure that Data Storage is only implemented whenever a persistent data store is available.

Knowing which storage modules are available, opens up the future potential to maybe being able to select different storage option from within the node config (as @TotallyInformation commented above), and also ensure that orphaned data is cleaned up if a different storage option is selected.
Also as commented above, edge cases also need to be managed, but hopefully the clever guys here will eventually build this into a viable model for node data persistence.

2 Likes