Friday, January 26, 2007

Microsoft Releases Synchronization Services CTP

The Microsoft Synchronization Services for ADO.NET v1.0 CTP release appeared without fanfare on January 22, 2007. The release contains "v1.0 early CTP" bits for the ADO.NET sync framework and and an updated SQL Server 2005 Compact Edition (SSCE) v3.5, the Orcas successor to the SSCE v3.1 RTM bits, which Microsoft released on January 11, 2007. Sync Services for ADO.NET's goal is to enable synchronization between any pair of data sources that have ADO.NET managed providers. The current code name for Sync Services is OCS (for Occasionally Connected Systems).

According to the download details:

Microsoft Synchronization Services for ADO.NET provides the ability to synchronize data from disparate sources over two-tier, N-tier, and service-based architectures. Rather than simply replicating a database and its schema, the Synchronization Services application programming interface (API) provides a set of components to synchronize data between data services and a local store.

Applications are increasingly used on mobile clients, such as laptops and devices, that do not have a consistent or reliable network connection to a central server. It is crucial for these applications to work against a local copy of data on the client. Equally important is the need to synchronize the local copy of the data with a central server when a network connection is available.

The Synchronization Services API, which is modeled after the ADO.NET data access APIs, gives you an intuitive way to synchronize data. It makes building applications for occasionally connected environments a logical extension of building applications where you can count on a consistent network connection.

The OCS installation folder is \Program Files\Microsoft Synchronization Services\ADO.NET\v1.0\, which contains Microsoft.Synchronization.Data.dll, Microsoft.Synchronization.Data.Server.dll, Microsoft.Synchronization.Data.Client.dll, and ReadMeSyncServices_ENU.htm. ReadMeSyncServices... has no useful content.

Documentation, Support and Sample VS 2005 Sync Projects

The download includes no white papers, tutorials, or other documentation for programming Sync Services. Microsoft says to expect documentation here for Sync Services in early February 2007.

In the meantime, there's a new Microsoft Synchronization Services for ADO.NET forum and an MSDN The Synchronizer blog run by Rafik Robeal. Rafik's blog has a link to Offline AppDemo-BuilderV1.1.zip, which contains a C# demo application that works with SQL Server.

Tip: If you install and run the Offline AppDemo.sln project be sure to read the readme.txt file in the ...\setup folder, select and run only the specified part of the demo.sql script with SSMS[X], add \SQLEXPRESS to the Server Machine text box if you're running SQLX, and click the Synchronize button to create the clientdb.sdf database in the location specified in the Client Database text box before you click any other buttons.

Steve Lasker mentioned in his January 23, 2007 "Sync Services for ADO.NET (OCS) CTP Now Available" post that the Orcas February CTP will include a Sync Designer and that he plans to "post a screen capture of the designer soon." If you check out Rafik's demo project, you'll see why the Sync Designer is a must. (Too much code required for a simple, two-table project.)

SSCE Backward Compatibility

The download details state that the SSCE v3.5 runtime bits install side-by-side with SSCE v3.1 on desktop, laptop, and Tablet PCs. The two SSCE installation folders are \Program Files\Microsoft SQL Server Compact Edition\v3.1\ (RTM) and \Program Files\Microsoft SQL Server Compact Edition\v3.5\ (CTP).

I've confirmed that complex (1,000+ lines) WinForm apps created with SSCE v3.1 RTM (file v3.0.5300.0, assembly v9.0.242.0) work fine with SSCE v3.5 from the Orcas January 2007 CTP (file v3.5.5277.0, assembly v3.5) and v3.5 in the OCS CTP (file v3.5.5305, assemby v3.5). Upgrading current SSCE 3.1 projects to v3.5.5305 requires removing the current System.Data.SqlServerCe reference, and adding a new v3.5.5305 reference by browsing to \Program Files\Microsoft SQL Server Compact Edition\v3.5\System.Data.SqlServerCe.dll.

Note: The 3.5.5305 version installs as expected with Windows Vista running under Virtual Server 2005 R2 SP1 CTP. This configuration isn't explicitly listed as supported by SSCE v3.5 in ReadmeSSCE35_ENU.htm. Version 9.0.242.0 failed to install completely under virtual Vista.

New v3.5 SSCE Features in the CTP Release

The SSCE v3.5 ReadmeSSCE35_ENU.htm file's "New Features in SQL Compact Edition 3.5 CTP" section list the following enhancements to v3.1:

  • Support for the timestamp datatype
  • Nested queries in the SELECT FROM clause
  • CROSS APPLY and OUTER APPLY operators
  • CAST function and TOP clause
  • Support for the ADO.NET Entity Framework and LINQ to Entities with System.Data.SqlServerCe.Entity.dll (under Orcas)
  • Enhanced table editor for VS Orcas can add foreign key constraints
  • Support for local transaction scope

Note: The enhanced table editor for VS Orcas didn't appear in my installation of the Orcas January CTP. A later Orcas build (February CTP?) probably is required.

Surprisingly, the new features did not include the expected removal of the 4-GB database size limit. The ssce:Max Database Size range remains 16 to 4091 kB.

The bits appear to me to be a stealth release. As of today (1/27/2007), there was no mention of Sync Services on the SSCE main page and there were no posts about Sync Services in the SQL Server Compact Edition forum until I added a message with a link. Microsoft might be waiting for initial documentation to be completed before promoting Sync Services.

Update 1/28/2007: Minor clarifications and corrections.

Technorati tags: , , , , , , , , , , , , , , , , .