Database Replication Moves Data Efficiently Over Internet

We now have this huge computer network called the Internet and we usually think of it in terms of Web pages, but it has potential for a lot more than just providing online marketing material for us to look at. Organizations with offices across multiple locations can make use of high-speed Internet connections and replicated databases to transfer data from one place to the other, and keep one another up-to-date on what’s going on.

Replicated databases, as the name implies, are sets of data that are kept in more than one place. Since it isn’t practical to simply copy entire databases, technologies exist to keep multiple databases in sync by copying only those parts of the database that have changed. As I’ve said in past articles, at NicomIT, we work mainly with Microsoft technologies, so this article deals primarily with Microsoft SQL Server databases, although similar types of technologies are used in other database systems. Oracle, for example, offers synchronization, and there is even the capability to send data from an Oracle database to a Microsoft SQL Server databases in a replicated fashion.

We usually use what’s known as a Virtual Private Network, or VPN, running over the Internet to transmit data in replicated scenarios. A VPN can be set up on any computer and offers a secure channel, via passwords and/or data encryption, for data to flow. So you get the ease and pervasiveness of the Internet with the security of the VPN. Replicated database applications can be scaled from very simple to very complex, depending on the size and frequency of data traffic.

There are basically three types of replication: snapshot, transactional, and merged. Snapshot replication consists of simply sending a read-only copy of a database from one place to another. This would be used where periodic updates are required (say once a day or once a week) and the destination is only interested in the resultant data, not the transactions that were processed.

Transactional Replication keeps replicated databases in sync by sending every transaction from one place to the other. These may be sent in batches on a periodic basis, or done immediately. This later scenario is the most common, and requires the different locations to be always connected together.

Merged Replication is also very common, and is used where there is a centralized server and decentralized clients that are not always connected. This type of technology is similar to what you use if you have a Palm Pilot or other such PDA (personal digital assistant) that
you occasionally have to synchronize with your office computer. On occasion the clients have to be synchronized with the server, and changes made at either end are brought across to the other end. There must be rules put in place to deal with conflicts which occur when changes are made to the same record by different people.

We’re finding Merged Replication to be the most common in our client base, where multiple sites and/or agents in the field keep track of data that must be brought back to the central office, and vice-versa. One of our clients, for example, moves inventory in vans and we are setting them up so that their inventory application is available to the people in the vans, yet head office is kept up-to-date via their centralized system. Other uses we have found for replicated databases are creating subsets of data for reporting and business intelligence purposes, and for doing real-time instantaneous backups of databases in offsite locations, so that no data is lost in the case of a fire or some other disaster.

I should also note that a computer application does not have to be built with replication in mind. Replication can be retrofitted to existing applications if the need arises.

The bottom line: Replicating databases is a secure way of keeping data synchronized across multiple locations, and the network you need to send the data from one place to the other is the ubiquitous Internet.

Looking for Silverlight Books?

So am I.  I decided to at a look at some well known software development publishers to see what they have available for Silverlight books.

Apress has five titles listed for Silverlight, but as of this blog posting, all are “NOT YET PUBLISHED”.  It doesn’t look like they are offering a Silverlight 1.0 book as most titles reference specifically Silverlight 1.1.  I like Apress books and I highly recommend their “Pro” series.  I am a little disappointed in their lack of a decent Silverlight 1.0 book.

O’Reilly has three titles that are currently in print, all three at an introductory (or essentials) level.  Their “Getting Started with Silverlight” began shipping back in April 2007.  There are not many reviews listed with this title, but the average rating is five stars out of six.

SAMS has a single contribution in their “Unleashed” titles in “Silverlight 1.0 Unleashed“.  Generally speaking, their “Unleashed” series are high end, but it was only published this month and there have been no reviews posted yet.  Perhaps if you’ve read it you can post one.

Wrox has two titles currently shipping including “Silverlight 1.0” and “Silverlight 1.0 Animation”.  I’ve read a good review of the Silverlight title by Palermo4.

No doubt, the weeks ahead will see more and more titles being published on Microsoft’s Silverlight technology.  If only one can demonstrate a killer application BEYOND a media player.

AJAX Options

AJAX is still a large buzz in the industry.  For some that are just beginning to use this technology, it can be confusing to know where to start.  There are dozens of choices of technologies that will allow you to create AJAX enabled systems, but which do you choose?  Which is the “right” one?

This post will explore some the options we’ve tried as well as the pros and cons of each.

