Yesterday, a co-worker of mine passed on a link for the Microsoft Sync Runtime, suggesting that we may be able to leverage it in the future in order to meet some requirements we have on our project.
Microsoft Sync Framework is a comprehensive synchronization platform that enables collaboration and offline access for applications, services and devices. It features technologies and tools that enable roaming, sharing, and taking data offline. Using Microsoft Sync Framework, developers can build sync ecosystems that integrate any application, with any data from any store using any protocol over any network.
Reading thru the initial article, I was quite impressed, but it left out a key piece of information, how does the sync runtime work over the Internet. Not just the internet, but also any decent corporate network were clients do not have direct database access.
I made my way to an overview of the Sync Services for ADO.Net, which is what I would be most interested in (although syncing file systems has an interesting appeal as well), and they clearly showed the Internet cloud, but not really how the sync framework worked with it. I actually had to dig into the documentation, and finally found some details on how to get this to work on the Internet. If you read towards the bottom of the documentation, you can see that you implement a proxy on a middle tier.
On the middle tier, the service inherits from and exposes the same methods as ServerSyncProvider (the abstract class from which DbServerSyncProvider inherits). The methods are then executed by the application code over a direct connection to the server database. The results are routed through the middle tier and back to the client.
Basically the middle tier exposes the same interface that the client application would normally use if it could connect directly to the database. There was a link which gives a specific example of setting up a n-Tier environment and provides a good start. However, I could not find exactly what I was looking for, which was an example of using WCF as the transport mechanism. With WCF I could have 1 middle tier service with multiple end points configured, such as a Basic Http for Internet, and TCP for intranet. WCF also adds support for encryption and authentication, which I didn't see called out specifically in the sync runtime.
Other items of interest include, how to setup a database for different sync scenarios, and peer to peer synchronization.
All in all, the Sync runtime looks like a very promising framework for building disconnected applications. It will require some re-architecting for existing solutions, specifically the data store, but it might be worth it in the long run. I will be sure to post updates if I get a chance to play around with it at all. It is defiantly something that would save me some time on a side project I am hoping to start working on soon.
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.