Overview (Synchronization Services)

Microsoft Synchronization Services for ADO.NET lets you synchronize data from different sources over two-tier, N-tier, and service-based architectures. The Synchronization Services API provides a set of components to synchronize data between data services and a local store, instead of only replicating a database and its schema. Applications are increasingly being used on mobile clients, such as portable computers and devices. Because these mobile clients do not have a consistent or reliable network connection to a central server, it is important for these applications to work against a local copy of data on the client. Equally important is the need to synchronize the local copy of the data with a central server when a network connection is available. Modeled after the ADO.NET data access APIs, the Synchronization Services API provides an intuitive way to synchronize data. Synchronization Services makes building applications for occasionally connected environments a logical extension of building applications in which you can depend on a consistent network connection. For more information about the architecture of the API, see Architecture and Classes (Synchronization Services).

Comparing Synchronization Services to Other Technologies

Microsoft offers several technologies that are designed for applications that run in occasionally connected environments. The most significant technologies are as follows:

  • Remote Data Access (RDA). This is used to synchronize a SQL Server Compact 3.5 database with a database on another edition of SQL Server.
  • Merge replication. This is used to synchronize different editions of SQL Server, and includes SQL Server Compact 3.5.

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

Key feature RDA Merge replication Synchronization Services

Synchronize by using services

No

No

Yes

Supports heterogeneous databases

No

No

Yes

Incremental change tracking

No1

Yes

Yes

Conflict detection and resolution

No

Yes2

Yes

Easily create data views on the client3

No

No

Yes

Automatically initialize schema and data

Yes

Yes

Yes

Supports large data sets

Yes

Yes

Yes

Query processor is locally available

Yes

Yes

Yes

Automatically propagate schema changes

No

Yes

No

Automatically repartition data

No

Yes

No

Use on devices

Yes

Yes

Yes

1 RDA supports incremental uploads, but downloads are always a snapshot that updates all the data on the client.

2 Merge replication provides built-in conflict resolution; whereas, Synchronization Services provides a framework for building a conflict-resolution scheme. For more information, see How to: Handle Data Conflicts and Errors.

3 For more information see How to: Create Views of Data on a Client.

Synchronization Services provides the flexibility of a programming model like offline datasets and a richer synchronization feature set like that found in merge replication. Synchronization Services functionality is superior to RDA.

Merge replication is intended for database administrators and is designed to synchronize SQL Server databases. Merge replication provides significant functionality with configuration available through wizards, stored procedures, and its own API. Synchronization Services is intended for developers, and enables a developer to easily create views of data on the client that are based on a server database or another data source. Synchronization Services supports heterogeneous databases and synchronization over services, such as Windows Communication Foundation (WCF). If the application involves synchronizing with non-SQL Server databases, or if the application must have separate components to enable synchronization over different transports or services, use Synchronization Services.

For some applications, the decision to use a technology is easy: If you must synchronize a data source other than a SQL Server database, Synchronization Services is the solution. If you are a database administrator who wants to configure synchronization without much programming, merge replication might be a better choice. Ultimately, you must carefully consider the application requirements and determine whether the Synchronization 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 Synchronization Services.

Note

Synchronization Services cannot be used on the same table in the client database. RDA or merge replication cannot be used with Synchronization Services on the same table in the client database.

Using the Synchronization Services Documentation

The topics in the Synchronization Services documentation provide a detailed introduction to the Synchronization Services API, example code, and an API reference. You can find the API reference in Microsoft.Synchronization, Microsoft.Synchronization.Data, Microsoft.Synchronization.Data.SqlServerCe, and Microsoft.Synchronization.Data.Server. 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 (Synchronization Services).
  2. Review the code for a basic application in Getting Started: A Synchronization Services Application.
  3. Learn about tools that you can use to help develop an application in Tools to Help You Develop Applications (Synchronization Services).
  4. Get a sense of how to handle common tasks by browsing through the topics in Programming Common Synchronization Tasks, which contain lots of sample code.
  5. After you read these sections, you will be able to appreciate the design guidance that is provided in Considerations for Application Design and Deployment (Synchronization Services) and the samples that are available from this Microsoft Web site. As you become comfortable with the API, we encourage you to start coding: You will see how straightforward the process is to add synchronization to an application.

See Also

Concepts

Synchronization Services for ADO.NET 1.0 SP1
Architecture and Classes (Synchronization Services)