locked
Structuring App with multiple clients and server data store (no server app) RRS feed

  • Question

  • I'm working on an application that currently connects to a sybase database server, but I need to start storing the the data locally and syncing to the main database with multiple clients.  The key here is that there is no server application and I can't augment the database on the server, though each table that needs to sync has a unique guid column, and a datetime field that is updated when the record is updated. The client application needs to handle grabbing the data from the database server, updating its local store, and then applying changes in its local store to the server database. What I have started out doing is creating two classes that implement FullEnumerationSimpleSyncProvider, one called LocalSyncProvider that knows how to enumerate items, update items, delete items on the local data store and one called ServerSyncProvider that knows how to enumerate items, update items, and delete items on for the server database. What I am getting confused with is how to implement the metadata store.  Currently I am trying to use the provided SqlMetaDataStore, but I am wondering if I will have issues because there will be both a local metadata store and a server metadata store on each client since the client is running both providers. Is this a problem or is this suppose to be how it works?  Otherwise can I somehow just utilize the unique id and datetime stamp on each of my records and not use the metadata store?
    Wednesday, March 3, 2010 3:30 PM

Answers

  • You could have a server proxy that talks to all the clients and stores metadata locally, and talks to the server database to enumerate and apply changes. This way you don't have to run anything on the server, but will still get concurrency.

    Tuesday, March 16, 2010 1:48 AM

All replies

  • Hello dosborn,

    If you have two SimpleSync providers running within same client, it makes sense that you would have two metadata stores for each client, since you will sync from

    main database to local client data store within client application (i.e. same machine)

    Thanks,

    Patrick
    • Proposed as answer by Patrick S. Lee Wednesday, March 3, 2010 7:58 PM
    Wednesday, March 3, 2010 7:57 PM
  • Thanks for the reply Patrick. What is actually stored in the metadata store?  I think my problem is arising from lack of understanding of how the metadata information is used to resolve conflicts. My concern is that if there are two clients and they each have a Metadata and ReplicaId store file for the server that it will adversely affect the sync framework deciding what should happen.
    Wednesday, March 3, 2010 9:42 PM
  • If you cannot run an application or process on the server, can you store the server metadata file still on the server? That way, each time a client syncs to the server, it locks the server metadata store, then copies it to it's own machine, syncs, and replaces the updated copy back on the server and releases the lock for other clients. You can also use the metadatastore import/export API to serialize on the server and then deserialize on the client.
    Monday, March 15, 2010 7:17 PM
  • I don't really like this idea of locking the store. Currently the initial sync is taking 30 minutes and I don't want other clients stuck waiting.
    Monday, March 15, 2010 10:15 PM
  • You could have a server proxy that talks to all the clients and stores metadata locally, and talks to the server database to enumerate and apply changes. This way you don't have to run anything on the server, but will still get concurrency.

    Tuesday, March 16, 2010 1:48 AM