the latest version of Node-RED let you configure the flow and global contexts to use file or memory storage so you can persist things over a power outage more easily.
(but maybe just get it working first
Nice post about it here - A guide to understanding 'Persistent Context'