[I gave this talk at the BayPiggies Meeting on August 14, 2008.Â The 'Newbie Nugget' talk ran about seven minutes and used only spoken words.Â This is my recollection of what I said.]
I drove here today.Â I got in my car, used the six speed manual transmission, steering wheel, and pedals.Â I had to know how to change lanes and the rules of the road.Â I needed to know traffic patterns, and directions from my house to Google.Â I got here.
It was the most dangerous thing I did today.Â Traffic accidents kill about 40,000 people a year in the U.S. alone. Â It’s the number one cause of death for everyone from age five to about my age where heart disease and cancer start catching up.Â We just take it for granted.Â Â That’s not the car I want.
I Want My Autodriving Car!Â I want to push a button on my cell phone, walk out the door a minute later, and hop into the open door of a car.Â It would take me where I want to go, take the best route given current traffic, and drop me in front of the door.Â Â It would never crash.Â It would just work.Â That’s what I want in a car.
Here’s what I want in an application engine.Â Â I want to write in one language.Â I want one set of tools.Â One naming convention.Â I want to be able to translate my thoughts into code cleanly.Â I want the application to be on the Internet and scale and to share that application with everyone through a url or something like the IPhone App Store.Â Â That’s what I want in an application server.
So, let’s talk about Google App Engine:Â what is does, how to write for it, where you would use it and not.
Google App Engine is fundamentally a deployment engine.Â After you write your application, it provides that application out on the Internet.Â It’s also very early technology.Â It sort of supports Django (‘jango’ for those who talk; ‘d-jango’ for those who read), but using the latest version runs up against its thousand file limit.Â Fully half of the seventy posts a day on the mailing list are about deployment quotas or looking for workarounds to deployment limits.Â You cannot run any long job that takes more than a few seconds.Â Still, it’s free.
Writing for Google App Engine is much like writing for any other application engine.Â You use the WSGI interface, which someone taught me is pronounced ‘whiskey’, that provides a mapping between the requested URLs and the classes to serve them.Â You write a class that has methods to respond to HTTP messages like get and put.Â Your codes spits out the HTML and whatever to respond.Â Sometimes you trigger urlfetch, from urllib, of your own application like remote procedure calls to avoid hitting computation time request limits.Â You store your data in the Google Base data store.
Google Base can be a problem.Â The Google Base datastore is not a relational database.Â It’s a great database for working data you collect from all over the web, like web pages or screen scraping, where you are working with massive amounts of data and some of it is always aging out.Â It should never be used for accounting.Â For example, you can’t just run a GBase query to update the total invoices for a month.Â You need to walk through all the records.Â If you update the date on an invoice and then retotal the invoices, you might get the wrong answer.Â GBase doesn’t guarantee the invoices index is immediately updated.Â It would probably work, but if you were to try running tests to see how often it fails you’d use up your quota and be locked out for a few days.
So where is Google App Engine the right choice?Â First, it’s free.Â Â It’s a good way of learning how to write for application servers.Â There are some good tutorials and videos and off you go.Â If your application needs a lot of bandwidth downloading from elsewhere on the internet, it’s probably a good choice.Â So if you want to try out an idea that’s not for making money, go for it.
Where is Google App Engine the wrong choice?Â If you are trying to make money, it’s right out.Â Â First, the license includes clauses that require you to indemnify Google if the API infringes patents.Â A Fortune 500 company won’t let you agree to that.Â Second, its reliability wants to get up to five nine’s (.99999) but is hovering between one and two nines.Â Third, it’s really early tech.Â You can watch lots ofÂ bugs get filed and occasionally fixed, but they are in the stage of getting it feature complete first.
In conclusion,Â I want an auto-driving car and I want my great application engine.Â Google App Engine is like getting a taxi. Â A taxi does the driving, but I still need to know directions and road conditions, and I still get into car accidents.Â Â With Google App Engine, I still need to know the whole stack of languages, my site still gets hacked, and it still goes down a lot.Â But you can see the future in Google App Engine, and it may turn into something great.
[Clarifications and follow-ups for this article got a bit long.Â I added some expansions on this blog post.]