Java on Google App Engine
I have been involved in this for a few weeks - since ThoughtWorks is a Google Enterprise Partner - and it’s been a very interesting time. This post and a few others will take a closer look at what I’ve been experimenting with.
First of all, GAE/J is not based on Dalvik, as far as I can tell. It is a full Java implementation, so you compile your applications locally, using any standard JDK and then upload them. Google recommends Java 6 for this, but Java 5 works too.
The actual interface to GAE/J uses the standard Java Servlet API, so if you have something that works with it, chances are you won’t have to do many changes to your application.
Google also gives access to several different APIs, including the User service, Memcache service, Mail service, URL fetching service, Image service and DataStore service. These all give access to different pieces of the Google machinery. For me, the most interesting parts were the User service, that makes it possible to use the regular Google authentication infrastructure, and the DataStore service that makes it a snap to use Googles data storage infrastructure. For regular Java applications, you can use either JDO or JPA to interact with the DataStore, but Google also gives access to the low level APIs too.
As part of the GAE/J release, you get access to a local development server. It tries to mimic the full environment as closely as possibly. For the specific type of application Google expects most people to write, it works very well - but if you go outside of this beaten path, many things get a bit shaky. I ended up not using it very much.
So, GAE/J is a very cool platform to target cloud applications to. Obviously Python is still a valid choice too, but the combination of apps built in Python and applications running on GAE/J seems like a very powerful choice.
ThoughtWorks has recently been spending much time in this area and we have gotten some good experience with it. We look forward to be able to work with applications for Google App Engine, written in Java, or any of the other languages supported. (If you follow todays blog posts, you will see that I’m not the only ThoughtWorker who has explored alternative languages on this platform).
My esteemed colleagues have also written up their experiences with the Java pieces of Google App Engine. You can read it here: http://paulhammant.com/blog/google-app-engine-for-java-with-rich-ruby-clients.html, http://elhumidor.blogspot.com/ and http://blog.sriramnarayan.com/.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)






Comments
Anuj Mehta replied on Wed, 2009/04/08 - 1:48am
John Denver replied on Wed, 2009/04/08 - 2:31am
@Ola this is a great post and the info rocks, thanks.
@anujmetha Python is a super easy to learn programming language than even a 5 year old kid can learn it. But it is great finally Java is supported in GAE and this open the chance to Jython, JRuby, Clojure etc.
Next language supported in GAE could be maybe Haskell or Erlang that could be very interesting.
Shai Almog replied on Wed, 2009/04/08 - 4:39am
Its greate that Google did the "right thing" by supporting JSP/Servlets, JPA and GWT. It would make moving our code to the app engine so much easier!
Now we just need to find a proper CMS that works on the APP engine and start moving our entire infrastructure. Maybe Magnolia can be adpated for that environment...
Sushant Prabhu replied on Wed, 2009/04/08 - 1:35pm
Bora Ertung replied on Thu, 2009/04/09 - 2:19am
Osvaldo Doederlein replied on Thu, 2009/04/09 - 9:12am
Barring Sun being bought by IBM, this is the most important Java-related news this years and in the last several years. A couple weeks ago we were still complaining that not only Java is still difficult to host in traditional web hosting services, but Java was also exclusded from this next-generation cloud thing (EC2, GAE).
Now we have at least two options - Google and Sun's new Sun Cloud platform. The success of Sun Cloud is still a big question mark, Sun has the expertise and technology to build teh best cloud evar, but given Sun's difficult position in the market you must cross your fingers. Anyway, Google alone is powerful enough to make Java big in the cloud.
It seems that Google has developed some significant sandboxing tech for Java hosting, the GAE/Java uses the word sandbox everywhere, but only minor specific details e.g. you can't start Threads. I bet when you submit some WAR to GAE, it will be throuhgly inspected by some kind of verifier that rejects hundreds of hosting-unfriendly practices. Runtime sandboxing would also be important, e.g. to control each application's esource quotas (CPU, memory) and to prevent any interference.
With the number of Java hotshots that Google hired (remarkably ex-Sun people), I won't be surprised if they have their own JavaSE -compatible VM with a load of interesting enhancements. Isolates anyone? Hey, I just googled for Grzegorz Czajkowski and he is working at Google's "Systems Infrastructure Team"... why I'm NOT surprised??
Bas Zero replied on Tue, 2009/04/21 - 10:02am
also check out this article about Seam on Google App Engine:
http://ctpjava.blogspot.com/2009/04/jboss-seam-on-google-app-engine-first.html
jiji530 (not verified) replied on Tue, 2009/06/30 - 12:13am
Sirikant Noori replied on Fri, 2012/03/30 - 12:51pm
I enjoyed your post
Standart Java technologies can be used to create the web applications, along with App Engine. You could also make them run at the scalable infrastructure of Google. Java environment facilitates the Java Servletes interface, Java 6 JVM and many other supports for sake of the standard interfaces to provife JAP, JDO or JCache etc. Application is easily depolyed by the standard support.
Thanks. Hope my words also add some contribution
Java Exam