Thursday, November 25, 2010

Programming in Cloud using Goolge App Engine

It is pretty much agreed in the industry that there are three major varieties of cloud computing: software-as-a-service (SaaS), platform-as-a-service (PaaS) and infrastructure-as-a-service (IaaS). So when I decided to get my hands dirty (with the PaaS) by developing and deploying an application on the cloud, my preferred options were Amazon, Google and SalesForce.

Serious thought led me to Google App Engine for the following reasons

We will give you a Virtual Machine of any configuration   with which you can do anything you wish - this approach proposed by Amazon sounds good; but  it can  turn out to be a lot  more tricky and complicated for the first timer like me, who wants to have a feel of cloud development  with out serious commitment. So I decided to check  out  Amazon's path latter.

Learn our proprietary language and realize high productivity as much of application development can be accomplished without programming - this approach proposed by Force.com, kindled my  interest; but still  had  a few lingering questions:  why should I learn one more way to do the same thing ?. Can I not reap the benefit based on what I know already?. Should I lock myself with this vendor? Plus having seen the benefit of all those open source re-usable libraries which has helped me to concentrate on the business logic for years, I was reluctant to select the option of Force.com.

With both Amazon and SaleForce out of my way, I decided  to check Google App Engine which provides me the following benefits: First I can program in Java and I don’t have to learn another language. Second, my web application will be portable  which can be hosted on any Java EE server, as they provide a subset of Java EE standards. Three, it's absolutely free : no charge and with no commitment.  The big catch is however if you decide to use  services  like authentication, scheduler etc (provided by Google) and later want to move away from Google infrastructure, additional efforts will be needed.

My intention was not to build a unique world class web application with load balancing and clustering in place, but to find out for one self how flexible and simple it will be to build and deploy  applications on the Google platform while utilizing needed standard services provided by Google.  So decided to build a  simple reminder web application.  Here a scheduler will  be run every day  which will  compare, what you have entered as the events and dates for various tasks with current system date and notify the user through email about the upcoming events which needs attention. Of course only user with proper permission should be able to see his  or her upcoming task as well as add/delete task list.

As I have already a Google Account (if you own @gmail.com email id, you too have one!!),  I registered my application at https://appengine.google.com/   by providing a unique application Identifier and received an acknowledgment as well as the ‘registered ID’ from Google through a SMS (You need a phone, which can receive SMS or else good luck!!, as it seems a mandatory requirement for now. This might change in the coming months).


As the first step download and installed the Java SE Development Kit (JDK) and Eclipse Galileo as well as the Google plugin using the Software Update feature of Eclipse. The installation location is http://dl.google.com/eclipse/plugin/3.5 . This provided me the 2 important features : New  wizards to create App Engine web app  project and a tools to deploy/upload the developed web app in the Google platform with a click of a button .

Once I had the necessary software on my local machine, developed the web application like what I do often during my normal application development including configuring web.xml in the war/WEB-INF/ directory.  The application made use of Google user authication service, email service and scheduler service along with App Engine datastore.

Only additional work that needs to addressed for the app engine was the configuration of war/WEB-INF/appengine-web.xml, with the ‘registered ID’ and version information of the application.

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application> registered ID </application>
    <version>1</version>
</appengine-web-app>

Once development is completed,  selected the RUN command from the menu to execute the application using the built in server  which simulates the App Engine environment and services, including the data store, and the login services. 

After completing the local testing, uploaded the application from Eclipse by clicking the App Engine deploy button on the toolbar, which prompts for my Gmail id and password before publishing the app in the Google platform - the very same infrastructure in which Googl’s Gmail also runs.

This article glossed over few of the details of making a basic application, so if you feel you need more technical development information, make sure you go through the complete official tutorial http://code.google.com/appengine/docs/whatisgoogleappengine.html and the video at http://www.youtube.com/watch?v=bfgO-LXGpTM 

Google has to prove itself worthy of business to the world. It has made baby steps into the corporate world with Google Apps and Google Docs. And I am pretty sure that in the months to come, Google App Engine will significantly change the way applications are delivered, managed and integrated. And with Microsoft also pushing hard on Azure, it is sure  that we will see good competition and see the rapid adoption of PaaS in corporate world which is currently dominated by SaaS and IaaS  The next two years will decide who will have the laurel.

No comments:

Post a Comment