Finally, I can talk about one of the cooler things to come out of Google in a while: Google App Engine. App Engine is an application hosting service at Google, where you can write apps in python using a very simple but powerful framework, and run them on Google’s scalable infrastructure.
I got the chance to develop a demo application which was included in the initial launch, called ToDone. ToDone is a simple todo list application modeled after the hipster PDA I’ve used for the past couple years to manage my GTD lists. The two things I really like about my hipster PDA are that it’s super simple(it doesn’t have unneeded features like priorities or due dates or colors), and that I can view as many lists as I want at a time by spreading my cards out on the table. I wanted to capture these qualities in ToDone.
Implementing ToDone using the App Engine APIs turned out to be really fun. First and foremost, I love development environments that have a short iteration cycle. App Engine’s cycle is as simple as reloading the browser - the development server that runs on your local machine picks up changes to your python instantly. A huge change from my normal development environment, which often involves multi-minute compiles and restarts (don’t ask).
Additionally, the datastore api is a dead simple object relational mapper, which you query using GQL (a restricted version of SQL), getting back objects with properties that are defined in your python code. I only had two objects for ToDone - TaskLists and Tasks, so setting up the persistence layer took maybe a grand total of an hour, including reading the documentation and understanding how it all fit together. The development server even automatically figured out what indexes needed to be created to optimize my queries.
The rest of the framework was pretty standard - I used wsgiref handlers for dispatching and django templates for presentation, which, while apparently standard in the Python community, were new to me. I found both pretty similar to other comparable technologies, and generally pleasant to use.
I think the best part of the whole experience was pushing my code into production. Pushing my code out is really as simple as:
appcfg.py update todone/
That’s it. That single command bundles up all my code, pushes it into production, and updates the database schema and indexes, all in a matter of seconds. Nothing more. So much better than uploading code to servers by hand, massaging database schemas, migrating data, and trying not to break anything.
There’s still some areas that are rough around the edges. For instance, there’s currently no way to run cron jobs. While I believe this is on the todo list for the team, the current recommendation is to run a cron job on your own machine which hits a private url to kick off whatever work needs to be done for your app.
Be sure to check out the other demo applications that other Googlers wrote in the Application Gallery. There’s some far more awesome applications than ToDone in there.