Get your app on the cloud with Google App Engine

I`m working on a small project that requires easy, cheap and reliable hosting for a Java web application. When searching for a good solution we ran into Google App Engine (GAE). GAE allowes you to run your Java applications on the Google Cloud.

Registering your application
You can signup for GAE via this link: http://appengine.google.com. Once you have registered you can create new applications and deploy them to your GAE space. When registering a new application you need to provide your application with a name. Once you have picked a name your application will be accessible through the following URL: your_app_name.appspot.com.

Developing Java application for GAE
If you want to develop Java application and upload them to the Google App Engine Cloud, you will have to install the App Engine SDK for Java first. You can find it here: http://code.google.com/intl/nl/appengine/downloads.html#Google_App_Engine_SDK_for_Java

JPA with App Engine
When you are in need of some data storage you can use either JDO or JPA. App Engine does not allow JDBC. Data storage is based on BigTable so there are some limitations to what you can do with JPA. Read this link if you want te get started using JPA on GAE. http://code.google.com/intl/nl/appengine/docs/java/datastore/usingjpa.html

Cavaets
You need to be aware that you application in running on a Cloud. There are some unexpected side effects because of this. When your application is idle for a period of time, the application will be taken offline to save resource. For example if you are running a Spring based Web application on GAE, the application context will be destroyed when your application is idle for longer than 2 minutes. The first request to hit your application will cause the Servlet & Spring context to be reinitialized, the request will be delayed with the reinitialization of the application. Fortunately there are work-arounds, you could schedule a cron you to do a keep-alive request on your application.

More information
If you want to learn more, see this short 10 minute demo from google on Youtube. http://www.youtube.com/watch?v=P3GT4-m_6RQ&feature=related

2 Responses to “Get your app on the cloud with Google App Engine”

  1. Jarno says:

    This is quite nice actually. It’s great to see how much effort Google is putting into making these application easy to develop and to deploy. For small-scale applications this is a great alternative to hosting applications in-house.

    I’m guessing it shouldn’t take too long for cloud computing to become much more common. Exciting development indeed.

  2. Glenn says:

    Another reason to go with JDO or JPA on GAE ( see http://www.dynamicalsoftware.com/java/cloud/jdo ) is that it doesn’t lock your app into either GAE or cloud computing at all. There are rock solid data stores for GAE, EC2, MySql, PostGreSql, MS SQL Server, Oracle, and DB2.

Leave a Reply