Showing posts with label Occasionally Connected Systems. Show all posts
Showing posts with label Occasionally Connected Systems. Show all posts

Wednesday, June 06, 2007

Tech●Ed 2007 Coverage from FTPOnline

Redmond Media Group's FTPOnline columnists (including me) are covering Tech●Ed 2007—the 15th Anniversary of Microsoft's yearly technical conference—for the .NET Insight newsletter's "Tech●Ed Show Daily" issues. (Updated June 8, 2007.)


From the June 5, 2007 .NET Insight "Tech●Ed Show Daily" issue:

Muglia Maps Microsoft's 'Journey Towards Dynamic IT'

The traditional "vision" keynote gives way to optimization, virtualization and standardization of existing IT infrastructure along with new agile business processes and modeling to reverse the 70/30 ratio of IT maintenance to new solution spending at Tech●Ed's 15th anniversary.

Hot at Tech●Ed 2007: SQL Server 2008

The next version of SQL Server will deliver native data types for documents, filestreams and geocoding, provide policy-based management, support the Entity Data Model (EDM) and Language Integrated Query (LINQ), and integrate with Microsoft's enhanced business intelligence (BI) offerings.

Click here for a table of Tech●Ed sessions about SQL Server 2008 and implementing business intelligence projects.


From the June 7, 2007 .NET Insight "Tech●Ed Show Daily" issue:

Hot at Tech●Ed 2007: Introducing the Entity Framework and LINQ

The Entity Framework (EF) and Language Integrated Query (LINQ) are two new technologies in Visual Studio 2008 that form one of the Pillars of SQL Server 2008 (formerly "Katmai"): Dynamic Development. Both play nicely with SQL Server 2005 and 2000, too.

Click here for a table of Tech●Ed sessions about the Entity Framework and LINQ.

Exploit SQL Server Compact Edition and Occasionally Connected Systems

SQL Server Compact Edition v3.1 and v3.5's free license covers deployment on Windows PC clients as well as devices, so you can take advantage of this lightweight, in-process relational database as a local data cache and automatically synchronize its data with a back-end SQL Server 200x instance.

Click here for a table of Tech●Ed sessions about SQL Server Compact Edition, data synchronization, and occasionally connected systems.

Video: Preview SQL Server 2008's Database Engine (01:04:00)

Christian Kleinerman, group program manager of Microsoft's Relational Engine Team, offers a first look at SQL Server 2008, formerly code named "Katmai." Specifically, his presentation at VS Live! Orlando delivers a high-level overview of enhancements to the relational database engine. (Taped May 8, 2007.)


Note: Visual Studio Magazine has become a controlled-circulation publication. Sign up now for your free subscription.

Click here to sign up for any or all of Redmond Media Group's Insight Newsletters:

  • .NET Insight—Takes subscribers through the maze of Visual Studio and .NET technologies, from development tools and platforms to hosted Web services and migration strategies. Published weekly.
  • Java Insight—Delivers the latest news, trends and techniques for creating enterprise Java applications, including technologies like J2EE, Web services, JSP, wireless systems and much more. Published weekly.
  • Web Design & Development Insight—Delivers proven tactics for creating intuitive and reliable sites. Published monthly.
  • Enterprise Architect Insight—Provides enterprise architects with information on technologies and techniques that are shaping the design and integration of enterprise systems today. Published twice monthly.
  • Upside Business Insight—Takes you behind the news and technologies that are shaping the high-tech industry. It will help you gain insights on who is shaping technology and where the industry is going, so you can better plan your IT efforts. Published monthly.
  • SQL Pro Insight—Provides essential content on SQL Server to help with your database administration and programming needs. Get tips on performance, management, security, and more. Published twice monthly.
  • Eclipse Insight—Provides information on the Eclipse platform, including new projects and technologies that shape this exciting trend. Published monthly.

Friday, June 01, 2007

Google Gears Piques New Interest in Data Synchronization

Google's announcement of their new Gears browser extension API for enabling offline capabilities in Web apps with these services:

  • LocalServer to cache and serve application resources locally.
  • Database (SQLite) to serve as a searchable local data store with online synchronization capability
  • WorkerPool to enable clients to run resource-intensive operations on a new thread

