Wednesday, July 6, 2011

Google App Engine Frameworks: Twig vs Objectify

What is Google App Engine?
If you're new to the whole Google App thing, you're probably wondering what Google App Engine (GAE) is.  In newbie terms its Google's cloud computing offering.  If you're about to create your own start up or have a pet project you want to begin on the cheap, Google offers a way of hosting your application for free (to a certain limit).  Other companies to offer such services include Amazon (EC2) and Microsoft (Azure).

I started looking at Google App Engine first, because I was developing an application using Google's Web Toolkit (GWT).   Originally I was going to use a NoSQL graph database at the backend, but then I ran in to problems when I wanted to host my application.  The original reason why I didn't choose GAE was because of the complicated code that had to be used for the datastore and the somewhat steep learning curve Bigtable (Google's database system) seemed to be.  You only need to look at the amount of documentation there is for Java Data Objects (JDO) and Java Persistence API (JPA) in the Google documentation to see why.

An easier way to understand use Google's datastore
Then I came across Twig, Objectify and Slim3 under Frameworks for Modelling and Persisting Data.  These frameworks made it easier to understand how to use Google's datastore because of the more 'sql-like' commands of 'put', 'update', 'delete' etc.  The only challenge now was to choose a framework.

Twig vs Objectify
Unfortunately I didn't find an article on comparing Slim3 to Twig and Objectify.  I did however find this great interview on the lead developers of Objectify, Twig and SimpleDS (another datastore framework). The questions and style of the interview makes it very easy to understand the benefits and disadvantages of the different frameworks.  If you want to skip all the talk, there is a summary of the feature sets on this link.  My opinion is that if you're looking for quick way to create a spike for your application, use Objectify.  Their documentation is good and the list of interfaces is small, making it easier to understand. If however you want more control over the datastore and richer feature set, choose Twig.  Twig is the only one of the 3 frameworks that offer parallel asynchronous queries and support for polymorphism.  At the end of the day choose what's appropriate for your purposes.  The one thing that all the lead developers agreed on, is that whichever framework you choose, its going to be a whole lot easier than JDO/JPA.

1 comment: