Thursday, April 30, 2009

Late to the Party: Google App Engine

One thing I always meant to try out was the Google App Engine. Now that I have a bit of time on my hands, I thought it would be an excellent time to give it a go.

If you're not familiar with GAE, it launched quite a while ago with solely Python support. Recently they added experimental Java support, with mixed feelings from Simon Phipps. I wasn't interested in the Java support -- I wanted the Python!

For a simple test case I wrote a twitter spammer -- it will ping my twitter account every time I write a new blog post. This will hopefully encourage traffic to my blog, and will hopefully be complex enough to let me try out all the main features of GAE.

One of the things I enjoyed most was the persistence model. Instead of having to define a database structure to accompany your objects, you just define your object with appropriate database strings. Your object is magically persisted when you go object.put().

Another thing I enjoyed was the templating. While the example starts you off by manually writing data out into the response, it's fairly easy to start using a template, and not that much more complex to start automatically creating things like forms.

The thing is though that these features are both provided by Django (well, the persistence model is more inspired by it). Given that the two main features I like aren't really features of GAE, what does it have going for it?

It's free
The most compelling reason to use GAE is that it's free and always available. Instead of having to pay for hosting for your Python (or Java) app, you get to run it on Google's hardware (until your app becomes too popular, when you'll have to start paying).

It has elegant cron
Cron jobs aren't really that difficult to set up in Unix, but Google's implementation is particularly elegant. You define a URL to hit, and then specify your cron pattern. I really like how they used a regular URL to implement this rather than making you define a script you want to run -- it's simple, and it works.

It's Google

Not much of a reason, I know, but while I had heard of Django I never got around to using it. GAE got me to use something I had wanted to play with not by virtue of the technology, but by its brandname. Who knows what else I'll come across in the course of developing my app that I wouldn't normally.


If you haven't had a chance to give it a whirl, I'd recommend you give it a try. Let me know what you think of the Java support.

No comments: