Microsoft Sync Framework

Source: Wikipedia, the free encyclopedia.

Microsoft Sync Framework is a

Visual Studio 2008 in late November 2007.[1]

Architecture

The Sync Framework architecture

The Sync Framework runtime provides synchronization functionality, without being tied to any data store or data transport protocols. By providing data source specific synchronization providers, any data source can be supported. For example, using proper synchronization providers, files can be synchronized across computers, project updates synchronized across project participants, or media synchronized across devices. Sync Framework ships with three providers: Microsoft Sync Services for ADO.NET, Sync Services for File Systems, and Sync Services for SSE. Sync Services can be used to synchronize devices by supplying providers for the device. Similarly, PIM software such as

Microsoft Office Outlook and media libraries such as Windows Media Player
can also be supported by providing suitable providers.

The providers are used to enumerate the items in a data store, each identified by an Item ID. In addition, they also have to maintain synchronization metadata and the state of the data store, so that changes can be enumerated quickly. The metadata is maintained for every instance of the data store (replica) that the provider is attached to. The metadata maintained includes the replica ID, tick count (representing progression in time), conflict log, tombstone log, and the set of the changes the data store has seen (knowledge). A replica ID and tick count pair makes up a version and encodes the state of the data store until that time. Sync Framework defines a set of operation for the Knowledge object for a replica: Contains which determines if the store contains a specified change, Union to merge two knowledge sets, Project to project out the knowledge for a subset of the items, and Exclude to create a new knowledge set without the changes for a subset of the items. The metadata is managed by the metadata storage service which uses an in-process SQL Server Compact database to store the metadata on a per-provider basis.

The Sync Services API operates by creating a synchronization session, represented by a Session object. A synchronization session synchronizes data across two synchronization providers - one for the source data store and the other for the destination. Instances of both the providers are passed to the Session object. During a synchronization session, the destination provider sends the knowledge set of the store. The source provider compares the knowledge of the destination with the change set in the source to enumerate the changes and then transfer it to the destination. The destination provider makes sure the changes are not conflicting and merges the changes and updates the knowledge.

  1. Snapshot sync (download-only sync): The data in the data source (or a subset of it) is synchronized with clients.
  2. Upload-only sync: Data in the client is merged to the source replica.
  3. Bidirectional sync: Both the data sources can be modified independently and changes are synchronized with each other. An n-level sync is achieved by performing multiple bidirectional synchronizations.

Sync Services for ADO.NET

Sync Services for ADO.NET Architecture

Microsoft Sync Services for ADO.NET is the synchronization provider for synchronizing across databases using ADO.NET. ADO.NET Datasets are synchronized between the source and the destination, which are then persisted to a database server. It can also support data sources other than a relational database, like an XML database or web service as long as a proxy is provided to abstract the data source and a data provider is available for the proxy.

The Sync Services for ADO.NET provider is intended for use in offline applications, where data from the central database is cached locally. The application works against the cached data, and the changes are uploaded in a batch. In addition, the provider can also be used for collaborative applications, where each application will work against its local dataset, which will be synchronized periodically in a peer-to-peer manner with the other participants. Locally, the datasets can be stored either by using the SQL Server Compact database or any other database server supporting ADO.NET. Sync Services for ADO.NET allows incremental change tracking, which allows only the changes to be replicated rather than replicating the entire copy.

Sync Services for File Systems

The Sync Services for File Systems provider is used to synchronize two file system locations, which can either be local folders or network shares. In addition to mirroring new files, changes to existing files are also synchronized. Changes to files are detected by using timestamps, or optionally, by

Alternate Data Streams
.

Sync Services for FeedSync

The Sync Services for

ATOM formats, which can then be subscribed to by interested parties. The provider can also be used to extract items from a FeedSync feed and merge the changes back to the data store. Sync Services for FeedSync
uses another provider to connect to the data store.

Sync Services for FeedSync provides services that can be used to help synchronize the data of a replica with RSS and Atom feeds. (A replica is a particular repository of information to be synchronized.) By using the FeedSync producer service, a synchronization application can work with a synchronization provider to create a list of items from a replica and put them in an RSS or Atom XML stream. These items can then be published to interested subscribers. Similarly, the FeedSync consumer service helps a synchronization application take an input RSS or Atom XML stream, extract items from it, and then use a synchronization provider to apply only the appropriate changes to a replica. Because Sync Framework underlies the exchange of feed items, two feeds can be cross-subscribed and easily synchronized with one another as peers in a synchronization community. (A synchronization community is a set of replicas that keep their data synchronized with each other.)

Licensing

Microsoft Sync Framework is free on Windows and Windows Mobile devices. Support for other platforms is available through commercial licensing and porting kits.[2]

See also

Notes

  1. ^ "Microsoft: Sync Framework isn't Google Gears". 2007-11-06. Archived from the original on 2015-06-19. Retrieved 2015-06-19.
  2. ^ "Microsoft Sync Framework (MSF) – FAQ". Retrieved 24 July 2016.

External links