Google's Choosing an Offline Application Architecture page shows how the client application's UI can switch between the Web server and local database cache as its data source. Running SQLite or any other database in the browser requires write access to the client's file system. Synchronization can be manual, as in the Gears-enabled Google Reader (a button toggles between online and offline mode), or background, which can take advantage of the WorkerPool.

Update 6/2/2007: Tim Anderson's Why Google Gears? Thoughts from Google Developer Day provides an independent overview of Google Gears and notes the importance of synchronization. Tim also mentions full-text search in his SQLite will be everywhere post. According to Michael Cleverly's October 11, 2006 blog entry for D. Richard Hipp's keynote at the 13th Annual Tcl/Tk Conference:

As of SQLite 3.3.8 (released Monday!) full text search support in SQLite. Richard's authorized to announce help from engineers at Google. Later question elicited that roughly half of the FTS code was written by Richard and Dan, the other half by four engineers from Google. He isn't able to/can't comment on their motivations/plans/internal usage. [Minor edits.]

[The blog also notes that Microsoft uses SQLite in the Xbox.]

Google's Database API page states, "Google Gears includes SQLite's full-text search extension fts2."

Scott Hanselman says in his Google Gears - Maybe all Rich Internet Applications needed was Local Storage and an Offline Mode post:

Stunning move by Google today in the Rich Internet Application space. While most of us (myself included) are off debating Flash vs. Silverlight vs. Apollo vs. Whatever, Google introduces Google Gears ... a technology all of the above (or none of the above) can utilize ...

This is a huge move and is quite brilliant. In one seemingly innocuous move (and one tiny 700k (yes, 700K) download) Google is well positioned to get Google Docs, including Writely, Spreadsheet and Presentation, along with who knows what else, enabled for offline use. And the whole thing is Open Sourced via the New BSD License.

Dare Obasanjo quotes Robert Scoble's Google brings developers offline with “Gears”; new offline Reader post, and asks "[W]hat took them so long?", and closes with "Welcome to the future."

Robert says:

Gears supports using Adobe’s Apollo and Flash and should support other technologies including Microsoft’s Silverlight. [Emphasis added.]

But eWeek's Darryl K. Taft clarifies Gears' support for Silverlight in today's "Google Gears Aims to Bolster Adobe Apollo, Others" article:

Meanwhile, Google Gears will work with Microsoft's Silverlight cross-platform, cross-browser tool for building RIAs. Gears hopes to complement Microsoft's Silverlight and other technologies by offering an offline infrastructure that developers can incorporate into any Web application—even those that use plug-ins from other companies, a Google spokesperson said. [Emphasis added.]

However, Microsoft has its own local database cache: SQL Server Compact Edition (SSCE) and Synchronization Services (Sync Services). Orcas Beta 1 includes Sync Services Beta 1 and an early version of the graphical Sync Designer for SSCE 3.5. Sync Services is limited to synchronization between SSCE 3.1 or 3.5 on the client side and SQL Server 200x behind the Web server. Unfortunately, SSCE v3.x doesn't have full-text search capability.

Presumably, it would be possible to install the SSCE bits (1.8 MB) in conjunction with the Silverlight 1.1 runtime (4.2 MB) but you'd also need to install at least the Sync Services client pieces. The entire gears.dll is 852 kB for IE and 700 kB for Firefox. (The SQLite library itself varies in size from 224 to 513 kB, depending on options). However, a more appropriate comparison might include the 2.3 MB for the Flash player and its helper file. Note that the Gears library doesn't include a synchronization service. Developers would need to write their own service, which is no small chore (especially in JavaScript.)

Update 6/6/2007: Dare analyzes Google Gears in his June 5, 2007 Google Gears: Replacing One Problem with Another post and concludes that the missing synchronization component might be a showstopper:

It seems that without providing data synchronization out of the box, Google Gears leaves the most difficult and cumbersome aspect of building a disconnected Web app up to application developers. This may be OK for Google developers using Google Gears since the average Google coder is a Ph.D but the platform isn't terribly useful to Web application developers who want to use it for anything besides a super-sized HTTP cookie.

