Overview of Java support in Google App Engine


Google App Engine now supports Java. This posting provides a high level overview of Google App Engine for Java.

gae-1

1.    What is Google App Engine?

Google App Engine is offered as a Platform as a Service (PaaS) where one can develop applications and run it in Google’s infrastructure. The value proposition is the easy implementation, no servers to maintain, easy to scale and easy maintenance.

2.    Services

Google App Engine now supports Java 1.6 and 1.5 and exposes several services via Java API which are listed below:

a.    URL Fetch Service

  • Access data over Internet: Provides the ability for applications to fetch resources and communicate with other hosts over the internet using HTTP and HTTPS requests.
  • Access data behind your Corporate Firewall: Is made possible using Google Secure Data Connector (SDC) service. Basically SDC enables data encryption exchanged between Google Apps domain or your application running on Google App Engine and your corporate network by wrapping the data in socks protocol and encrypting it.

b.    Mail Service

Provides the ability for applications to send email messages using Java Mail API on behalf of application’ administrator or as users with Google accounts.

c.    Cache Service

A distributed in-memory data cache exposed as Memcache API by implementing JCache.

d.    Image Manipulation Service

This service provides the ability to manipulate image data such as resize images or rotate, flip, and crop images. It can also enhance photographs using a predefined algorithm.

e.    Task Scheduling (Cron) Service

Allows you to configure regularly scheduled tasks that operate at defined times or regular intervals.

f.    Google Account Service

Integration between Google App Engine and this account service is an optional feature in App Engine. This service enables an application to authenticate users with Google Accounts.

3.    Persisting Data

App Engine exposes access to the data store via JDO and JPA implemented by the open source Data Nucleus Access platform.

4.    Development and tooling

The App Engine software development kits (SDK) for Java includes the following:

  • A web application and a web server that emulates all App Engine services on your local development machine.
  • The SDK includes all the APIs and libraries available on App Engine.
  • The SDK includes support to upload your application to App Engine.
  • Eclipse IDE is supported for developing App Engine applications through Google Plugin for Eclipse.

5.    Logging

Applications can write information to the log files using java.util.logging.Logger. Log data for an application can be viewed and analyzed using the Administration Console, or downloaded using appcfg.sh request_logs.

6.    Configuration and Deployment

  • Configuration files include the standard Java Web Deployment descriptor web.xml, an App Engine specific file called appengine-web.xml that contains the deployment and execution details of the application.
  • Then upload the application using App Engine Admin console or Eclipse or through command prompt.
  • Register the application using Admin Console (requires Google Account) and specify a  id for your application
  • If you use the free domain appspot.com then the access URL for your application would be app-id.appspot.com

7.    Quotas and Limits

An App Engine application can consume resources up to certain maximums, or quotas. With quotas, App Engine ensures that your application won’t exceed your budget, and that other applications running on App Engine won’t impact the performance of your app. A sample quota for HTTP(s) request is shown below (image courtesy: Google). Quotas are applicable to various other requests such as to data store, email messages and their details are available here. There are some things that you cannot do using the Java API for Google App Engine listed here.

google quotas