Overview of Collaborative Synchronization

Sync Framework lets you synchronize data between peers, in which each peer can synchronize with any other peer without changes having to go through a central hub. Like offline synchronization, peer-to-peer synchronization can be used when applications do not have a consistent or reliable network connection, but the focus with this part of the API is collaborative applications. For example, in an application that allows users to share project notes, project team members often require a local copy of data that they can work with. When they have made changes, they can synchronize with another team member to exchange changes.

Modeled after the ADO.NET data access APIs, the Sync Framework database synchronization API provides an intuitive way to synchronize data. Sync Framework makes building applications for collaborative environments a logical extension of building applications for single users who can depend on a consistent network connection. For more information about the architecture of the API, see Architecture and Classes for Collaborative Synchronization.

Comparing Sync Framework to Other Technologies

Microsoft offers several technologies that are designed for applications that perform synchronization. The most significant technology to compare in terms of peer-to-peer synchronization is peer-to-peer transactional replication. This is used to synchronize two or more SQL Server Enterprise databases. While it is useful to compare the two technologies, be aware that peer-to-peer transactional replication is designed for server-to-server synchronization that provides scalability and high availability. Sync Framework is designed for client-to-server and client-to-client synchronization that supports collaborative applications.

Use the following table to help you determine which technology is appropriate for the applications that you want to build.

Key feature Peer-to-peer transactional replication Sync Framework

Synchronize by using services

No

Yes

Synchronize with other types of data stores1

No

Yes

Incremental change tracking2

Yes

Yes

Conflict detection and resolution3

Yes

Yes

Automatically initialize schema and data

Yes

No

Supports large data sets

Yes

Yes

Automatically propagate schema changes

Yes

No

1 Databases can exchange information with other data sources that are supported by Sync Framework, such as Web services, file systems, or custom data stores.

2 Sync Framework uses net change tracking, in which the last version of a row is synchronized. With peer-to-peer transactional replication, all changes to a row are applied in order at each peer.

3 Replication provides built-in conflict resolution; whereas, Sync Framework provides a framework for building a conflict-resolution scheme.

Sync Framework provides the flexibility of a programming model like offline datasets and a richer synchronization feature set like that found in replication. Replication is intended for database administrators and is designed to synchronize SQL Server databases. Replication provides significant functionality with configuration available through wizards, stored procedures, and its own API. Sync Framework is intended for developers, and supports synchronizing with other types of data stores and synchronization over services, such as Windows Communication Foundation (WCF).

For some applications, the decision to use a technology is easy: If you must have separate components to enable synchronization over different transports or services, or synchronize a data source other than a database, Sync Framework is the solution. If you are a database administrator who is designing a system for scalability and high availability, or who wants to configure synchronization without much programming, replication is a better choice. Ultimately, you must carefully consider the application requirements and determine whether the Sync Framework API is the appropriate technology to use. If you want to move beyond replicating a schema and its data from one database to another, we recommend that you use Sync Framework.

Using the Sync Framework Peer-to-Peer Documentation

The topics in the Sync Framework documentation provide an introduction to the Sync Framework database synchronization API, example code, and an API reference. You can find the API reference for peer-to-peer synchronization in Microsoft.Synchronization, Microsoft.Synchronization.Data, Microsoft.Synchronization.Data.SqlServer, and SqlCeSyncProvider.

For more information, we recommend that you read the documentation in the following order:

  1. Learn about the architecture of the API and the most important classes in Architecture and Classes for Collaborative Synchronization.

  2. Review the code for a basic application in How to: Configure and Execute Collaborative Synchronization (SQL Server).

  3. Get a sense of how to handle synchronization for databases other than SQL Server by browsing through the topics in Synchronizing Other ADO.NET Compatible Databases.

These topics contain sample code. Additional samples are available in the Sync Framework SDK and on Code Gallery.

See Also

Concepts

Collaboration Scenarios
Architecture and Classes for Collaborative Synchronization