Collectively, the comments to Dare's post point out that general-purpose synchronization systems aren't easy to get right and that users of the Gears toolkit will need to write their own sync services. One commenter (Sam Sethi) points out that the Remember the Milk online to-do list has added Google Gears synchronization.

Update 6/7/2006: eWeek's Microsoft Watch blogger, Joe Wilcox, posted his Can Microsoft Be the Wrench in Google Gears? article on June 6, 2007. Joe quotes the same paragraph from Date's entry (above), and observes:

Quite possibly, synchronization is the killer app that will determine whether desktop software maintains its relevance or the Web becomes the more popular platform. ... The natural place for synchronization services is as part of the operating system.

Microsoft DevSource's Jeff Cogswell responded to Joe's post in his June 7, 2007 Synchronization: The future of the web? item:

Unfortunately, I think Joe's blog is missing something here, and I'm speaking as a developer. Synchronizing data is never a trivial nor generic task, because how it works and what it does depends on the particular application, and often requires substantial user input, and is heavily tied to file formats and how the data is organized inside the file.

ZDNet Blogger David Berlind posted an audio interview about Google Gears that he conducted on May 30, 2007 with Google director of engineering Linus Upson. Berlind quotes Adobe’s vice president of product management Michele Turner:

[W]e were developing identical technology to facilitate the offline component of the Apollo runtime. ... For example, they’re [Google] using SQLite and we were already incorporating SQLite into Apollo. So, now we’re aligning our efforts with Google on things like the synchronous and asynchronous calls that must be made to the SQLite database in order to enable the offline capability.

Google Gears piqued more interest in data synchronization than I expected.

Recent Microsoft Synchronization Services Updates

My "Update Local Data Caches with Sync Services" article in the May 2007 issue of Visual Studio Magazine carries this deck:

"The Microsoft Synchronization Services 1.0 API for SQL Server 2005 Compact Edition and the new Sync Designer in the Orcas March 2007 CTP team up to generate a local data cache that synchronizes incrementally and bidirectional with SQL Server [Express]."

Sync services and the Sync Designer is the technology behind Occasionally Connected Systems, which--together with the Entity Framework--comprise the Dynamic Development "Pillar of Katmai."

My earlier "Lighten Up Your Local Databases" in the March 2007 Visual Studio Magazine issue covers SQL Server 2005 Compact Edition v3.1 , which is the first version licensed for use in conventional PCs, and v3.5, which is included in Visual Studio codename "Orcas." Microsoft initially called V3.5 "SQL Server Everywhere Edition." V3.5 adds important features, such as timestamp fields to aid synchronization and simplify concurrency conflict detection. SQL Server Mobile Edition v3.0 and earlier were licensed for use by devices and Tablet PCs only.

Microsoft's Rafik Robeal released Demo VII: Tombstone Cleanup and Detecting Stale Offline Clients for the Sync Services runtime. Tombstone cleanup detects and prevents stale clients from synchronizing and tells them to reinitialize their local data cache. A stale offline client is a computer that hasn't synchronized in the last n days, so the client's sync request is rejected.

Rafik has updated the preceding six demos to VS Orcas Beta 1 in his Sync Services Demos Refresh post:

Update 6/6/2007: Rafik just added a Sync Events for Conflict Handling, Progress Reporting, Business Logic … post that describes Sync Services new set of events. Some of the events are implemented in Beta 1, but you'll have to wait for Beta 2 for the others. See my Synchronization Services Runtime Beta 1 for ADO.NET 2.0 Is Available and A Sync Services Bidirectional Test Harness posts for issues with the Beta 1 release.

Wednesday, April 11, 2007

LINQ and Entity Framework Resource Updates

Jim Wooley's LINQ articles on MSDN2 post this morning reminded me that I hadn't been updating my prior LINQ and Entity Framework resource posts as often as this rapidly-moving field justifies. Jim's post provides links to five Microsoft LINQ-related white papers that were updated in February and March 2007 to coincide with the Orcas March 2007 CTP's release. Jim's comment

I scanned over the documentation and there are a number of issues in the documentation, which is understandable considering the moving target. I do find it interesting that they leverage some language features not yet available in the current CTP, most notably VB's anonymous functions which will equate to the C# lambda expression.