Our experiences in developing web-based applications have not been limited to developing only ASP.NET applications.  We have run the gamut of development technologies though we have standardized on two technologies in particular in the recent number of years; ASP.NET and PHP.

We looked at a number of technologies to help us implement AJAX in our web applications. The first decent package was Anthem.NET.

Anthem has an extended set of ASP.NET controls that have AJAX built right into them. For example, if you want an ASP.NET Button on your form make the post-back call through
AJAX, you can simply reference the Anthem library and change your ASP.NET Button to an Anthem Button:

From:  <asp:button id=”someId” />
To:     <anthem:button id=”someId” />

And your call back to the server-side processing will be made through AJAX.  Very easy and Anthem has extended all common ASP.NET controls including the DataGrid, DataList and Calendar controls.  Also, Anthem handles both 1.1 and 2.0 versions of ASP.NET.

A draw back to Anthem.NET is that you cannot control the order of AJAX calls to the server.  For complicated forms, the asynchronous calls can be confused and fired out of order.  Anthem is a great solution for simple systems.

Next, we looked at a Microsoft initiative, code named Atlas at the time.  Atlas was in alpha testing and it we decided not to pursue it further until the project matured.  Atlas bloomed into its 1.0 release as ASP.NET AJAX, a much leaner and production ready toolset.  I can’t help but feel that ASP.NET AJAX is the proverbial elephant gun to allow us developers to hunt rabbit. It’s a large toolset that is difficult to retrofit into an existing web application as there are a number of elements that need to be added to the project’s web.config file.  On the plus side, once it is integrated with your web application, making use of AJAX calls is as simple as adding an <UpdatePanel> to your ASPX page. Don’t forget to also add that <ScriptManager> or your calls will fail and the server will complain.  An post back thrown inside the update panel is handled through AJAX.

ASP.NET AJAX may be large, and a bit of a challenge to implement, but it is a very powerful and thorough implementation of AJAX.  Coupled with the powerful ASP.NET AJAX Control Toolkit, we are deciding to use ASP.NET AJAX more often in our web applications.

As I said earlier, not all of our web applications are based on ASP.NET.  For these systems, we have standardized on using Prototype. Prototype is an amazing JavaScript library that can be easily added to any web page by simply referencing the prototype.js file.  Doing so exposes a number of client side javaScript enhancements including an AJAX model for executing AJAX requests and handling the response.  Prototype is so helpful, that we’ve also used it in a number of ASP.NET web applications for everything from client side UI handling, wiring client side events and process AJAX requests.

We have made tremendous inroads to finding meaningful ways of integrating Prototype with ASP.NET applications to create robust web applications that offer very rich user
experiences.

Introducing Silverlight

“Using the Technology You Don’t Know About to Deliver the Systems You Never Knew You Wanted”

There’s been a buzz in the air recently about this new fangled technology from Microsoft <insert groan here>.   The buzz surrounding Microsoft Silverlight has been building over the last number of months for us in the programming community and has recently come to a head with the official release of Silverlight 1.0 only a few weeks ago.

What is Silverlight?  Silverlight is a technology specializing in delivering rich Internet applications (RIA, another buzz word you may have heard with the whole web 2.0) using a cross-browser, cross-platform plug-in.  In other words, it’s a fancy new do-hickey for your web browser that will give you access to some really cool new web sites.

Web sites offering Silverlight content are able to deliver a fully customized user interface with support for embedded audio and video.  Many big companies have begun deploying Silverlight enabled web sites including the WWE, Entertainment Tonight, Home Shopping Network, MajorLeague Baseball, and the DiscoveryChannel.

One of the great aspects of Silverlight 1.0 is that any web site can take advantage of the technology independent of the web server platform or technology supported.  So, if you have a PHP application running on an Apache web server with a MySQL database,
no problem.  If you want a web site that delivers a full on multimedia interface with protected, encoded media files, again… with Silverlight, it’s no problem.

Part of the magic of Silverlight 1.0 is the fact that it is 100% client-side scripted using the Silverlight JavaScript toolkit.  This powerful toolkit supports Firefox, Internet Explorer and Opera on Windows, Macintosh and Linux computers and Safari on the Macintosh platform and Konqueror on Linux.   It truly is cross browser and cross platform.

What does the future hold for this budding new technology?  Silverlight 1.1 is already in the works set for a 2008 release.  This next version will extend Silverlight to make it tightly integrate with Microsoft’s ASP.NET web application platform.  This will allow developers to deliver even more powerful web-based applications where the only limit is the developer’s own imagination. Visit http://silverlight.net/ for more information.