Warning
This page is located in archive.

Google datastore and JDO

Google datastore

Google datstore is schema-less database based on Bigtable - all data are stored in one big table as key-value pairs. You can choose from two types of datastore (Master-slave and High replication) when you are creating new application. It is highly recommended to use High replication datastore. More information about difference between the two types of datastore can be found here.

You can work with the datastore using an low level API. The API is proprietary, if you will use it your application can run only on the Google AppEngine.

Another possibility is to use standardized data API. JDO (Java Data Objects) and JPA (Java Persistence Api) are available. JDO seems to be more supported on AppEngine. Information how to use JDO on AppEngine can be found here. Information about JPA is here.

Exercise

Download this project for Eclipse containing a simple guest book. There is DatastoreServlet using the low level API and JDOServlet using JDO. To switch the processing to the JDOServlet you need to edit the web.xml file.

In the project UserService allowing login with google account and retrieving information about the loged user is used. Mor information about the UserService can be found here.

After studying the project try to add new functionality:

  1. Add button to delete all messages
  2. Add buttons or links to delete each individual messages
  3. Provide access to the new functionality only to administrator
  4. Add possibility to react on a message. The reaction will be displayed as indented under the message it is reacting on.

Solved Exercise

You can download the solved exercise here.

courses/a4m39wa2/tutorials/03/start.txt · Last modified: 2014/12/03 13:36 (external edit)