Java App Engine DatastoreService or PersistenceManager?

Work on a GAE-based application in java. Failed to find out if I want to use DatastoreServices and Entity class, or create a class for my objects and use PersistenceManager.

Can someone explain the differences between the two services?

+4
source share
2 answers

If you have no fixed reason to use any of these, see Objectify . This is a much better and more convenient storage library.

Datastore services from the SDK are low-level services that allow you to talk directly to Bigtable RPC. You will write code that converts to the Bigtable data format and API, and calling Bigtable RPC methods.

The JDO specification and its persistence manager are a Java standard that deals with the creation of data classes and their storage and retrieval. This is one level of abstraction higher than direct data warehouse services. Google has implemented the JDO specification to work in GAE, so you can use it if you want.

Objectify is an alternative to JDO, which is not the Java standard for enterprises, but much easier and more fun to use. It follows the Python API close enough, which makes it pretty nice and concise.

+4
source

My vote is for the DatastoreService, because the PersistenceManager (JDO) consumes more resources (= more money) and it is slower.

http://gaejava.appspot.com/ - here you can compare them. Try this test a couple of times.

+3
source

All Articles