twig is awesome…

Brian M. introduced me to Twig about a week ago, and it’s awesome! I’m a long time Hibernate user. Over the years, like everyone else, I come to really appreciate the 80-90% that Hibernate does for you. Basically, the things an ORM should do. Anyway, when I got into this App-Engine world, my primary aversion was the Key-Value (NOSQL) ideas. Made me uneasy.

Thanks to Twig, that’s not as big a worry. Now you can still have direct Parent-Child mappings. At the same time, if I want, you can still use the lower-level Key mappings. Like with an ORM, I can have eager relationship loading, via the activation feature. For you truly ahead of the curve devs out there, Twig encourages creating truly asynchronous apps.

However, just like anything that makes your dev work easier, you need to use it with caution. With Twig, by default, when you load an entity, all of its relationships are eagerly loaded. Similar to Hibernate, I’d set this to a small, finite quantity. Possibly 1-3 levels deep. Also, by default, all fields are indexed. Again, don’t wait for QA or Production to configure this. I’d actually turn it off, and specify all non-Key fields that need indexing. As their documentation states, index items you know you’ll using for sort and searches.

There are other projects that can add and easier to use layer over the DataStore API. They’re definitely work a look. These include Objectify and SimpleDS, to name a few.

This entry was posted in Google App Engine, GWT. Bookmark the permalink.

2 Responses to twig is awesome…

  1. Matt says:

    Hibernate hasn’t had non-lazy loading as a default for a while now.

  2. Jay says:

    I was not clear.

    I’m saying similar to Hibernate’s Outer Join Fetching (http://tinyurl.com/28lqzuo), you should set the depth to a small finite number. Hibernate property for this is “hibernate.max_fetch_depth”. They recommend a # b/w 0 and 3.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>