I’m working on a new web application to file county tax returns. So far, I’m developing the logic so that the data is collected in several forms, where it stays persisted in memory until the user gets to the final step where they click save.
At that point, the data is saved to the database, all at once. My reasoning for this method is to allow the data to be loaded in a single transaction. Plus, I only need to use insert statements, not Insert if/else update Which, if that transaction fails, I don’t have orphaned and partial data to clean up.
But, now I’m starting to think I should save as soon as possible. Then add data to the DB as needed.
I’d go for your new approach also – save as often as possible – reasons for this:
I don’t see any reasonable reason for NOT saving as often as possible