From my perspective in this case there is no right or wrong approach.
You can spend some milliseconds checking what has been changed or not, by the end of the day, the most important is if your data are valid or not.
According to your description,for efficiency,if there are large amounts of data,I suggest you checking only changed items and save them , so it will save time and reduce the pressure of database. What is more, if the data is not much, the difference between
the two ways is little. I hope it could help you.
Member
92 Points
534 Posts
Saving only changed items is safe and doable and right approach?
Jan 25, 2019 07:31 AM|fatihbarut|LINK
Hi all,
When you save a form (with 15 boxes) with ajax is it right approach to check only changed items and save them or "just save them all"
Participant
1061 Points
666 Posts
Re: Saving only changed items is safe and doable and right approach?
Jan 25, 2019 11:10 PM|jzero|LINK
From my perspective in this case there is no right or wrong approach.
You can spend some milliseconds checking what has been changed or not, by the end of the day, the most important is if your data are valid or not.
Participant
1300 Points
522 Posts
Re: Saving only changed items is safe and doable and right approach?
Jan 28, 2019 05:15 AM|Wei Zhang|LINK
Hi fatihbarut,
According to your description,for efficiency,if there are large amounts of data,I suggest you checking only changed items and save them , so it will save time and reduce the pressure of database. What is more, if the data is not much, the difference between the two ways is little. I hope it could help you.
Best Regards
Wei Zhang
Member
92 Points
534 Posts
Re: Saving only changed items is safe and doable and right approach?
Jan 28, 2019 06:19 AM|fatihbarut|LINK
thanks all for now, considering the time consuming hard code of the checking, I will just save them all.