surprised me because of the recent updates. Jim's reply of 4/11/2007 1:09 AM UCT in the Compiled Queries in LINQ to SQL - performance considerations and entity caching thread in the LINQ Project General forum explains some of the discrepancies in the LINQ to SQL: .NET Language-Integrated Query for Relational Data whitepaper.

I've updated the following posts this morning to add the updated white papers, as well as more recent LINQ and EF-related articles and blog items:

Update 4/12/2007: Beth Massi has posted links to sign up for the following VB-oriented "Live From Redmond: VB9" Webcasts, most of which are focused on LINQ or include LINQ-related content:

  • Orcas Overview, April 24, 2007, 9:00 AM PST. John Stallo will cover the breadth of features that you can expect to see in the upcoming release of Visual Basic. John will demo how all the features such as LINQ, n-tier, WCF support, and OCS work together to help you build your applications faster than ever before.
  • LINQ Overview, April 25, 2007, 9:00 AM PST. Kit George will explore the new LINQ features in Visual Basic. We will show how to take advantage of LINQ to build applications that query and aggregate data from multiple sources, including in-memory objects, databases, and XML.
  • LINQ to SQL & O/R Designer Deep Dive, May 2, 2007, 9:00 AM PST. Young Joo extends the SQL and LINQ web cast by showing you how to use the new OR designer to build applications that take advantage of LINQ to SQL.
  • Building N-Tier Applications, May 9, 2007, 9:00 AM PST. Young Joo will show you how you can separate business logic from data access logic using the new n-tier features in Visual Basic.
  • Offline Data Caching May 16, 2007, 9:00 AM PST. Milind Lele will demonstrate how to use SQL Server Compact Edition to build applications that can cache your data offline and have it automatically sync to your database when you are online.
  • Deep Dive into LINQ May 23, 2007, 9:00 AM PST. Amanda Silver will dive into details how the LINQ features work. In the process, we will discuss anonymous types, type inference, inline functions, extension methods, and how these features work together to give you the LINQ experience. In addition, we will demo how these features can be used independently to help you build your applications quicker and with less code.
  • Building Service-Oriented Applications May 30, 2007, 9:00 AM PST. John Stallo will show you how you can produce and consume WCF services using the new WCF support with Visual Basic and build applications that take advantage of the next-generation service architecture.
  • LINQ Best Practices June 13, 2007, 9:00 AM PST. Lisa Feigenbaum will explore best practices for writing easy to read, consumable queries, including naming, usage, and performance ideas.

All presenters are program managers on the VB Team.

Update 4/24/2007: Young Joo has posted zip files of slides from his two VS Connections 2007 presentations: VMS305: LINQ to SQL: Bringing SQL Code into Visual Studio and VMS309: Sneak Peak at Visual Studio "Orcas". VMS305 sounds to me like a preview of his LINQ to SQL & O/R Designer Deep Dive presentation.

Note: The June 6th Webcast is Using the Interop Toolkit to Migrate your VB6 Applications to .NET, which is outside the VB9 scope. For unknown reasons, the author of the presentation descriptions insists on substituting LinQ for LINQ.

There's an average of about 35 blog entries per day tagged with LINQ, so it's not easy to keep up with the new goings on. As an example, Channel9 reported on April 6, 2007:

C# team members Shon Katzenberger, Scott Wiltamuth, Todd Proebsting, Erik Meijer, Peter Hallam, Anders Hejlsberg, and Peter Sollich were recently awarded a Technical Recognition Award for Outstanding Technical Achievement for their work on the C# language. This award is particularly meaningful to the recipients as it is awarded by their technical peers. It's quite an honor.

A video segment featuring the recipients is here.

Monday, February 12, 2007

Microsoft Sync Services 1.0 Books Online CTP

