Is it possible to synchronize SQL Compact databases without a central SQL Server? RRS feed

  • Question

  • Hi!

    We have a desktop application that is using LINQ to SQL on top of a SQL Server Compact database. The information in the database is not altered very often but when it does some customers are in need for a "server" solution in order to keep the system configuration up to date on all clients. Given the nature of the app a central SQL Server is not the best solution since it must be possible to work offline etc.
    When first developing the app the idea for a "server" solution was to use the sync framework (then in v1.0) synchronizing the clients through a central SQL server. Now the development of the server solution is coming up and when reading the news on v2.0 I get the impression that peer-to-peer sync between the compact databases without using a central SQL Server is possible.

    But I can't seem to find any concrete information or examples on this, but only examples of p2p with SQL Servers. 

    So, my first question is, is it possible to synchronize compact databases using each client's compact database only (or to use a compact database instance on a central server "as server")? If so, is there a good example?

    Secondly, is the "Visual Studio integration" (we use VS 2008) the "Create local data cache" option in the templates section or is there more integration that we just haven't found and what would the easiest way be to create a possible sync between SQL compact databases?

    Thursday, January 21, 2010 10:23 AM


  • Hi Jonas,

    I have adapted several of the examples to be SQL-SQL, since the providers are real P2P.
    So I would imagine that doing a sync between SQLCE-SQLCE should also not be an issue.
    The documentation does make a few references to 2 SQLCE peers being able to sync with each other.
    So you should be able to use any of the SQL-SQLCE samples available [http://code.msdn.microsoft.com/sync] to convert them to be SQLCE-SQLCE.

    Regarding the VS tooling: be carefull, this tooling only supports the 'Offline scenario' providers, which are not suitable for your needs. You need to use the 'Collaboration scenario' providers. Unforutnately there is absolutely no tooling support for these.

    Tip: Whenever you read anything about MSF, make sure that it applies to the Collaboration providers. It might save you a lot of time and possible problems.


    • Proposed as answer by L Zhou [MSFT]Editor Friday, January 22, 2010 12:13 AM
    • Marked as answer by nobba Monday, January 25, 2010 7:48 AM
    Thursday, January 21, 2010 12:33 PM