I’m working on a mobile app that will get data from GAE, and I’m trying to decide between using Protocol Buffers and JDO. First off, I’m not sure how to make PBs persistent. I know it’s just a matter of the annotation tags with JDO.
I also saw this thread where they warn that PB data can’t be indexed. I’m not sure if that’s a problem for me or not, though. Is there a happy medium, like a way to use JDO for persistence, but use PB for communication?
Thanks
Edit: Sounds like the initial consideration was a bad idea, but I’m still wondering if I can get the benefit of using PBs just for transmitting data to the client. Would the overhead of converting JDO objects to PB objects for transmission to the client outweigh the benefits of PBs? Actually, it sounds like that’s exactly what happens internally on GAE, anyway, so that probably means it’s a good way to go…
Coming very late to the party here, but the answer is “it depends”. 😀
JDO has the advantage that it’s extremely interoperable with Java up and down the line and it’s built right into the App Engine. For having it work right out of the box, that’s hard to beat.
Protocol buffers have the advantage of being awesomely efficient and working in a lot of languages – Java, Python, C++ are supported by Google, but there’s a huge list of other languages supported by third-parties. And they’re extensible and very easy to maintain.
As you point out, JDO objects are automatically indexed by the App Engine, it’d be hard to lose that, though you can probably build your own index quite simply.
I frankly these days use the protocol buffer language as a data definition language, but have most things sent around as JSON – they only get converted back to protos when it comes time to store them en masse and I can get huge savings…