Saturday, May 31, 2008

Google App Engine

I just went through the GOOGLE APP ENGINE "Getting Started" guide. Neat stuff.

http://code.google.com/appengine/docs/gettingstarted/

The runtime is Python, which I haven't used before. I installed python, then just used notepad to write the code.

The fun thing about python is that spacing counts. You block code by tabbing them out the same distance.

Google currently allows everyone to have 3 applications online, while they're still in preview mode. Througout the guide, it mentions how you can use any python library for doing different types of things, but it comes with "Django" stuff already bundled. IE: Templates. (In asp.net world, a template is a master page)

The benefit of using the google app engine is that it has a bunch of stuff built in, such as a datastore. The data store is not a relational database, though they expose a GQL language, which is very sql like.

greetings = db.GqlQuery("SELECT * FROM Greeting ORDER BY date DESC LIMIT 10")

You can also do it programtically.

greetings = Greeting.all()
greetings.filter("author =", users.get_current_user())
greetings.order("-date")

You never actually have to create any data store objects to hold your data. That happens automatically when you save stuff. It looks to be an object database. Once you save an object of type GREETING, then you use GQL to query for types of GREETING. (I wonder what will happen as you modify GREETING)

I'm definitely not a python guy, but it was fun to play with the language a little bit. Google App Engine is trying to make development/hosting a lot faster. The SDK gives you everything you need to get started (local web server and data store), and deploying the application to production is a snap... you just execute a python script that takes care of it for you. The setup is minimal. Everything pretty much works right out of the box.

No comments: