JavaBlog.fr / Java.lu DEVELOPMENT,GAE,Google,Java,Tools,WEB GAE: Presentation and Development with GAE (Google App Engine)

GAE: Presentation and Development with GAE (Google App Engine)

I continue with the presentation of GAE (Google App Engine). As explained in a previous post, Google proposes a cloud computing infrastructure named Google App Engine (GAE) for the hosting and running web applications. An Google email account is necessary to deploy an application to GAE. The GAE dashboard is accessible at the URL http://appengine.google.com/ with the Google account information. During the first access to the GAE dashboard, the account owner is verified via a SMS with a verification code sent to a needed valid phone number.

1) GEA and Java technologies
So, GAE allows the creation of Web applications due to standard technologies Java and to execute it on Google’s scalable architecture.
The Java environment provides a Java virtual machine 6, Java Servlet API in version 2.4, the Jetty Servlet Java container and supports the standard interfaces with data store and the scalable services like JDO, JPA, JavaMail and JCache.

But, GAE provides the standard Java API and App Engine specific API for the same task, yet, in order to deploy an application from the AppEngine to other webcontainers (Tomcat, Jetty…) it is preferable to use only the Java standard API.

Java Restrictions
GAE doesn’t support all Java classes, below, some classes, concepts which are not supported:

  • Using Swing and most AWT classes,
  • Using Threads,
  • Writing on filesystem (only the files in application are accessible in read-only mode),
  • Some “java.lang.System” actions, e.g. gc() or exit() will do nothing,
  • Calling JNI code,
  • Using reflection to access other classes outside the application and standard Java classes,
  • …etc.

For more information, see the Java Whitelist of supported JRE limited to the classes https://developers.google.com/appengine/docs/java/jrewhitelist.

More, a servlet needs also to reply within 30 seconds otherwise a “com.google.apphosting.api.DeadlineExceededException” is thrown.

Persistence

GAE provides access to databases via the following Java technologies, however, it uses Google Bigtable in the background, as distributed storage system for persisting application data:

  • JPA/Datastore: the Java Persistence API 1.0 or 2.0 (JPA) for persisting data and some features of JPA are not supported.
  • JDO: Java Data Objects (JDO) allows the access to data, via the manipulation of Plain Old Java Objects (POJO) very simply. So, the programmer can manipulate the objets regardless of the persistence.

Notes concerning the persistence:

  • There is a language named ‘GQL’ that is a SQL-like query language suitable for querying the App Engine datastore. While the functionality of the GQL differ from those of a query language for relational database standard, the GQL syntax is similar to SQL.
  • GAE dosen’t support Hibernate.
  • GAE is based on DataNucleus, a persistence library JDO. JDO provides an over-layer JPA.

Quotas

Besides being easy to use, App Engine is free! Create an account and publish an application immediately ready for use without charge or obligation. Your application has a storage space of up to 500 MB and entitles you to a monthly consultation 5 million pages, completely free. If you want to use additional resources, you simply activate the feature billing, set the daily budget you’re willing to spend, then allocate the budget to each resource type used by your applications based on their needs. You can save up to 10 applications per developer account.

Security/Authentication and Google Accounts

GAE application can use Google Accounts to perform user authentication. An application can use the Google Accounts API to detect if the user is connected, get the e-mail address of the connected user and generate URLs for login and logout.
An application can also specify access restrictions for paths URL based Google accounts, using the deployment descriptor (web.xml). The element defines a security constraint for URLs that match a pattern. If a user accesses a URL whose path has a security constraint and the user is not connected, GAE redirects the user to the login page of Google Accounts. Google Accounts redirects the user to the URL of the application once the user is connected or has open a new account. The application does nothing to ensure that only registered users can access the URL. For more information: Security and Authentication

2) GEA Administration Console
After authentication/connection to the GEA Administation Console, a dashboard “My Applications” displays the applications linked to the account:

To create a new application or service of hosting on GEA, the main informations are My Applications

  • Application Identifier: this information identifies the URL’s access of the application. For exmaple, an active application with the identifier “my-application-name” will be accessible via the URL “http://my-application-name.appspot.com”,
  • Application Title: It’s the title displayed to the users accessing to the application.

Version

GAE supportsthe version’s management and supports several versions of an application. The Admin console allows the selection of the active version. Each version can also be accessed with a specific URL. For example to test a new version, the version n°2 of an application could be accessible with the URL “http://versionnumber.2.your-name.appspot.com”.

More…

The GAE console allows:

  • logs,
  • check the cron jobs
  • datastore viewer: access to the data in application’s database:
  • permissions to manage the application via Google Account like developer, viewer, owner. It is possible to specify the administrators who will collaborate on the application. For example, in this case, the creator ozveren@gmail (YOU) is the Owner of application and we could Can invite a user to collaborate on this application as, Owner, Developer, Viewer:
  • …etc.

More information:
– GAE: http://appengine.google.com
– GAE FR: http://code.google.com/intl/fr-FR/appengine/
– Billing and Budgeting Resources: http://code.google.com/appengine/docs/billing.html

Best regards,

Huseyin OZVEREN

1 thought on “GAE: Presentation and Development with GAE (Google App Engine)”

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

Related Post