Appengine persistence: just say no to JPA and JDO?

I have been experimenting with writing an application for the Java edition of Google Appengine, which I blogged about before. Back then, I was still trying to use JPA with the Datastore, but the longer I was trying, the more I got the feeling that JPA (and JDO)  just don’t fit Google’s Datastore very well. And then I came across Objectify and SimpleDS.

It seems that by offering JPA and JDO, Google has attempted not to alienate developers too much. But the fact of the matter remains that the Appengine Datastore (some people call it ‘a huge HashMap’) is very different from an RDBMS and we as developers best accept that fact and get on with it.

A number of projects have been started that offer an alternative to using the datastore in your API: simpleds and Objectify being amongst the most notable. SimpleDS seems to be developed by a somebody who come from a JPA/Spring background and it has nice features such as such as declarative transaction management through Spring. With Objectify, there is no out-of-the-box way to do that. Then again, it’s probably not that hard to develop a transaction manager for Objectify.

On the other hand, the documentation for Objectify seems to be more complete and it has a much more active user group. It’s tough making choices on the bleeding edge :) I have made some progress with Objectify and it was quite easy to get started. The interface of the Objectify interface looks a bit complicated and you find your self newing Key<YourEntity> objects all over the place. But, it works like a charm and is easy to write integration tests for.

Therefore, I will be evaluating both. Could both project join forces? That would probably benefit the community at large. Both projects are very much in early stages, even though Objectify has reached version 2.1 by now :)

Update: I found an interview with the 3 lead developers of Twig, Objectify and SimpleDS. Read it here.

, , ,

2 Responses to Appengine persistence: just say no to JPA and JDO?

  1. Glenn May 8, 2010 at 6:43 pm #

    It all depends on what your priorities are. If performance is more important than flexibility and you know for certain that you want your app to live in GAE, then objectify or simpleds makes sense.

    If your app should be able to live in GAE, EC2, or a more traditional data center where the data lives in a RDBMS, then JDO is worth the trouble. I go into more detail on this at http://www.dynamicalsoftware.com/java/cloud/jdo

    Yes, you can do things in JDO that GAE doesn’t support. This is no different than using non-standard SQL then attempting to move to a different RDBMS vendor.

  2. James Francis August 24, 2014 at 8:03 pm #

    Documentation of Objectify is more complete than what??? Than Google’s poor attempt at docs ? Well of course, but then if I go to the official JDO docs at Apache JDO, or DataNucleus they have all concepts perfectly well explained.

Leave a Reply