Grails on Google App Engine – Part 5: Conclusion
October 17, 2010 at 5:12 pm | Posted in GAE, Grails, Groovy, Java, Web | 4 CommentsTags: Big Table, cloud, Engine, GAE, GAE/J, Google, Grails, Groovy, JDO
Thanks to the App Engine plugin you can get Grails running on App Engine. Yeah, you got your favorite web application framework deployed on the cloud. But wait…there’s a problem. Grails comes with a lot of libraries that are bundled with the framework. You got Spring, Hibernate, Sitemesh and all the other libraries you added to your application. This is how we’re used to build applications. However, building applications for Google App Engine is different. The platform puts your application into sleep mode when you don’t get enough traffic. This is understandable from Google’s view on scalability but not from a software developer standpoint. Calling the application after a period of no usage will reinitialize your classes, Spring application contexts and libraries. If the application cannot serve the request within 30 seconds the user will get a com.google.apphosting.api.DeadlineExceededException. The cold startup time will even be longer the bigger your WAR file is and the more libraries you use. This gets extremely painful with Grails. Sometimes you have to call your application three times in a row, run into an initialization error and try again until Grails can serve your request. Google was talking about “reserved instances” that would not put your application into sleep mode for paying customers. However, this has not been realized yet. The GAE/J forum is full of frustrated users complaining about this issue. You can work around the cold startup time by setting up a cron job in cron.xml that pings your application every minute. From an architectural view this not only is unnecessary and useless traffic for your application it also will not fully solve the problem. I still ran into issues with requests that couldn’t finish with the deadline time period.
<?xml version="1.0" encoding="UTF-8"?>
<cronentries>
<cron>
<url>/user/ping</url>
<description>Keep the app alive by ping every 1 minutes</description>
<schedule>every 1 minutes</schedule>
</cron>
</cronentries>
Clearly, App Engine calls for a lightweight application framework until the cold startup issues have been resolved by Google in some sort of form. This puts Grails out of the running as a production-ready framework on App Engine. No company can afford exceptions being thrown on paying customers. This is not an issue solely to Grails. I am sure the startup times for full-fledged Spring applications on App Engine are not extremely better. An alternative for a Groovy-based web framework can be seen in Gaelyk. Gaelyk is not as feature-rich as Grails but will give you the benefit of faster startup times. Implementing non-trivial web applications with Gaeylk can be painful to develop because it’s not as feature-rich as Grails is. I guess in the end there’s always a tradeoff.
- Grails on Google App Engine – Part 1: A Case Study
- Grails on Google App Engine – Part 2: Project Setup
- Grails on Google App Engine – Part 3: Persistence
- Grails on Google App Engine – Part 4: Third-Party Libraries
4 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a Reply
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.

[...] Grails on Google App Engine – Part 5: Conclusion Possibly related posts: (automatically generated)Everything We Know So Far About Amazon’s Android App Store [...]
Pingback by Grails on Google App Engine – Part 1: A Case Study « Global Gateway— October 17, 2010 #
[...] Grails on Google App Engine – Part 5: Conclusion [...]
Pingback by Grails on Google App Engine – Part 4: Third-Party Libraries « Global Gateway— October 17, 2010 #
Thank you very much for this great tutorial.
I have one question : do you know which grails plugins are not compatible with GAE?
Because I’ve heard that many plugins cannot work with App Engine and I just can’t live without some plugins (Searchable, Shiro, REST, App-Info…)
Comment by Fabien7474— February 5, 2011 #
I don’t have a concrete list of plugins that will work on App Engine. Every plugin that only uses classes of the whitelist should work. Plugins that depend on Hibernate will definitely not work e.g. App-Info. The searchable plugin won’t work because Lucene is not supported on App Engine. Personally, I haven’t used any plugin on App Engine. My guess is that only a limited amount of the plugins will work.
Comment by Ben— February 5, 2011 #