We have a windows application that have a local database. Few of our clients asking for centralized report from all their location. Our proposed solution is to have a central database in the Client's Head Office over Static IP and sync all the data using WCF Service.
Since the Central server may not be available always, i need a simple solution, to know from each Offline Databases all the records that are not synchronized with Central DB. So that a timed service in the back end copies all the remaining data to the central DB.
one option is have a boolean column in all the tables as IsSynched to denote whether it is in sync. But this require a lot of code change in all the referenced procedures and code.
Any alternative solution?
I would suggest boolean IsSynced is very very weak, in terms of synchronization. If the office is offline for longer, you will certainly struggle getting everything in pace.
If you add column VersionNumber, you will know, that every row, with VersionNumber below the actual VersionNumber needs update.
More sophisticated approach could be adding LastUpdated TimeStamp column to each table, which could possibly save some traffic, because VersionNumber could increase and it could contain a row update, but may not! Whereas LastUpdated as from what I see is row-specific and creates the opportunity to fetch (=update) only that data (=rows), that are newer, than the newest record in your (=the central) entire database. Which could in fact work like a dandy.