Microsoft promised documentation for the Microsoft Synchronizaton Services CTP would be available in "early February" when the Occasionally Connected Services (OCS) team released the Microsoft Synchronization Services for ADO.NET v1.0 CTP (OCS-CTP) on January 22, 2007. Surprise! The OCS team posted the Microsoft Synchronization Services for ADO.NET Books Online Community Technology Preview (OCS-BOL) on February 12, 2007. The download site offers SYNCSVCSBOL-ENU.msi, the 16.7-MB installer for OCS-BOL and SyncServicesCtpSamples.exe, which generates a "Two-Tier Download-Only Sample" application. The sample app synchronizes the Adventure Works sample database's Products table with an SQL Server Compact Edition (SSCE) client database. You need the OCS-CTP, which also installs an updated SSCE v3.5 CTP, the Orcas successor to the SSCE v3.1 RTM bits, which Microsoft released on January 11, 2007. (The prerequisites are the same as those for Rafik Robeal's four OCS demo applications that I've previously described here and here, plus a current version of AdventureWorks.) The SyncComponents_Sample1 Project SyncComponents_Sample1.sln is a C# project that generates a new 276-kB SSCE 3.5 database from AdventureWorks' Customer, Employee, Product, ProductModel, ProductSubcategory, UnitMeasure, SalesOrderHeader, SalesOrderDetail, and Store tables. Synchronization is DownloadOnly, so changes only propagate from the server to the client. Here's an overview of the steps required to test the sample project:

  1. Prepare the server tables for synchronization. Execute the ServerDb_CreateSyncObjects.sql script to add InsertOriginatorID, UpdateOriginatorID and CreateDate tracking columns, a TableName_Tombstone table, and a trgDel_TableName delete trigger to each of the nine tables.
  2. Create the SSCE database and populate its tables. Build and run the project, and then click the Synchronize button. The DataGridView displays changes, not rows added for initial table population.
  3. Add insert, update and delete stored procedures. Execute the ServerDb_DMLSyncObjects.sql script to create uspProductInsertCommand, uspProductUpdateCommand, and uspProductDeleteCommand stored procedures.
  4. Make changes to the server data. Execute the stored procedures a few times to generate changes to the Product table.
  5. Synchronize the client. Click Synchronize to pull and display the server changes.

The following screen capture reflects inserting 21 rows with the uspProductInsertCommand.

This sample project won't win any awards for comprehensive coverage of Sync Services code. Unlike Rafik's demos, it doesn't support Bidirectional synchronization. On the whole, Rafik's projects provide a much better overview of Sync Services programming techniques. Tip: If you receive an unhandled exception that starts with "Table '[ProductSubCategory]' could not be created," you have an old AdventureWorks version in which the the ProductSubCategoryID had the smallint data type. The GetSchema method attempts to add it to the SSCE ProductSubCategory table as a smallint identity column, which SSCE doesn't suport. Update your AdventureWorks database from the link provided. You must delete the AWClientDB.sdf file in the \Program Files\Sync Services\Samples\SyncComponents_Sample1\SyncComponents_Sample1.Client\bin\Debug folder before you can successfully populate the client database. Technorati tags: , , , , , , , , .

Wednesday, February 07, 2007

Conflict Resolution with Sync Services

Rafik Robeal has posted the fourth Microsoft Synchroniztion Services (OCS) demo project, Offline Application—Conflict Handling, on his The Synchronizer blog. This C# project demonstrates handling Sync Services' ApplyChangesFailed event to determine the failure location (server or client) and type of concurrency conflict, and then specifying an action to ignore or resolve the conflict. Rafik's post, which augments three preceding Sync Services demo projects, describes the ApplyChangesFailedEventArgs.Conflict.ConflictType enumeration:

  • ClientInsertServerInsert also known as PK Collision; occurs when both client and server insert a row with same PK
  • ClientUpdateServerUpdate the most common conflict; occurs when client and server make changes to the same row independently
  • ClientUpdateServerDelete occurs when the client updates a row and the server independently deletes the same row
  • ClientDeleteServerUpdate occurs when the client deletes a row and the server independently updates the same row

The SyncForm has four added buttons to generate random conflicts on the client or server:

Actions available to attempt to resolve concurrency conflicts are:
  • ApplyAction.RetryApplyingRow without changing to the datarow the retry will fail causing the event to be raised again. The demo does not allow you to edit the datarow though.
  • ApplyAction.RetryWithForceWrite has support built in the ClientSyncProvider. On the server side, you need to add support in your sync adapter commands; the demo shows an example for update-update conflict.
  • ApplyAction.Continue ignores the conflict
  • Abort the sync operations by throwing an exception; all changes will be rolled back and re-synced in the next sync session.
