Data Access Technologies

(Data Access, XML, SSIS, LINQ, System.Data ...)

Sync Framework Frequently Asked Questions (FAQ)

Sync Framework Frequently Asked Questions (FAQ)

  • Comments 6

In this blog, I have attempted to answer some common questions we have seen on Sync framework (and Sync services for ADO .Net) while working with our customers on Sync framework issues. After working with multiple versions of Sync Framework and Sync Services for ADO .net, if you are a little confused on the available versions and how/when to get each of them you may find the FAQ helpful. For full details on any topic, I would recommend reviewing our msdn documentation on Sync Framework or our product team’s blog on Sync Framework. If you have other FAQ type questions, please feel free to ask and we will try to answer those.

Q&A:

1.       What is Sync Framework?

Sync Framework is a comprehensive synchronization platform that enables collaboration and offline access for applications, services, and devices. Sync Framework features technologies and tools that enable roaming, data sharing, and taking data offline. By using Sync Framework, developers can build synchronization ecosystems that integrate any application with data from any store, by using any protocol over any network.

2.       What is the relation between ‘Sync Framework’ and ‘Sync Services for ADO .Net’?

In Summary, think of Sync Framework as the bigger umbrella or framework that enables synchronization between devices, Data Store, files etc. Think of Sync services for ADO .net as a component of Sync Framework that enables Synchronization between Data Sources for which an ADO .net provider is available.

It comes down to the history of how we used to ship Sync services for ADO .net. Initially Sync Services for ADO .Net (aka OCS) was shipped as a standalone component – this happened for versions 1.0 and 1.0 SP1 of Sync Services for ADO .Net. Starting with Sync Services for ADO .net 2.0, it became part of Sync Framework 1.0 installation. With the arrival of Sync framework, Sync services for ADO .net is now a component of the Sync Framework.

3.       What are the current versions of the Sync framework and how do we install them?

There are currently 3 versions available –

Sync framework 1.0 RTM– installed with SQL Server 2008 RTM

Sync Framework 1.0 SP1 –installed with Visual Studio 2010 RTM and web download

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=b4f54dd0-5b66-4043-9b50-b12604bfcf35

Sync Framework 2.0 – currently available only via web download http://www.microsoft.com/downloads/details.aspx?FamilyID=89adbb1e-53ff-41b5-ba17-8e43a2e66254&displaylang=en

4.       What are the versions of Sync services for ADO .net available and how do we install them?

Sync Services for ADO .Net 1.0 RTM – gets installed with Visual Studio 2008 RTM or SQL Server Compact Edition 3.5 RTM

Sync Services for ADO .Net 1.0 SP1 – gets installed with Visual Studio 2008 SP1 or via web download

Web download link for desktop –http://www.microsoft.com/downloads/details.aspx?familyid=DC614AEE-7E1C-4881-9C32-3A6CE53384D9&displaylang=en

Web download link for device-http://www.microsoft.com/downloads/details.aspx?familyid=75FEF59F-1B5E-49BC-A21A-9EF4F34DE6FC&displaylang=en

       Sync Services for ADO .Net 2.0 – gets installed with Sync framework 1.0 RTM

       Sync Services for ADO .Net 2.0 SP1 – gets installed with Sync framework 1.0 SP1

Sync Services for ADO .net 3.0 – these are now known as ‘database synchronization providers’ that get installed with Sync Framework 2.0. 

NOTE: In our msdn documentation for Sync Framework 2.0, we use the term ‘database synchronization providers’ rather than ‘Sync services for ADO .net 3.0’ –so, I must warn you not to look for Sync services for ADO .Net 3.0 in the documentation and just think about the database Synchronization providers that get installed with Sync Framework 2.0. This is also documented in msdn

http://msdn.microsoft.com/en-us/library/bb726002(SQL.105).aspx 

This section of the Sync Framework documentation describes database synchronization providers (referred to as Sync Services for ADO.NET in previous releases)”

5.       Can multiple versions of Sync framework (and sync services for ADO .Net) co-exist?

Yes. Depending on the products (for example, Visual Studio 2008, SQL Server 2008, SQL Server 3.5 Compact Edition etc) you have installed on a machine, it’s quite possible to have multiple versions of Sync framework and Sync services for ADO .Net installed on a machine. Here is a screenshot from GAC (Global Assembly Cache) on a machine where we have multiple versions of Sync framework and Sync services for ADO .net installed.

 

clip_image002

 

 

