Microsoft Sync Framework Overview Saturday, June 6, 2009 By  HIEU LE TRUNG
Content Today application’s data issue Microsoft Sync Framework Overview Microsoft Sync Framework in Detail Page
Overview Microsoft Sync Framework is a platform for synchronizing data across multiple data stores Available both in managed code, as well as unmanaged code Features Pre-define some basic synchronize provider ADO.NET Sync Feeds Sync File Sync Pre-define SQLCE metadata store Built-in conflict detection algorithm The challenges in sync has already been covered by MSF Change tracking Conflict detection Conflict resolving Connectivity loss Page
The Issue of Distributed Application Page
Occasional Connected Application Cache data locally Work even when you’re not online Leverage client UI Minimize network utilization Synchronize with the server (when connected) At any time At any place Page
Key Scenario for Sync Page  Offline Cached Mode Mobile information workers Rich experience for web services Collaboration My contacts, calendar everywhere Documents everywhere My music everywhere Microsoft Sync Framework
The Sync Session Page  Sync Provider Sync Application Sync Provider Sync Orchestrator Data Store Data Store changes changes changes changes changes Meta-data Interpretation Tools Provider Services MD Store Sync Runtime
Sync Concepts Data Source : the location where all information which needs to be synchronized is stored Metadata : the ability to store information about the data store and the objects within that data store with respect to state and change information  Versions  Knowledge  Tick Count  Replica ID  Tombstones  Knowledge : is a compact representation of changes that the replica is aware of. Providers use replica knowledge to:  Enumerate changes (determine which changes another replica is not aware of).  Conflict Detection (determine which operations were made without knowledge of each other)  Tombstone : is the information for each of the items that are deleted. A tombstone must contain the following information:  Global ID.  Deletion version.  Creation version.  Page
Sync Flow Page
Conflicts & Resolutions Two kinds of conflict:  Concurrency Conflicts : changes affects on the same item  Constraint Conflicts : conflicts that violate constraints that are put on items, such as the relationship of folders or the location of identically named data within a file system.  Conflict Resolutions Source wins Destination wins Merge Log Defer Page
What is MSF for Developers? Includes out-of-box providers that can be configured to sync common endpoints Support for building your own providers for your endpoint Support for multiple development languages Managed Code: C#, Visual Basic.NET, … Native/Unmanaged Code: C++… To write a sync solution using MSF, you need to write Provider: the provider class for managing knowledge and sync session  Metadata Store: the metadata is look like change log, you need to implement this in order to determine the changes between two sync period.  Metadata Item: an item in the metadata store  Data Source: the raw data source for syncing.  Knowledge: if you attempt to sync different data source Your own sync controller class to handle conflicts, changes writing...  Page
Windows Azure Platform Page
SQL Services & MSF Database:  Relational processing for structured/unstructured data Data Sync:  Synchronization for occasionally connected clients Reporting:  Self-service authoring and report sharing Data Mining:   Self-service data trending & analysis ETL:  Data transformation & cleansing across on/off premise Reference Data:  Broad variety of reference data sets Page
Summary Microsoft Sync Framework is a platform for data synchronization solutions Includes out-of-box providers that can be configured to sync common endpoints Support for building your own providers for your endpoint Support for multiple development languages Managed Code: C#, Visual Basic.NET, … Native/Unmanaged Code: C++… Do you think that sync should be a hot technology in 2009 and future? Question? [email_address]   Page
References http://en.wikipedia.org/wiki/Microsoft_Sync_Framework Microsoft Sync Framework Developer -  http://msdn2.microsoft.com/en-us/sync/default.aspx LiveMesh -  https://www.mesh.com/Welcome/default.aspx FeedSync -  http://dev.live.com/feedsync/ Google Gears -  http://gears.google.com/   http://code.msdn.microsoft.com/sync/ Master-Master Replication -  http://msdn.microsoft.com/en-us/library/ms978735.aspx   Page

