Build Java web applications and host on Google App Engine for Free
I came to know about Google App Engine (GAE) in 2008 trying to find a host for my OpenSocial app experiment. It boast of a cloud computing architecture, so that when the traffic to your site grows, your application or site will not go down and with Google’s infrastructure, it can accommodate the high traffic.
You do not need to worry about the sudden extreme high load or load balancing for your application.
It is only half true though, read on to know why. 🙂
It sure sounds cool then, but to me the disappointment was it runs only in Python. That was in 2008.
However, there seems to be a lot of Java developers interested with having a Java version for GAE too. I wonder why?
So came the good news, although I came to know about it like a couple of months late. The Java version for GAE indeed has been made available since April 2009.
Official Google App Engine for Java : http://code.google.com/appengine/docs/java/overview.html
The site has everything you need to know and get started on Google App Engine easily, and like any other useful frameworks, they have sample applications with source code bundled together.
Download the Google App Engine SDK for Java here.
In case you would like to have a summary of GAE Java:
JVM Version
App Engine runs on Java 6 virtual machine (JVM), but supports application built on JDK 5 and later. Uses Java Servlet for applications.
Note that not all Java classes are supported but most of them are. See the JRE Class White List here.
As there are so many Java technologies and frameworks, so by default with Google App Engine Java, it basically supports a huge list of libraries and frameworks including GWT (of course), Grails, JSF, MyFaces, Spring MVC, Struts, Tapestry, Tiles and some say OSGI.
For the full list, go here.
Datastore
App Engine supports 2 standard Java interfaces: Java Data Objects (JDO) 2.3 and Java Persistence API (JPA) 1.0.
These interfaces are implemented using DataNucleus Access Platform, the open source implementation of these standards.
Access to database is via JDOQL using POJO (Plain Old Java Objects).
Other Services
Caching: http://code.google.com/appengine/docs/java/memcache/
URL Fetch : http://code.google.com/appengine/docs/java/urlfetch/
Java Mail : http://code.google.com/appengine/docs/java/mail/ (limitation of sending using Google account of the app administrator only)
Also supports application authentication using Google Accounts.
Cron Jobs : http://code.google.com/appengine/docs/java/config/cron.html
The download for GAE Java includes a development server for your computer and you can run and test your application (war file) locally before uploading it to Google server.
The uploading can also be done with its AppCfg command tool.
Do note though, you need to create your application in App Engine Administration Console first, at : https://appengine.google.com/.
Limitation of GAE Java
Knowing the features of GAE Java, you should also probably know a bit of its limitation.
1 The Java datastore interface does not support the != and IN filter operators that are implemented in the Python datastore interface. (In the Python interface, these operators are implemented in the client-side libraries as multiple datastore queries; they are not features of the datastore itself.)
2 Due to the way the App Engine datastore executes queries, a single query cannot use inequality filters (< <= >= >) on more than one property.
Quotas
While you are still excited about the free hosting and the ability to withstand sudden high load for your application, (I’m not sure about DDOS though), there is a quota for the free bandwidth and resources on your Google App Engine Java application.
“App Engine will always remain free to get started. We believe these new levels will continue to serve a reasonably efficient application around 5 million page views per month, completely free.”
So instead of sourcing for web hosting, you get a free hosting for your Java application, which is a good deal considering it’s not easy to find one and to compare them with Google’s infra?
When the need arises and your application is so popular that it gets 5 million page views per month, I guess then it is time you decide to pay for the additional resources, or port your application with funding or sell it to somebody else (or Google?).
CPU Time (billable)
Resource | Free Default Quota | Billing Enabled Quota | ||
---|---|---|---|---|
Daily Limit | Maximum Rate | Daily Limit | Maximum Rate | |
Requests | 1,300,000 requests | 7,400 requests/minute | 43,000,000 requests | 30,000 requests/minute |
Outgoing Bandwidth (billable, includes HTTPS) | 1 gigabyte | 56 megabytes/minute | 1 gigabyte free; 1,046 gigabytes maximum | 740 megabytes/minute |
Incoming Bandwidth (billable, includes HTTPS) | 1 gigabyte | 56 megabytes/minute | 1 gigabyte free; 1,046 gigabytes maximum | 740 megabytes/minute |
CPU Time (billable) | 6.5 CPU-hours | 15 CPU-minutes/minute | 6.5 CPU-hours free; 1,729 CPU-hours maximum | 72 CPU-minutes/minute |
Datastore
Resource | Free Default Quota | Billing Enabled Quota | ||
---|---|---|---|---|
Daily Limit | Maximum Rate | Daily Limit | Maximum Rate | |
Datastore API Calls | 10,000,000 calls | 57,000 calls/minute | 140,000,000 calls | 129,000 calls/minute |
Stored Data (billable) | 1 gigabyte | None | 1 gigabytes free; no maximum | None |
Data Sent to API | 12 gigabytes | 68 megabytes/minute | 72 gigabytes | 153 megabytes/minute |
Data Received from API | 115 gigabytes | 659 megabytes/minute | 695 gigabytes | 1,484 megabytes/minute |
Datastore CPU Time | 60 CPU-hours | 20 CPU-minutes/minute | 1,200 CPU-hours | 50 CPU-minutes/minute |
Resource | Free Default Quota | Billing Enabled Quota | ||
---|---|---|---|---|
Daily Limit | Maximum Rate | Daily Limit | Maximum Rate | |
Mail API Calls | 7,000 calls | 32 calls/minute | 1,700,000 calls | 4,900 calls/minute |
Recipients Emailed (billable) | 2,000 recipients | 8 recipients/minute | 2,000 recipients free; 7,400,000 recipients maximum | 5,100 recipients/minute |
Admins Emailed | 5,000 mails | 24 mails/minute | 3,000,000 mails | 9,700 mails/minute |
Message Body Data Sent | 60 megabytes | 340 kilobytes/minute | 29 gigabytes | 84 megabytes/minute |
Attachments Sent | 2,000 attachments | 8 attachments/minute | 2,900,000 attachments | 8,100 attachments/minute |
Attachment Data Sent | 100 megabytes | 560 kilobytes/minute | 100 gigabytes | 300 megabytes/minute |
URL Fetch
Resource | Free Default Quota | Billing Enabled Quota | ||
---|---|---|---|---|
Daily Limit | Maximum Rate | Daily Limit | Maximum Rate | |
UrlFetch API Calls | 657,000 calls | 3,000 calls/minute | 46,000,000 calls | 32,000 calls/minute |
UrlFetch Data Sent | 4 gigabytes | 22 megabytes/minute | 1,046 gigabytes | 740 megabytes/minute |
UrlFetch Data Received | 4 gigabytes | 22 megabytes/minute | 1,046 gigabytes | 740 megabytes/minute |
Image Manipulation
Resource | Free Default Quota | Billing Enabled Quota | ||
---|---|---|---|---|
Daily Limit | Maximum Rate | Daily Limit | Maximum Rate | |
Image Manipulation API Calls | 864,000 calls | 4,800 calls/minute | 45,000,000 calls | 31,000 calls/minute |
Data Sent to API | 1 gigabytes | 5 megabytes/minute | 560 gigabytes | 400 megabytes/minute |
Data Received from API | 5 gigabytes | 28 megabytes/minute | 427 gigabytes | 300 megabytes/minute |
Transformations executed | 2,500,000 transforms | 14,000 transforms/minute | 47,000,000 transforms | 32,000 transforms/minute |
Memcache
Resource | Free Default Quota | Billing Enabled Quota | ||
---|---|---|---|---|
Daily Limit | Maximum Rate | Daily Limit | Maximum Rate | |
Memcache API Calls | 8,600,000 | 48,000 calls/minute | 96,000,000 | 108,000 calls/minute |
Data Sent to API | 10 gigabytes | 56 megabytes/minute | 60 gigabytes | 128 megabytes/minute |
Data Received from API | 50 gigabytes | 284 megabytes/minute | 315 gigabytes | 640 megabytes/minute |
Full Quota listing viewable here.
Resources
Google App Engine : http://code.google.com/appengine/
Google Plugin for Eclipse : http://code.google.com/eclipse/
Eclipse Quick Start Guide : http://code.google.com/eclipse/docs/getting_started.html
Google App Engine FAQs : http://code.google.com/appengine/kb/
Google App Engine SDK Code : http://code.google.com/p/googleappengine/
Sample Apps Code : http://code.google.com/p/google-app-engine-samples/
Sample application and photos:
Follow me on twitter.
Google, Internet, Java, Software, Technology
Nice article.
Im interested in and spent 1hour to try it by hand
Thanks