locked
Saving only changed items is safe and doable and right approach? RRS feed

  • Question

  • User283528319 posted

    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"

    Friday, January 25, 2019 7:31 AM

Answers

  • User-943250815 posted

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 25, 2019 11:10 PM
  • User-1174608757 posted

    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

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 28, 2019 5:15 AM
  • User283528319 posted

    thanks all <g class="gr_ gr_61 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" id="61" data-gr-id="61">for</g> now, considering the time consuming hard code of the checking, I will just save them all.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 28, 2019 6:19 AM

All replies

  • User-943250815 posted

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 25, 2019 11:10 PM
  • User-1174608757 posted

    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

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 28, 2019 5:15 AM
  • User283528319 posted

    thanks all <g class="gr_ gr_61 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" id="61" data-gr-id="61">for</g> now, considering the time consuming hard code of the checking, I will just save them all.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 28, 2019 6:19 AM