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.

0 comments: