Microsoft Sync Framework with Mutliple Client and Server Database
- by David Osborn
I'm working on changes to an application to have a local data store instead of connecting directly to the database server. The client app will then sync changes both ways between the server database and its local data store. I'm trying to implement the syncing solution using Microsoft Sync Framework. To be clear there is no server application, only the database server, but there are multiple clients.
I have started implementing two classes that implement FullEnumerationSimpleSyncProvider, one called LocalSyncProvider and one called ServerSyncProvider. The LocalSyncProvider knows how to enumerate, insert, update, delete items from the local data store, and the ServerSyncProvider knows how to enumerate, insert, update, delete items from the database server. They each use the provided SqlMetadataStore and store the two metadata stores (one for the local and one for the server) on the local drive of the client. This means that each client will have its own metadata store for its local data store and its own metadata store for the server database.
Is this actually going to work, does there need to exists only one server metadata store, or do I need to be using the Sync Framework differently?