Google app engine first impressions

Server management is a bit of a pain in the ass. Really... if you're developing a large website that can really be a problem. You have to buy a lot more than you need for the startup, configure server, configure mail server, add more servers, add a load balancer etc...

I really like the ideea of cloud hosting, excpecially the fact that you only pay for what you use.

Google launched the app engine in 2008, and I thought it would be a good time for me to start a python project and try it out, so I made my personal website in django and hosted it on app engine.

"Damn it's nice !" is my first impresion of app engine.

App engine it not perfect, it has a lot of advantages but also a lot of restrictions and a bit of a learning curve. Here are a few things.

Cool things about GAE :

- Google takes care of abolutly everything that has to do with server configuration, scaling the application, mail servers etc... You can just focus on development.

- You only pay for what you use and the really nice thing you have a free quota : 6.5 Cpu hours/day, Bandwidth 1Gb/day, 2000 emails/day. (really like the word 'free'). This should be engough for any startup project and if you're project is successful you dont' have to worry about servers, you just have to pay some money. Google estimates about 5 million pageviews for a well optimised site.

- When you launch a new update you can set a version number. The versions are tracked and saved on GAE. You have a default version witch is run when you access the website but all the other versions cand be accessed on a different url and made default.

How does this help ? Think about it... You can upload a version that has some enhancements, test it on the server then make it the default version. Let's say after two days you notice a bug... piece of cake, just make the previous version the default and fix the bugs when you have time.
the database is the same, so version tracking and storing does not apply to the database.

- You develop on the app server and then use a script (appcfg.py) to upload the files. You can also download or upload the database just by writing a command line.

- For django there are two popular patches to make it work on app engine.

- You get billed at the end of the week :)) so you have a few days to gather the $$ for paying the bill.

Things that are not that so nice:

- The filesystem is read only. You don't have ftp access, all the uploads are made using appcfg.py. User input images/files should be kept in the database.

- There is no sql. You have to use google datastore, witch is a non relational database. The datastore has a sql like query language, but you have to get used to the nosql way of thinking. For optimization porposes the database also has some restrictions :

  • - will not return more than 1000 results
  • - cand't do <> on a field
  • - don't have group by and count

- There is a bit of a learnig curve.

- You can't put images in the datastore larger than 1 mb. For larger files you have to use the blob store.

- If you want to resize user images that are larger than 1 mb you have to put it in the blobstore and then use the image resize library to resize it and put it in the datastore.

- GAE has it's own particular way of doing things, if you will wont to move to a different hosting then you will have to refactor almost all of your code.

- Everything resource is being closely monitored so it's not a place for lasy coders to write stupid code.

- Porcesses can't run for more that 30 seconds.