The ConflictForm's four action buttons are enabled as appropriate for the conflict type and location:

After taking the appropriate action, the ProgressForm opens: Rafik explains that the synchronization framework defines the following two commands to find the rows in conflict:
  • SyncAdapter.SelectConflictUpdatedRowsCommand this command finds conflicting rows in the base table. The sync runtime executes this command if insert, update or delete command failed (i.e. returned 0 row count)
  • SyncAdapter.SelectConflictDeletedRowsCommand this command finds conflicting rows in the tombstone table. The sync runtime executes this command if the conflicting row was not found in the base table. This is how ClientUpdateServerDelete conflict is detected.

The two commands are implemented for the two tables—orders and order_details—by four T-SQL stored procedures on the SQL Server 2005 [Express] server.

Note: Be sure to run the demo.sql script (to the -- Test Sample comment only) to create (or recreate) the pub database and the four server-side tables (orders, order_details, orders_tombstone, and order_details_tombstone) on an SQL Server 2005 [Express] instance, then run the server_procs.sql to generate the stored procedures, and finally build and run OfflineAppDemo-Conflicts.sln. Note that the tombstone tables have a new schema to support multiple deletions of records with the same primary key.

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

Wednesday, January 31, 2007

Three Sample C# SSCE Sync Services Projects

As mentioned in my January 28, 2007 post, "Microsoft Releases Synchronization Services CTP," Rafik Robeal has posted the source code for C# demo applications that synchronize data bidirectionally between SQL Server 2005 [Express] (SS[X], server) and SQL Server 2005 Compact Edition (SSCE, client). Rafik is the primary Microsoft participant in the new Microsoft Synchronization Services for ADO.NET forum and writes MSDN's The Synchronizer blog. To build and run the three projects, you must download and install the Microsoft Synchronization Services for ADO.NET v1.0 CTP release of January 22, 2007, which installs a post-Orcas release of SSCE v3.5 and the Microsoft.Synchronization....dlls on your test machine.

The projects use simple orders and order_details tables that are empty to start. You add random rows to the two tables with buttons on a two-tab Windows form, optionally execute random updates and deletions on the SSCE client, and finally synchronize the client-side changes with the SS[X] server). Each base table has a corresponding tombstone table to track deletions.

Here's a screen capture of the main SyncForm.cs window displaying the order_details table: When you click the Synchronize button, the following window reports the results:

Following are brief descriptions of the three sample projects, each of which uses the same UI:

  • Offline AppDemo—Builder (released 1/25/2007) demonstrates basic Sync Services functionality by using the SqlSyncAdapterBuilder to generate a bidirectional SyncAdapter for each table that includes information on the base and tombstone table columns. SyncAdapters are similar to ADO.NET 2.0 TableAdapters. There's more information in Rafik's Demo I: Offline Application—SyncAdapterBuilder post and my earlier post gives some tips to get started on the right track.
  • Offiline AppDemo-T-SQL + SProc (released 1/28/2007) substitutes T-SQL queries and stored procedures executed by SqlCommand objects for the SqlSyncAdapterBuilder. Using T-SQL and SProcs provides exposes SyncAdapter code for customizing the process and gives additional insight into how SyncAdapters work. Documentation is in the Demo II: Offline Application—TSQL+SProc post.
  • Offline AppDemo—WebServices (released 1/30/2007) illustrates the N-tier approach by moving the server-side code to a Web service and wrap the client-side code to enable it to plug into the Web service's sync agent. Using a Web service complicates the installation, so be sure to read Demo III: Offline Application—WebService before attempting to build and run the project.

These three demo apps provide the basic code that you need to test two-tier and N-tier synchronization with more complex data structures. Hopfully the Sync Services documentation will arrive as promised in early February 2007.

Update 2/5/2007: Rafik provides a comparison of Sync Services with SSCE as the subscriber (client) and SQL Server 2005 Merge Replication with SQL Server 2005 as the publisher and SQL Server or SQL Express as the subscriber (Synchronization Services for ADO.NET Vs SQL Merge Replication). It would be interesting to compare a scenario with SQL Server 2005 as the publisher and SSCE as the subscriber.

Update 2/7/2007: Rafik has added a fourth OfflineAppDemo for concurrency conflict detection and resolution. See a summary with screen captures here. Get further details and download the project here. Technorati tags: , , , , , , , , .

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: , , , , , , , , , , , , , , , , .

Friday, January 12, 2007

SQL Server 2005 Compact Edition RTM Available

Microsoft delivered its Web release of SQL Server 2005 Compact Edition (SQLceSSCE) on January 11, 2006. The Web release finally eliminates previous references to Windows Mobile and SQL Server 2005 Everywhere Edition.
SSCE is a lightweight, single-user relational database engine designed for client-side data storage on Windows desktops, laptops, and devices. Its query engine supports a subset of SQL Server 2005 data types and T-SQL.
The Web release consists of the following four downloadable components:
SQLce30setupen.msi—the only file that doesn't use the SSCE abbrevation—apparently didn't need updating from the SQL Server Mobile 3.0 version.
Support: SSCE's main page is here and the newsgroup is here. There's an SQL Server Compact Edition blog and Steve Lasker's blog has links to many SSCE resources. Steve is the SQL Server Program Manager/Technical Lead for Smart Client and Occasionally Connected Systems.
Programming and Managing SSCE
The SqlServerCe namespace provides data access classes similar to ADO.NET's SqlClient. Installing the runtime also registers an OLE DB driver for applications running unmanaged code. Data files (*.sdf) are stored in the file system and are compatible with Windows Mobile 3.0 applications. SSCE 3.1 is ideally suited for Click Once installation of data-driven Windows forms apps. See my May 1, 2006 "SQL Server 2005 Mobile Edition Goes Everywhere" Special Report for an early look at SSCE. The SQL Server Management Studio [Express] SP2 December 2006 CTP or later (SSMS[X] SP2) is required to manage SSCE if you aren't running Visual Studio 2005 SP1 because the VS Express editions don't include Server Explorer. But you'll find SSMS[X] SP2 to have somewhat better management tools than VS 2005 SP1.
Note: Download SSMSX December 2006 CTP here or the full SSMS version here.
Use SSMS[X] or VS 2005 SP1's or T-SQL DDL scripts to create and modify SSSCE's *.sdf data files, which store character-based data in Unicode only. You'll need to use DDL for operations other than creating databases and adding, deleting and modifying tables.
For an in-depth look at programming SSCE with Visual Basic .NET, download a copy of SQL Server guru and author Bill Vaughn's Hitchhiker's Guide to Microsoft SQL Server 2005 Compact Edition eBook (a bargain at the US$9.95 introductory price).
Replicating SSCE
SSCE supports merge replication and Remote Data Access synchronization scenarios with SQL Server 2000 SP3 and later. The next version (3.5) of SSCE will scheduled to include a new Microsoft Synchronization Services for ADO.NET (code-named OCS for Occasionally Connected Systems) in Visual Studio Orcas. A pre-release version of SSCE v3.5 is included in the Microsoft Pre-release Software Visual Studio Code Name "Orcas" - January Community Technology Preview (CTP).
Update 1/27/2007: Microsoft released on January 22, 2007 a Microsoft Synchronization Services for ADO.NET CTP, which also includes support for SSCE LINQ to Entities.
For more details on SQL Server <-> SSCE replication technologies, see the "ADO.NET Sync Framework for Occasionally Connected Systems" post. An SQL Server Client Access License (CAL) is required for replication between SQL Server and SSCE. (SQL Server 2005 Express Edition (SSX) has the same CAL requirement for replication.)
Note: Microsoft says Virtual Server 2005 R2 SP1 is not a supported system for SSCE. This might explain my problem with installing the runtime on "virtualized Vista" but not the lack of problems with "virtualized Windows Server 2003 R2" installation.
Update 1/15/2007: Abbreviation changed from SQLce to SSCE. Google shows 124,000 hits for the SQLce and 14,000 for SSCE abbreviations, but Microsoft appears to have standardized on SSCE. SSCE is consistent with use of SSX for SQL Server Express and SSMS[X] for SQL Server Management Studio [Express].
Update 1/27/2007: Updated for OCS CTP and added links to SSMS[X] downloads.
Technorati tags: , , , , , , , , , , , , , ,