Introducing the Microsoft Sync Framework: Next Generation Synchronization Framework
The Microsoft® Sync Framework is the new framework and runtime for adding synchronization, roaming, and offline capabilities to applications. It supports peer-to-peer scenarios, works with devices and services, and is agnostic of data types, stores, and protocols. In this article, I’ll cover the high-level vision for the platform as well as the enabled scenarios made possible by the framework for developers, ISVs, and OEMs.
Several years ago, Microsoft assembled architects and researchers from across the company to understand the limitations preventing the seamless flow of data across applications, devices, and services to allow consumers access to their data wherever they need it. Throughout the investigations, several observations quickly emerged:
- Lack of generic synchronization technology lead to the creation of numerous single-purpose solutions.
- Solutions tended to reinvent the wheel; often falling into the same pitfalls explored by others.
- Solutions could not be bridged as they made contradictory assumptions about the synchronization methodology (i.e., relied too heavily on specific topologies, data types, stores or business logic).
It became clear that the only way to make progress towards enabling seamless “content flow” was to build a common framework with the following attributes:
- Powerful. Able to solve the numerous hard problems related to interoperability.
- Flexible. Able to be used in all endpoints in the sync-enabled ecosystem.
- Simple. Easy to use in any architecture to compose new systems.
Only then could the framework support roaming and sharing scenarios for content such as PIM, audio, video, settings, and files/folders across any number of PCs, services, and devices-all directly via peer-to-peer sync or through any number of intermediaries such as PCs or services.
At the same time, more and more applications were looking to enable an Outlook-like cached mode of operation in which an application operates offline and periodically synchronizes with the server. Clearly, the common framework would need to excel at scenarios such as:
- Caching and line of business (LOB) applications that can take data from relational databases and disparate back-end services offline.
- Taking Web services and Web applications offline, providing richer experiences or simply network resiliency.
The Microsoft Sync Framework was created with the following goals in mind:
- Provide a common runtime for developers building synchronization solutions, allowing them to reuse a reliable and optimized code base capable of addressing the numerous subtle issues that developers run into when building caching, offline, sharing or roaming scenarios.
- Facilitate content flow across solutions, even if they utilize different protocols and stores by standardizing on the synchronization metadata.
- Simplify the actual development of sync solutions by providing domain-specific and end-to-end components for common scenarios such as syncing relational databases, file systems, lists, devices, PIM, music, video, etc…
The Microsoft Sync Framework Approach
A key tenet of the Microsoft Sync Framework is to bring existing applications and devices into the sync ecosystem by leveraging as much as possible from their existing implementations. This meant supporting synchronization between data stores ranging from large distributed Web stores backed by relational databases down to the file systems found on removable USB drives.
The framework would also have to support numerous data types and schemas (such as relational data or files), as well as various sync topologies (such as peer-to-peer meshes or hub-and-spoke). These requirements emerged prominently whenever multiple sync solutions were bridged in a heterogeneous mesh.
For these reasons the heart of the Microsoft Sync Framework consists of the common synchronization metadata model. By agreeing on only the metadata without forcing agreement on protocols or storage, the Microsoft Sync Framework lays the foundation for content-flow as well as a generic solution for synchronization, roaming, and sharing.
The metadata at the core of Microsoft Sync Framework is highly efficient and compact, yet it provides full support for correct multi-master synchronization (that is, allowing concurrent updates on multiple endpoints). The Microsoft Sync Framework runtime implements the algorithms required to work with the metadata, allowing endpoints to easily participate in the ecosystem.
To make it easier and more productive for developers building on Microsoft technologies to leverage these capabilities, Microsoft has started integrating the enabling technology into our next-generation flagships and platforms. For more information on Sync Services for ADO.NET and for an example of a Microsoft Sync Framework-enabled solution for rich synchronization and caching of relational databases, please see Steve Lasker’s article, Caching with SQL Server Compact and the Microsoft Sync Framework for ADO.NET in this issue of CoDe Focus.
By: Moe Khosravy
Moe is the Lead Program Manager on the Microsoft Sync Framework and has been with the project since incubation. You can find him roaming the halls of campus preaching content flow and applying quotes from The Simpsons to everyday life. He was previously an architect in the Advanced Technologies group for Vital Images Inc, working on advanced medical visualization and analysis software solutions.
For years developers have been looking for an easy way to ensure that their applications may be taken offline and synchronized with other devices such as cellphones, PDAs, and other PCs.