Is there a best practice on data change tracking using node-red?

We can update data in memory or database using Node-RED flows.
I want to implement a mechanism to publish such data update event so that they can be re-used as history or report. Is there a best practice for this?

I don't think so.

There are too many different operational situations for there to be a best practice

What sort of data are you talking about?

Typically I think that this would be done at the database level using the database logs.

There is currently no mechanism in Node-RED to track memory variable changes. You would normally also output to a publish/subscribe service such as MQTT or a suitable database depending on need. REDIS also supports pub/sub but I don't know if the Node-RED nodes for REDIS support it.

You can kind of simulate variable event tracking in Node-RED using link nodes as well. Whenever you get a msg that updates your variable, also send it to a link-out node and then you can use any number of link-in nodes to be informed of the change.

2 Likes