Cloud Zone is brought to you in partnership with:

Ola Bini is a Swedish developer working for ThoughtWorks. His daily job includes working on JRuby, starting up a Swedish ThoughtWorks office and mucking around with Java and Ruby. In his spare time he spends most time on his language Ioke, working on one of several other open source projects or reading science fiction. Ola has presented at numerous conferences, such as JavaOne, Javapolis, JAOO, RailsConf, TheServerSide Java Symposium and more. He is the author of APress book Practical JRuby on Rails Ola is a DZone MVB and is not an employee of DZone and has posted 45 posts at DZone. You can read more from them at their website. View Full User Profile

Java on Google App Engine

04.08.2009
| 14638 views |
  • submit to reddit
About a year ago, Google released their first beta version of App Engine - it allowed deployment and hosting of web applications. These applications were restricted to the Python language. About 5 minutes ago, Google announced that they have released a Java version of 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/.

From http://olabini.com/blog/

Published at DZone with permission of Ola Bini, author and DZone MVB.

(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

Great news!! I don't want to learn one more programming language.

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

Is it fair to say GAE/J is a-la SAAS app wherein we can concentrate only on the business logic and all the infrastructure and common services like security, scalability, load-balancing etc are available OOTB. About the datastore is that too within the confines of GAE/J or it can reside with the subscribing client.

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

thanks for your post.perhaps you will like abercrombie ed hardy mortgage rates tiffanys ed hardy Is not it?

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.