Google App Engine Is Not Free Java Hosting

Let me clarify: this is not a rant about GAE: I just want to write about my first approach with it. GAE is Free, is Java and is Hosting, so why this title? Because I've read some articles talking about GAE as a solution to host Java web applications for free. But it depends on how you think to use it: if you have written an application and are searching for a solution to host it, you must keep in mind that you will need to make heavy changes to your app.

In my case, I use MeshCMS, my own CMS, to experiment with new technologies. I knew that It would have been hard since MeshCMS uses the filesystem to store pages, and GAE does not allow to write to the filesystem. I decided to redirect filesystem writes to the datastore, just like GaeVFS does. I wrote the necessary code using both JDO and JPA, and at the end I chose JPA since it seemed to produce slightly cleaner code. In my opinion, it's easier to convert from filesystem to datastore than to convert from a traditional database application to the BigTable structure used on GAE. Although you're probably going to use JPA in both cases, you will need to change entities, queries, relationships... everything.

The lesson I've learned is that maybe it's better to develop an application specifically for GAE, since it offers a bunch of services and forces you to use them: datastore, image service, memcache and so on.

But there's more to consider. As I said before, the code needed to simulate a filesystem was quite easy to write. Everything worked like a charm on the development server provided by the App Engine SDK. I was able to upload a 40MB file to my local app seamlessly. I also uploaded an 8MB image and got it served back perfectly.

I was very excited when I uploaded everything to the real thing. Then I opened the application in my browser and started waiting. It was a long wait, concluded by an error message. There were no real errors, the application was just unable to respond in a reasonable time. After a bit of usage, the app got running faster, but it was still too slow. So I begun a cycle of optimizations, especially using more and more memcache. I've seen many application run smoothly on App Engine, so it surely was a specific issue with my application.

After many optimizations, I was still unhappy, so I decided that the structure of my web application was unsuitable for GAE. I should create a specific CMS for GAE, but I don't want to. That's the reason of the title I chose for this article: be aware that GAE is Free Java Hosting for GAE apps, or at least not for all apps, even after applying the changes needed to make them compatible.

But there's a thing that still puzzles me: I was looking at a page with Firebug, when I noticed an AJAX call returning after one second. One second is acceptable for heavy tasks, but that call was simply sending a boolean value to the server using jQuery. The server was only required to save that boolean as a property of a simple entity, and then return OK or error. I really don't see how I could optimize that call. One second... I tried and again and again, no less that 900ms. It was by looking at that value that I decided to give up for now and get back to the normal version of my CMS, that requires a paid hosting but allows me to interact with my site using both the web interface and FTP, and to backup my sites using rsync.

I'll keep my GAE-specific code since things might change and it might start working faster, maybe someone can give me some precious hint, who knows. Is that you?

lzap

Feb 15, 2010 5:27 AM

Thats true. I confirm. Its very slow. But nobody is giving out free CPU hours and gigs of memory for nothing. You always have to pay. Its good for testing and not critical apps.

Vinod

Feb 15, 2010 10:02 PM

IMO instead of using DataStore for files use Amazon S3 storage. That should work much better

Thomas Joseph

Feb 15, 2010 11:44 PM

I have only used it for prototyping/demoing dummy apps... sure, I was testing the GAE. I was thinking to test it at bit more depth as you did,.. but thanks,.. you saved my energy.
I can continue to use it for demo/prototype dummy apps.

Ashutosh

Apr 3, 2010 11:20 PM

yeah s3 is a much better option then data store .

Comments are closed.

Search