This is a short account about building our web-based cloud application named Bacteria Count. The objective of Bacteria Count is to help researchers count the bacteria in bacteria culture images. But more than that Bacteria Count is a vehicle for us to try out new ideas and get to grips with cloud computing.
Using Google App Engine was the obvious choice for cloud platform. However we found that certain Java APIs that we wanted to use, namely JAI and java.awt.Image, did not run on App Engine. So we eventually settled on an architecture that used App Engine for the user interface and data management and Amazon Web Services EC2 for the image processing number crunching. Data communication between the two platforms is performed using a REST architectural style. Where messaging and queueing is appropriate we use SQS. Data is passed in JSON format in preference to XML as we find JSON easier to work with.
Whilst image analysis and data management is handled in the cloud, the actual bacteria counting is done in the browser. The user interface is written in standard Java EE using Java Servlets and Java Server Pages that generate HTML rendered in the user’s browser using CSS. Local interactivity is enhanced with JavaScript that modifies the HTML dynamically by applying data downloaded asynchronously using XMLHttpRequest to the Document Object Model. Images referenced in HTML img tags and data accessed by XMLHttpRequest are served by data access Servlets backed by App Engine Memcache. Data visualisation is performed using HTML5 Canvas.
Our prototype used an SQL database (the excellent Apache Derby) for image and data storage but SQL was not supported when we started using App Engine (Google Cloud SQL preview was announced 6 October 2011) and so we converted to the App Engine Datastore. The conversion proved to be fairly straight forward although some code had to be rewritten due to a necessary denormalization to remove joins.
To view the Bacteria Count web site the user does not need to sign in. This was seen as crucial to gain the interest of new users. For those that would like to add their own bacteria culture images, authentication is delegated to Google Accounts so that the user can sign in with their gmail account without having to register with us. For those users that have a Google Apps account we also support Google Apps Single Sign-On via Bacteria Count for Google Apps that implements the OpenID and OAuth standards.
If you have a moment we invite you to take a look at the Bacteria Count technology preview and see what we are up to. Please feel free to sign in and try adding an image. If you have any comments please let us know.
