I know that anytime you talk about syncing, it’s a loaded question, but perhaps this won’t be such a powder keg.
I have two tables that may have new records added to each and I want to sync them with the new records and changes. At this point, I’m not worried about the business rules because that will be the next step. I’m only worried about getting a timestamp in each table so I can determine which one got added or modified.
One of the two tables will always be local (client based) and the other will be remote or server based. Each client can access their own local table as well as the server table. Users can add, modify, and delete records in their local table as well as the server table. If a user deletes a record in the server table, it will not affect anyone’s local tables although it will no longer sync back and forth. That will not create a problem for this application.
I currently put two fields in every record of every table that I create:
Created = local timestamp when record is create
Modified = local timestamp whenever record is modified
I’m thinking that I can add two additional fields:
CreatedGMT = GMT when the record is created
ModifiedGMT = GMT when the record is modified
I then keep track of the last sync performed by the user and determine what to update by using the two GMT fields.
Assuming I don’t need to worry about any business rules at this point and only worry about timestamps, would this work?
What about the effect daylight savings would have on the modification of records? Anyway to keep DST from affecting this or am I overthinking it.
Apologies to anyone offended by another syncing thread.