6.       How do I know which version(s) of Sync Framework is installed on the machine?

There are 2 simple ways –

A.      By looking at installation folders –

Location of Sync Framework 1.0 binaries

Hardware Architecture

Location of binaries

X64

C:\Program Files\Microsoft Sync Framework\v1.0\Runtime\x64

X86

C:\Program Files\Microsoft Sync Framework\v1.0\Runtime\x86

 

Location of Sync Services for ADO .Net 2.0 binaries

Hardware Architecture

Location of binaries

X64

C:\Program Files\Microsoft Sync Framework\v1.0\Runtime\ADO.NET\V2.0\x64

X86

C:\Program Files\Microsoft Sync Framework\v1.0\Runtime\ADO.NET\V2.0\x86

 

Location of Sync Framework 2.0 binaries–

Hardware Architecture

Location of binaries

X64

C:\Program Files\Microsoft Sync Framework\2.0\Runtime\x64

X86

C:\Program Files\Microsoft Sync Framework\2.0\Runtime\x86

 

Location of Sync Services for ADO .net 3.0 (Database providers in Sync Framework 2.0) Binaries

Hardware Architecture

Location of binaries

X64

C:\Program Files\Microsoft Sync Framework\2.0\Runtime\ADO.NET\V3.0\x64

X86

C:\Program Files\Microsoft Sync Framework\2.0\Runtime\ADO.NET\V3.0\x86

 

B.   By Looking in GAC (Global Assembly cache)

 

All the managed assemblies of Sync framework and sync services for ADO .net are installed in the GAC (Global assembly cache). GAC location is c:\winnit\assembly or c:\windows\assembly

For Sync framework version, right click on Microsoft.Synchronization.dll and check the assembly version and file version.

For Sync services for ADO .net version, right click on one of the assemblies, for example, Microsoft.Synchronization.Data.dll and check assembly and file version.

7.       How do I know which version of Sync framework is used in my application?

A)      For development time (In Visual Studio 2008) –

We can check the properties of the assembly (or DLL) reference in our project and the Path and Versions properties should tell us the version of Sync framework and Sync services for ADO .Net assemblies used in our code.

B)      For run time –

We can use a couple of different ways to check the file and assembly version used in the application.

-          Process monitor or Process explorer

-          Manual dump of the Application loading Sync Assemblies

-          Assembly Binding Log Viewer (Fuslogvw.exe) – for managed assemblies

 

8.       What factors do I need to consider while selecting the appropriate version of Sync Framework for my application?

In general, we recommend that you consider using Sync framework 2.0 (or later) and the new database providers that come with Sync Framework 2.0 as we have made lot of improvements in Sync framework 2.0 and added new features like batching, Provisioning and Management API etc.

A few exception scenarios are –

a.       If you need to deploy the sync application to a device, then you will have to use Sync Services for ADO .net SP1 (for devices) as we still don’t have device support for the new database providers that are part Sync Framework 2.0

b.      If you must need Visual Studio designer support - As of now, we don’t have any Visual Studio designer support for Sync Framework 2.0 database providers (Local Database Cache in Visual Studio 2008 and 2010 still use the Sync Framework 1.0 and Sync Services for ADO .net older versions). But with Sync Framework 2.0 Management and Provisioning APIs – provisioning has been made easier for SQL Server and SQL Server CE with a few lines of code.

For additional information, please review the msdn documentation http://msdn.microsoft.com/en-us/library/dd937565(SQL.105).aspx 

 

9.       While selecting between Sync Framework 1.0 RTM and 1.0 SP1, should we target for 1.0 SP1?

Unless you specifically require the changes introduced in Sync framework 1.0 SP1, you should stay with 1.0 RTM.

From the documentation of Sync Framework 1.0 SP1 download center http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=b4f54dd0-5b66-4043-9b50-b12604bfcf35

“Making this API surface public provides developers with a finer grain of control and insight into the tracking of changes within SQL Compact. In some cases, making this change tracking feature public has resulted in performance degradation because there are more layers to interact with when accessing change tracking information. Because of this, before you upgrade to Sync Framework 1.0 SP1 you must carefully consider whether your need for this public change tracking feature outweighs the performance impact of leveraging this new API.”

10.   What tool support do we have for developing Sync framework application?

For Sync Framework 1.0 –

a.       Visual Studio 2008 (and 2010) ‘Local Database Cache’ item type that helps in initializing and provisioning the databases and creating designer generated code and queries.

