1 Replies - 594 Views - Last Post: 19 August 2013 - 02:02 AM Rate Topic: -----

#1 toad87  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 188
  • Joined: 21-May 12

When to update database?

Posted 10 July 2013 - 06:22 PM

If I download and store data in my program and changes are made, should I make changes to the downloaded data first, then save changes to database or should I make changes directly to the database and re-download the new data to be displayed again?
Is This A Good Question/Topic? 0
  • +

Replies To: When to update database?

#2 rannaot  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 19-August 13

Re: When to update database?

Posted 19 August 2013 - 02:02 AM

No clear answer depend on your app:

Flow is -> You DL data, data is updated to memory. Now you keep DL data and you ?
Compare it to memory or compare it to DB ? And later when a change occur you wonder how to make it work.

In general answer is different based on what you want to achieve - Assume you have a loaded database with zillion users and you care less about inconsistency you might want to take load of the DB and make as little route to it as possible. Assume the opposite where your DB is not problematic and you care more about consistency of the data (program crash, all memory gone, you want your DB to be current) you need to update DB more often.

Last, to make a good design (maybe less efficient in run time but more easy to improve and maintain) I think your GUI should be updated from one source point and I assume it is your DB. By suggesting that your data downloaded will update the GUI directly you create messier design.

Hope I helped,
Ran.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1