Over a million developers have joined DZone.

Moving an existing Grails Application to Google Appengine

· Java Zone

Discover how AppDynamics steps in to upgrade your performance game and prevent your enterprise from these top 10 Java performance problems, brought to you in partnership with AppDynamics.

Recently I wanted to move a simple Grails application to Google App Engine(GAE). It was quite an effort to do that. This effort varies from application to application.  For a simple website which is more or less static its a breeze, there are grails plugins (http://grails.org/plugin/app-engine) available which helps us to migrate to google app engine. The main problem is the moving the underlying database schema to google app engine. This writeup discusses the kind of Grails applications that are suitable to be migrated to google app engine and there by discussing the problems/challenges that one may encounter.

What kind of Grails Applications are  easily migratable / Possible  constraints for existing applications ?

The apps in which the database schema is simple and where there is not much of data migration is required.

When migrating Grails app to GAE, We most often end up choosing JPA.

The migraion of existing relational data  to GAE Appstore is also not trivial. In my application there was a grails domain object which has 31,100 odd records in database. I tried to extract the data from mySql to a csv file and tried to read each record and save to datastore. This is a tame idea though. There was an CancellationException which was caused due to the request was taking more than 30 seconds. GAE also doesnot allow creation of threads by. I figured that there is a bulkloader tool provided by app engine which is in python. This can do the trick. But its not that straight forward. GAE can improve on this and can simplify tooling for bulk loading for all laguages that it supports.

Existing job framework could be rework

If your Grails app used Quartz plugin to  execute some Jobs then during migration to GAE it should be replaced by the GAE job engine. This is a rework as GAE doesnt allow creation of threads by the app. We ought to use the GAE job only.


Conclusion :

A simple grails application can be easily be migrated to app engine with lesss efort. If database schema is complex there will be problems refactoring the existing controller code.

 

The Java Zone is brought to you in partnership with AppDynamics. AppDynamics helps you gain the fundamentals behind application performance, and implement best practices so you can proactively analyze and act on performance problems as they arise, and more specifically with your Java applications. Start a Free Trial.

Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}