Should you always write to the database

Certified Lead Developer

Hello,

I think common practice is to always call a write to database node if a value could have changed. I was asked by our DB team if this was really needed. They proposed only calling the write to DB when a value has changed. I am wondering if anybody has implemented this before? I have several ideas how to do this, but do not know if it really adds value. Caching a value, or an additional query is properly going to take more resources than just overwriting data with the same values.

 

-Josh

  Discussion posts and replies are publicly visible

Parents
  • Hey Josh,

    This can be put up like how long / the importance you need the information.
    Suppose if you don't need the data for a longer duration like displaying the previous data in quick tasks etc.
    In the above case if the data is not of that importance and can be pulled from active instances, then we don't need any DB intervention.

    Suppose if its critical and you are also using that data anywhere else, it requires DB intervention.

    Hence you can categorize as if you can pull up that data directly from the pv's and maintain and display accordingly OR storing to DB.
Reply
  • Hey Josh,

    This can be put up like how long / the importance you need the information.
    Suppose if you don't need the data for a longer duration like displaying the previous data in quick tasks etc.
    In the above case if the data is not of that importance and can be pulled from active instances, then we don't need any DB intervention.

    Suppose if its critical and you are also using that data anywhere else, it requires DB intervention.

    Hence you can categorize as if you can pull up that data directly from the pv's and maintain and display accordingly OR storing to DB.
Children
No Data