Overview of Peer-to-Peer Synchronization

Sync Services for ADO.NET 2.0 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 Services API provides an intuitive way to synchronize data. Sync Services 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 Peer-to-Peer Synchronization.

Comparing Sync Services 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 Services 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 Services

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 Because Sync Services is part of Sync Framework, any database that uses Sync Services can then also exchange information with other data sources that are supported by Sync Framework, such as Web services, file systems, or custom data stores.

2 Sync Services 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 Services provides a framework for building a conflict-resolution scheme.

Sync Services 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 Services 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 Services 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 Services 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 Services.

Using the Sync Services Peer-to-Peer Documentation

The topics in the Sync Services documentation provide an introduction to the Sync Services API, example code, and an API reference. You can find the API reference for peer-to-peer synchronization in Microsoft.Synchronization and Microsoft.Synchronization.Data. For more information about the public types and members in Microsoft.Synchronization.dll, see the Sync Framework core documentation. To download this documentation, go to this Microsoft Web site.

If you want more background 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 Peer-to-Peer Synchronization.

  2. Get a sense of how to handle common tasks by browsing through the topics in Programming Common Peer-to-Peer Synchronization Tasks. These topics contain lots of sample code. Start with the topic How to: Configure Change Tracking and Synchronize Peers.

  3. Learn about samples that are installed with the Sync Framework SDK in Sample Applications for Peer-to-Peer Synchronization.

See Also

Concepts

Collaboration Scenarios (Sync Services)
Architecture and Classes for Peer-to-Peer Synchronization