Forward

3/26/2008

Since the inception of SQL Server CE years ago, I’ve been “encouraged” by my friend and co-author, Peter Blackburn, and Microsoft to write about the SQLCE database engine on the mobile platform. Frankly, I was not convinced. At the time, the platforms on which it could run were as numerous as the S100-bus computers in the late 70’s or the SQL Server installations 20 years ago. To make a book popular enough to make the effort worthwhile, you really need a market. Until recently, the number of mobile platforms had not really reached critical mass. Ironically, I think the introduction of the Apple iPhone has increased customer awareness of “smart” phones and is driving more customers and OEMs to Windows Mobile platforms which have far more experience and third-party software than the iPhone. But my specialty has been (and still is) Windows Forms applications. That’s where I got my start at Microsoft in ’86 and I’ve not seen a need to change—even though I own a Windows Mobile phone.

Several years ago Steve Lasker pulled me aside at a conference and asked me about a new approach for the SQLCE engine—then called “SQL Mobile”. Steve was trying to get the engine relicensed and reconfigured to run on Windows desktop applications. Steve also envisioned SQLCE as a way to cache and persist data locally in disconnected architectures. I was instantly sold on the idea and we discussed this over the next few quarters as the new engine evolved. Initially, Microsoft struggled with the name, but eventually settled on “SQL Server 2005 Compact Edition”—under considerable protest from me. While I really like the features, security and size, I didn’t (and still don’t) like the name.

One of the most important features of the SQL Server 2005 Compact engine has been its ability to act as a Subscriber in a Merge Replication scheme. That’s what Rob’s book is all about. And yes, Rob beat me to it. After I finished my 1100 page tome Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition), I started on my first EBook, Hitchhiker’s Guide to SQL Server 2005 Compact Edition. Initially, it contained a long chapter on Merge Replication, but this content was pulled, as it left so many questions unanswered. I also was encouraged to include Remote Data Access (RDA) replication, which would require considerably more research and, according to some pundits, had a troubled reputation. However, I was also informed that RDA was being phased out for some other undisclosed technology in the wings. I decided to publish the EBook without the Merge Replication content.

We’ve subsequently been introduced to yet another replication scenario: ADO.NET 3.5 Synchronization Services. As we’ll see in the Visual Studio 2008 release, this new approach more closely approximates the features of Merge Replication but does not require SQL Server as the Publisher. It can sync data to almost any Publisher. We expect it to come online for devices in the winter of 2008. Coupled with the new Data Cache technology in Visual Studio 2008, I think this approach promises to be another viable way to handle distributed data.

That said, I still think Merge Replication, and the flexibility it affords, can form the backbone of many solid application architectures—especially as Microsoft moves more toward disconnected architectures. One of its principle advantages is Merge Replication’s experience and stability. Since it’s been so widely used, developers have grown to understand and trust how it works, where it works best and how to best leverage its features. Over the years, I’ve been comfortable steering any number of customers toward this disconnected data model. I encourage all developers (mobile or desktop) to add a thorough understanding of this approach to their bag of tools, techniques and solutions which they take to their customers.

Rob’s book should give you a solid, technical foundation to get started with SQL Server 2005 Compact on the mobile platform and Merge Replication.

William R. Vaughn

Author, Mentor, Dad

Microsoft MVP

https://www.betav.com

Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)

Hitchhiker's Guide to SQL Server 2005 Compact Edition.