Share via


Overview of Client and Server Synchronization

Sync Services for ADO.NET 2.0 lets you synchronize data from different sources over two-tier, N-tier, and service-based architectures. The Sync Services API for client and server synchronization 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 Sync Services API provides an intuitive way to synchronize data. Sync 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 for Client and Server Synchronization.

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

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

Sync Services provides the flexibility of a programming model like offline datasets and a richer synchronization feature set like that found in merge replication. Sync 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. Sync 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. Sync 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 Sync 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, Sync 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 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.

Note

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

Using the Sync Services Documentation

The topics in the Sync Services documentation provide a detailed introduction to the Sync Services API, example code, and an API reference. You can find the API reference for client and server synchronization in Microsoft.Synchronization, Microsoft.Synchronization.Data, Microsoft.Synchronization.Data.SqlServerCe, and Microsoft.Synchronization.Data.Server. 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 Client and Server Synchronization.

  2. Review the code for a basic application in Getting Started: Client and Server Synchronization.

  3. Learn about tools that you can use to help develop an application in Tools to Help You Develop Applications (Sync Services).

  4. Get a sense of how to handle common tasks by browsing through the topics in Programming Common Client and Server Synchronization Tasks. These topics 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 (Sync Services). 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

Offline Scenarios (Sync Services)
Architecture and Classes for Client and Server Synchronization