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

**URL:** <https://discourse.nodered.org/t/is-there-a-best-practice-on-data-change-tracking-using-node-red/19952>\
**Category:** General\
**Created:** [6 January 2020 07:23 UTC](https://discourse.nodered.org/t/is-there-a-best-practice-on-data-change-tracking-using-node-red/19952 "2020-01-06T07:23:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fangzhu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fangzhu/32/5796_2.png) [@fangzhu](https://discourse.nodered.org/u/fangzhu)\
**Post date:** [6 January 2020 07:23 UTC](https://discourse.nodered.org/t/is-there-a-best-practice-on-data-change-tracking-using-node-red/19952/1 "2020-01-06T07:23:43Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [6 January 2020 07:47 UTC](https://discourse.nodered.org/t/is-there-a-best-practice-on-data-change-tracking-using-node-red/19952/2 "2020-01-06T07:47:19Z")

</div>

I don't think so.

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 January 2020 09:03 UTC](https://discourse.nodered.org/t/is-there-a-best-practice-on-data-change-tracking-using-node-red/19952/3 "2020-01-06T09:03:49Z")

</div>

What sort of data are you talking about?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [6 January 2020 10:17 UTC](https://discourse.nodered.org/t/is-there-a-best-practice-on-data-change-tracking-using-node-red/19952/4 "2020-01-06T10:17:38Z")

</div>

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.
