Google App Engine is a Platform as a Service (PaaS) offering that lets you build and run applications on Google’s infrastructure. Google App Engine supports apps written in a variety of programming languages, Cloudburo is using the Java implementation.
After exeperimenting with various Cloud offerings (Heroku, Cloudflare, Amazon AWS) I decided to use the Google App Engine as the primary platform for the Cloudburo App offering.
Google App Engine makes it easy to build and deploy an application that runs reliably even under heavy load and with large amounts of data. It includes the following features:
Applications run in a secure, sandboxed environment, allowing App Engine to distribute requests across multiple servers, and scaling servers to meet traffic demands. Your application runs within its own secure, reliable environment that is independent of the hardware, operating system, or physical location of the server.
Three major features of the Google App Engine, which are important for a platform supporting micro enterprises, are
As described above the infrastructure foundation layer is the Google App Engine PaaS, with the following services
Ojectify is a Java data access API specifically designed for the Google App Engine datastore. It occupies a “middle ground”; easier to use and more transparent than JDO or JPA, but significantly more convenient than the Low-Level API. Objectify is designed to make novices immediately productive yet also expose the full power of the GAE datastore. It’s a open source library (MIT License).
The Cloudburo code generator will generate entity object based on the Objectify library and will integrate to the REST API interface via the google GSON library.
Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to an equivalent Java object. Gson can work with arbitrary Java objects including pre-existing objects that you do not have source-code of. It’s a open source library (Apache License 2.0)
This is our provided utility library for a Google App Engine Java REST backend. The API specification which is implemented can be found here
http://cloudburo.github.com/docs/opensource/jsonapispec/
More Documentation can be found in Open Source section of the documentation: http://cloudburo.github.com/docs/opensource/clb-appenginebackend/
The Cloudburo App is using the UTF-8 characters which can represent every character in the Unicode character set. Server developers as well as me were confronted with the problem that the local test AppEngine instance is supporting by default UTF-8 but the cloud base production environment may not by default.
To solve that problem took some hours so it’s worth to provide some details about the issue and its solving. There are two aspects which must be considered
<head><meta charset="utf-8"></head>
.The solution is that you must call request.setCharacterEncoding("utf-8")
before you call request.getParameter(). The easiest way is with a servlet filter that
executes early. Now there are posts which claim that this is not working with appengine. Therefore the AppEngin Backend Library RestAPIServlet
will take care of that, be ensuring input request and output response are correctly setting the character set. Something like:
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException, ServletException {
req.setCharacterEncoding("UTF-8");
resp.setCharacterEncoding("UTF-8");
...