This is the first article of what will hopefully become a series on using Google App Engine (GAE) for iPhone applications. Office Combat took two of us about a year to complete. During much of that time, I worried about how to handle the synchronization of turns across two devices.
Office Combat is a two player turn based strategy game with support for taking turns offline (play by mail, essentially). I needed a way to transfer one players turn to the second players device. I really wanted to go with an email based solution like Laser Squad Nemesis, but Apple doesn’t allow that kind of access to email attachments. I also looked into Open Feint, Plus, and several platforms, but I couldn’t find a solution that would work. In the end I decided to use GAE, and I’m really glad I did.
First of all, it’s been very interesting learning about writing scalable cloud applications. I’ve learned a lot about memcache, text search, and efficient storage of data. I hope to cover many of those topics in future postings. Secondly, GAE also provided a very slick platform for determining when to send out notifications. In particular, it’s possible to cache notifications for a bit so that the user doesn’t receive too many notifications back to back. Finally, GAE provides a great place for tracking in app purchases, subscriptions, etc.
On top of all that, GAE is very cheap. The free quotas are very generous and provide more than enough computing power for most iPhone app needs. In addition, exceeding a quota results in an incremental charge, so going over by a little isn’t a big deal.
In my next posting I will provide some code snippets for getting the iPhone and GAE talking.