0

I have a Web App developed in Asp.net with SQL server 2008 R2 providing database. We are now developing an Iphone App which will work in offline mode with data syncing between the two databases periodically.

In order to keep two datasets in sync we are going to add an 'updatedate' column which will record updated date and time either through stored procedure or through a trigger which launches when a row in related table is updated. Any thoughts on a better alternative?

However, we are not sure as to how to manage sync in case of deleted records as currently app is configured to delete rows from database, therefore these are gone when a delete event happens and there is really no way to identify which records have been deleted except to do a whole table search on sync for each user which I am not keen on due to server overhang.

As Webapp is already in production phase I am not keen on keeping deleted record in a table with a delete flag, also this will cause storage issue in some time.

The only thing I can think of is to have shadow tables which maintain deleted transactions for users which also have Iphone app activated. The records can than be deleted when sync has happened. Not sure if there are any apparent drawbacks I should think of or better alternatives.

John Donogan
  • 1
  • 1
  • 2
  • The obvious question: Why do you have the need to have two databases? – Florian Nov 25 '13 at 20:06
  • Hello there, Because we want users to be able to use the App when not connected to internet and sync when internet is available again. Data thus needs to be stored locally meanwhile in SQL lite database in user's phone. – John Donogan Nov 27 '13 at 09:38
  • http://stackoverflow.com/questions/1744522/best-way-to-synchronize-local-html5-db-websql-storage-sqlite-with-a-server-2 this will maybe help you? – Florian Nov 27 '13 at 10:18

0 Answers0