We work on a WPF client-server project. Each instance of client/server has the possibility to choose its datasource from the following database types: MS SQL, MS SQL Express and SQLite. The client communicates with the server using WCF.
We made some research about the possibility to integrate Microsoft.Syncronization framework into our project, but could not come to a conclusion.
Let’s say we have the following scenario (client requests to download some entities from server):
We have the same structure on the server and client database.
Table 1 - has many
The client requests to download elements from the server. The WCF brings a list with all items in Table 1. Client chooses one element to download. Client remembers the selected element unique key in order to make the download operation.
Next, we thought of the following options:
1.We create a sync scope which includes all 4 tables. Using the database sync provider (both on server and client), we apply filtering on all 4 tables, on the server side in order to synchronize only the selected item.
Weaknesses of this approach:
-I saw that dynamic filtering is an issue, so it makes things more complicated because we need workarounds
-The filtering will be made twice: once in the WCF (the WCF should filter the parent and children and somehow send some unique keys to the client) and then in the Microsoft sync process, which is time consuming
2. Using a database sync provider on the client side and a custom implemented provider on the server side. The custom provider should only take the existing filtered data from the WCF and convert it to something relevant for sync framework.
And now the questions:
Which would be the simplest approach in a scenario like this? 1, 2 or other option?
Is the option 2 even possible?
Can we handle all database types in a single provider?