AppEngine: First Impressions

I’ve been developing a small app using Google’s AppEngine. My first impression is that developing in the sandboxed python environment forces you to KISS. The SDK makes things dead simple in terms of templating, data access, and controlling which scripts map to which urls.

The side affect of abstracting the data access layer is that I no longer have to spend much time with database schema. That’s because AppEngine doesn’t run a traditional relational database and doesn’t allow you to run traditional SQL against the data store. I end up writing horribly un-optimized ‘queries’ because I’m not able to write highly optimized SQL queries. The SDK is obviously geared to take full advantage of the instant look up and high throughput that BigTable excels at.

For example, for these 2 objects:

class Attribute(db.Model):
  author = db.UserProperty()
  content = db.StringProperty(multiline=True)
  date = db.DateTimeProperty(auto_now_add=True)

class UserAttribute(db.Model):
  attribute_key = db.ReferenceProperty(Attribute)
  user = db.UserProperty()
  date = db.DateTimeProperty(auto_now_add=True)

I can access all the Attributes that belong to the User with the following code:

    query = db.Query(UserAttribute)
    user_attributes = query.filter('user =', \
      users.get_current_user())
    attributes = [ua.attribute_key for ua in user_attributes]

I’ll keep updating as I dig into the SDK.

  • http://georgechen.com George

    Can you tell us what app it is you are writing? Something web 3.0?