Share via


Overview of Client and Server Synchronization

Sync Framework lets you synchronize data from different sources over two-tier, N-tier, and service-based architectures. The Sync Framework 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 Framework database synchronization API provides an intuitive way to synchronize data. Sync Framework 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 Framework 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 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.

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 Framework

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

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 Framework 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 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.

Note

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

Using the Sync Framework Documentation

The topics in the Sync Framework documentation provide a detailed introduction to the Sync Framework database synchronization 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, 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.

  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 sample code. Additional samples are available in the Sync Framework SDK and on Code Gallery.

  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. 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
Architecture and Classes for Client and Server Synchronization