Microsoft Sync Framework

  • 1.
    Microsoft Sync FrameworkOverview Saturday, June 6, 2009 By HIEU LE TRUNG
  • 2.
    Content Today application’sdata issue Microsoft Sync Framework Overview Microsoft Sync Framework in Detail Page
  • 3.
    Overview Microsoft SyncFramework is a platform for synchronizing data across multiple data stores Available both in managed code, as well as unmanaged code Features Pre-define some basic synchronize provider ADO.NET Sync Feeds Sync File Sync Pre-define SQLCE metadata store Built-in conflict detection algorithm The challenges in sync has already been covered by MSF Change tracking Conflict detection Conflict resolving Connectivity loss Page
  • 4.
    The Issue ofDistributed Application Page
  • 5.
    Occasional Connected ApplicationCache data locally Work even when you’re not online Leverage client UI Minimize network utilization Synchronize with the server (when connected) At any time At any place Page
  • 6.
    Key Scenario forSync Page Offline Cached Mode Mobile information workers Rich experience for web services Collaboration My contacts, calendar everywhere Documents everywhere My music everywhere Microsoft Sync Framework
  • 7.
    The Sync SessionPage Sync Provider Sync Application Sync Provider Sync Orchestrator Data Store Data Store changes changes changes changes changes Meta-data Interpretation Tools Provider Services MD Store Sync Runtime
  • 8.
    Sync Concepts DataSource : the location where all information which needs to be synchronized is stored Metadata : the ability to store information about the data store and the objects within that data store with respect to state and change information Versions Knowledge Tick Count Replica ID Tombstones Knowledge : is a compact representation of changes that the replica is aware of. Providers use replica knowledge to: Enumerate changes (determine which changes another replica is not aware of). Conflict Detection (determine which operations were made without knowledge of each other) Tombstone : is the information for each of the items that are deleted. A tombstone must contain the following information: Global ID. Deletion version. Creation version. Page
  • 9.
  • 10.
    Conflicts & ResolutionsTwo kinds of conflict: Concurrency Conflicts : changes affects on the same item Constraint Conflicts : conflicts that violate constraints that are put on items, such as the relationship of folders or the location of identically named data within a file system. Conflict Resolutions Source wins Destination wins Merge Log Defer Page
  • 11.
    What is MSFfor Developers? Includes out-of-box providers that can be configured to sync common endpoints Support for building your own providers for your endpoint Support for multiple development languages Managed Code: C#, Visual Basic.NET, … Native/Unmanaged Code: C++… To write a sync solution using MSF, you need to write Provider: the provider class for managing knowledge and sync session Metadata Store: the metadata is look like change log, you need to implement this in order to determine the changes between two sync period. Metadata Item: an item in the metadata store Data Source: the raw data source for syncing. Knowledge: if you attempt to sync different data source Your own sync controller class to handle conflicts, changes writing... Page
  • 12.
  • 13.
    SQL Services &MSF Database: Relational processing for structured/unstructured data Data Sync: Synchronization for occasionally connected clients Reporting: Self-service authoring and report sharing Data Mining: Self-service data trending & analysis ETL: Data transformation & cleansing across on/off premise Reference Data: Broad variety of reference data sets Page
  • 14.
    Summary Microsoft SyncFramework is a platform for data synchronization solutions Includes out-of-box providers that can be configured to sync common endpoints Support for building your own providers for your endpoint Support for multiple development languages Managed Code: C#, Visual Basic.NET, … Native/Unmanaged Code: C++… Do you think that sync should be a hot technology in 2009 and future? Question? [email_address] Page
  • 15.
    References http://en.wikipedia.org/wiki/Microsoft_Sync_Framework MicrosoftSync Framework Developer - http://msdn2.microsoft.com/en-us/sync/default.aspx LiveMesh - https://www.mesh.com/Welcome/default.aspx FeedSync - http://dev.live.com/feedsync/ Google Gears - http://gears.google.com/ http://code.msdn.microsoft.com/sync/ Master-Master Replication - http://msdn.microsoft.com/en-us/library/ms978735.aspx Page