b.      SqlSyncAdapterBuilder – creates SyncAdapter and commands required to run the synchronization.

For detailed information, please review the msdn documentation http://msdn.microsoft.com/en-us/library/bb726018(SQL.90).aspx

For Sync Framework 2.0 –

As of now, we don’t have Visual Studio designer support for Sync framework 2.0, but Provisioning and initialization activities that were previously exposed only through Visual Studio tooling have now been added to the database provider APIs. We can see an example of this in the following msdn documentation

http://msdn.microsoft.com/en-us/library/dd918848(SQL.105).aspx

11.   What versions of Visual Studio can I use to develop Sync framework application?

If you would like to leverage existing designer support, then you need to use either Visual Studio 2008 (with SP1) or Visual Studio 2010. But technically, you can use Visual Studio 2005, 2008 or 2010 if you don’t need the designer support, for both Sync framework 1.0 and 2.0. We recommend that you use either Visual 2008 with SP1 or Visual Studio 2010.

12.   I am done with my development of Sync application. How do I redistribute Sync framework with my application?

For redistributing Sync Framework 2.0 with your application, please review the msdn documentation http://msdn.microsoft.com/en-us/library/dd937085(SQL.105).aspx

For versions where an MSI package is available, you can redistribute the MSI with your application. If an MSI is not available for a specific version (For example, Sync framework 1.0 RTM), then only option is to install Sync framework (and the associated Sync Services for ADO .net) via one of the install options.

13.   What databases does Sync framework work with?

Sync Framework can potentially work with any ADO .net compatible databases along as there is a database Synchronization provider and an ADO .net Data Provider available for the DBMS.

In Sync Framework 1.0

We had 2 Database Synchronization providers available, namely SqlCeClientSyncProvider and DbServerSyncProvider. These providers support offline (or hub-and-spoke) scenarios –so, only client DBMS we could use was SQL Server Compact Edition and on the Server side we had the ability to use SQL Server or any other ADO .net compatible DBMS.

In Sync Framework 2.0

In addition to the older providers, we also have 3 new Database Synchronization providers, namely SqlSyncProvider, SqlCeSyncProvider, and DbSyncProvider. These new providers can be used with Collaboration as well as offline scenarios, thereby enabling any ADO .net compatible Database to participate as client or Server in offline scenarios or as a peer in collaboration scenarios.

SqlSyncProvider –used with SQL Server database, including SQL Server Express

SqlCeSyncProvider –used with SQL Server Compact edition

DbSyncProvider – used to synchronize non-SQL Server databases

Additionally, Sync framework provides necessary API support to create a custom database Synchronization provider, if appropriate.

For additional information, please review the msdn documentation http://msdn.microsoft.com/en-us/library/bb902818(SQL.105).aspx

14.   In a 3-tier Sync application where do we need to have Sync framework components installed?

We need to have Sync Framework components on –

Tier 1: Where the client application is deployed

Tier2: Where WCF service is deployed.

We don’t need Sync Framework on the machine where the actual DBMS is located if the DBMS is deployed on a separate machine from Tier1 or Tier2.

15.   What are some common tools used for troubleshooting run-time issues with Sync Framework (and Sync Services for ADO .net) applications?

Some common tools (not limited to) are -

a.       .Net Tracing (SyncTracer log) for database providers (or Sync Services for ADO .net components) http://msdn.microsoft.com/en-us/library/cc807160.aspx

This is available with Sync Services for ADO .net 1.0 SP1 or later.

b.      if the issue is with SQL Server, use SQL Profiler trace to further narrow down the issue

c.       ETW tracing (available for Sync Framework 2.0 or later) of Sync framework core components http://msdn.microsoft.com/en-us/library/ee617387(SQL.105).aspx

d.      Handling appropriate events. For example, ApplyChangedFailed event (implemented in database providers) comes really handy while troubleshooting or handling data conflicts while synchronization.

       For more advanced issues –

e.      Memory dump analysis  - for Out of Memory Exception issues or application hang issues etc

f.        Network monitor tool – troubleshooting network layer issues

g.       WCF tracing – troubleshooting WCF layer issues http://msdn.microsoft.com/en-us/library/ms730342(VS.90).aspx

16.   What basic information should we collect while working on a Sync Framework issue?

a.       Version of Sync Framework (and database providers or Sync Services for ADO .net) – because there are multiple versions that exist and get shipped in various ways, identifying the Sync framework version early in troubleshooting will save lot of hours spent on the issue and help going in the right direction.

b.      If we are following an msdn sample, collect the sample URL – this will help determine the Sync framework version.

c.       Visual Studio version and service pack

d.      If SQL Server is used, SQL Server edition, version and service pack

e.      Operating System of all machines involved and service pack. 32 bit or 64 bit?

f.        Is the application 32 bit or 64 bit?

g.       If SQL Server compact edition is used, the version and service pack of SQL Server compact edition.

h.      If non- SQL Server DBMS is used, exact version of the DBMS along with –

1              1) Database Synchronization provider being used.

                2) Name and version of ADO .net provider being used.

 

Author : Azim (MSFT), SQL Developer Technical Lead , Microsoft

Reviewed by : Dan(MSFT), SQL Escalation Services, Microsoft

Leave a Comment
  • Please add 6 and 4 and type the answer here:
  • Post
  • Is there any dll available for Sync framewok to work in Silverlight 4.0

  • Our team is writing an app with SQL CE on the Handheld devices which will replicate/synchronize with a SQL Server 2008 Database.  We were sold on Merge Replication but now see there is another option with Sync Services.  What are the primary differences?  Thank you!

  • @sekar

    Currently Sync Framework (upto 2.0) does not run in Silverlight. But if you need this capability, I would encourage you to look at the work our product team is doing in this area.

    Please review our product team's blog on this -

    http://blogs.msdn.com/sync/archive/2009/12/14/offline-capable-applications-using-silverlight-and-sync-framework.aspx

    "In order to truly take advantage of SilverLight's cross platform capability we had to come up with a solution where we could still support clients that do not have a Sync Framework runtime. To do this what we did was build the architecture such that all of the core Sync Framework logic resides on the service (in this case a Windows Azure Webrole), and that is where all of the heavy lifting of the synchronization process is executed"

    I believe, 'Siverlight Support' will be much simpler in future versions of Sync Framework.

    Please review

    http://blogs.msdn.com/sync/archive/2010/03/16/webcast-building-offline-web-apps-using-microsoft-sync-framework.aspx

    Please feel free to post any questions/comments in the above blogs if you would like to know more about this.

    Azim[MSFT]

  • Becky,

    Both Merge replication and Sync Services for ADO .Net (Sync Framework) will work for your scenario. But one of the biggest differences is - Merge Replication is a DBA focused technology and will be relatively easier to setup where as Sync Framework (and Sync services for ADO .net) is a developer focused technology and will require coding. Also, Sync Framework is more open and flexible than Merge replication. We also need to think about 'project timeline' while selecting the two - for shorter project timeline, Merge replication will fit better.

    If you juset need this particular functionality of replication/Sync between SQL CE on device and SQL Server 2008, then Merge replication may be good enough for you (depending on how much flexibility you want), but if you need more flexiblities (Hetereogeneous Data source support etc) and a open Sync platform, then you may also look into Sync framework in future.

    The following msdn artcile is a good reference for feature comparision between the avialble soilutions -

    http://msdn.microsoft.com/en-us/library/bb726031(SQL.90).aspx

    I hope it helps!

    Thanks,

    Azim[MSFT]

  • Becky,

    Additionally, Merge replication has built-in support for filtering and automatic schema change propagation. In short, you will get more out-of-the-box support from Merge replication. Also, since you will use SQL CE on a device, as of now you will need to use Sync services for ADO .net 1.0 SP1 for devices as we still don’t have device support in Sync Framework 2.0 Database providers(as described in Q8)

    Thanks,

    Azim[MSFT]

  • Dear Sir or Madame,

    I'm developer currently working on synchronization module for my company. We would like to ask you and be sure that we have faced one and only existing solution to meet our requirements. Our scenario: We have one server database and multiple clients. Each table that is shared by clients contains filtering row doctor_id, it is unique ID of current user from client application. We have also tables that are download only and don't have any filtering column. We want to synchronize only that rows that are filtered by doctor_id and fully download data form all non-filtered tables. From month to this day I was fighting with scope provisioning, but it can't be done without workaround mentioned below that I'm basing on. social.microsoft.com/.../4af321b6-4678-4620-af46-98c560cc2bc6 I would like to ask you: Are there any other solutions (other filtering) than scope provisioning to meet our requirements? We are facing deadline and Scope Provisioning still generates issues on our way. We can't go forward with such problematic framework. We would be grateful if you could answer our question, any additional suggestions are welcome.

    Regards, Daniel Skowroński

Page 1 of 1 (6 items)