background preloader

Sync Framework

Facebook Twitter

Implementing a Standard Custom Provider. In Microsoft Sync Framework, a synchronization provider is a software component that enables a replica to synchronize its data with other replicas.

Implementing a Standard Custom Provider

By using a synchronization session, a synchronization application connects a destination provider with a source provider to synchronize items that have changed on the source replica to the destination replica. A simple example of a synchronization provider is one that manages a folder in a file system. This provider can be connected with another provider that also manages a folder to synchronize the files in its folder with the files in the other provider's folder. During synchronization, the destination provider provides its current knowledge, accepts a list of changes from the source, detects any conflicts between that list and its own items, perhaps filters the list of items, and applies changes to its data store. A synchronization provider can be implemented by using managed or unmanaged code. BeginSession is called on both providers.

Implementing a Synchronization Application. A synchronization application is a software component that creates a synchronization session, connects it with two synchronization providers, uses it to start synchronization, and hosts Sync Framework during synchronization.

Implementing a Synchronization Application

The synchronization application can also register to handle events that are reported back by Sync Framework. A synchronization application can be implemented by using managed or unmanaged code. Implementing a Synchronization Application by Using Managed Code An application creates and starts a synchronization session by doing the following: Creates a SyncOrchestrator object.Sets the LocalProvider and RemoteProvider properties of the orchestrator.Sets the Direction property of the orchestrator to the appropriate synchronization direction. Implementing a Synchronization Application by Using Unmanaged Code An application creates and starts a synchronization session object by doing the following: Creates an IApplicationSyncServices object.

Synchronizing File Synchronization Provider with Other Providers. This topic describes how to create a managed application that enables a file synchronization provider to synchronize with another Sync Framework provider.

Synchronizing File Synchronization Provider with Other Providers

In this case the other provider is a simple provider, but you could also use a standard custom provider. For more information about simple providers, see Implementing a Simple Custom Provider. There are two main requirements for the application: The application must implement IFileDataRetriever as the data transfer interface between the two providers.The simple provider must use the same format for IDs that file synchronization provider uses: a 16-byte GUID for replica IDs; A 16 byte GUID that is preceded by an 8-byte prefix for item IDs; and a 4-byte integer for change unit IDs. The examples in this section show some of the code that is relevant to synchronizing a file synchronization provider and a simple provider, with a focus on the ID and transfer interface requirements. The following code example synchronizes the two providers. Synchronization.Data Namespace () Synchronizing a Remote Replica By Using a Proxy Provider. Technical Article Writer: Laren Crawford Published: November 2009 Applies to: Microsoft Sync Framework 2.0 Summary: This article describes how to synchronize efficiently with a remote replica by using a proxy provider on the local computer.

Synchronizing a Remote Replica By Using a Proxy Provider

The proxy provider uses the Remote Change Application pattern and Windows Communication Foundation (WCF) to send serialized metadata and data to the remote replica so synchronization processing can be performed on the remote computer with fewer round trips between the client and server computers. Microsoft Sync Framework synchronizes data between data stores. The remote computer does not run Sync Framework. To demonstrate how to implement a proxy provider that uses the Remote Change Application pattern, this article uses WCF to send data and commands over the Internet to a remote provider running on a Web server.

Security Note: Sync Framework does not provide authentication or encryption between the proxy provider and the remote provider. Send feedback.