java technology on google app engine communityone 2009 lightning talk

Welcome to the dim corner of the library, where fools rush in and angels fear to tread!

This blog post is ancient. If it is technical, the information is likely inaccurate, or at least out of date. If it is non-technical, it’s entirely possible that the relevant facts and my own opinions have changed significantly since it was written.

It is only preserved as part of this site’s permanent historical archive.

My second lightning talk at Community One West 2009 revolved around the still relatively recent announcement that Java is now supported on Google’s App Engine.

What exactly is Google App Engine? It’s none other than a way that you can run your Java™ technology-based applications on Google’s massive infrastructure.

As far as the “Geekxecutive Summary,” Google has provided:

  • A Java 6 Virtual Machine with a Class Whitelist. Not all classes in the standard JDK library are available. A notable missing member is the java.awt.* library, so if you’re using that for image processing, find an alternative (see one later) before porting to the App Engine.

  • The Java Servlet Standard by way of the Jetty container.

  • A secured sandbox environment, meaning 1) no spawned threads; 2) no arbitrary socket connections (you can use HTTP/HTTPS, see below); 3) No writing to the local filesystem - makes sense because you don’t know where you are on any given request.

Several services are provided to you by Google as a Java developer:

  • The Datastore - a schemaless object datastore, with a query engine and atomic transactions. This is accessible via Java Data Objects (JDO) 2.3, Java Persistence API (JPA) 1.0, or Google’s own low-level API’s.

  • A Memcache service for caching whatever objects you like, accessible via JCache JSR 107.

  • A URL fetch service for accessing data on other systems, accessible via

  • A Mail (JavaMail) service.

  • An Image processing service, a likely candidate for replacing AWT for image processing. Be careful, it binds you to Google’s services. You may want to write a wrapper for it.

  • Google Accounts for authentication. Should you leverage this, anyone with a Google account can authenticate into your app.

The nice thing about Google’s services is that where possible they always provided a way in through standards-based Java API’s.

Now, on to tools:

Probably the most significant piece to this puzzle is the fact that Google is not simply supporting Java the language, but Java the platform. It’s a standard JVM, so other languages running on the JVM will happily run on Google App Engine as well. At this writing, I knew of the following languages that are known to run:

  • Java

  • Groovy (and Grails as of 1.1.1)

  • JRuby

  • Scala

  • Clojure

  • Beanshell

  • JavaScript (Rhino)

  • Jython

Here’s the screencast from my talk. Enjoy!