Thursday, October 2, 2014

Java in the Cloud: The Good Parts

And other Google cloud innovations for developers.

Google cloud Platform

Cloud allows you to iterate quickly, fail fast, low cost of entry.
Don't want to manage clustering and security. It takes teams to focus on that.

Google, amazon, heroku, pivotal cloud foundry, ms azure all support java.
Not java EE. Meant to offer services in a container. A bunch of apis, some of which don't work in a cloud, e.g websockets.
May take web profile and expand to cloud or repackage.

NoSQL DB + Memcache + stateless front instances

Focus on services. Ask for and be given instantly fully configured. E.g. DatastoreFactory.

Injection. Spring > Guice (@inject) > Dagger

Jetty 9 in Google app engine.
Since 2008.
Small footprint, scales well, modular (important).
Java EE scanning in cloud wastes resources, has latency issues, and security issues (unknown jars).

Demo.
Jetty quickstart 800ms startup vs 3secs. 500ms tweaked. Web.xml 500 lines, a lot of stuff. All discovered bits, context params, initializers, annotations and classes, tlds, listeners, servlets all pre-parsed.

Glassfish 12ms, tomcat 5sec, jetty < 1sec.

Now no longer deploying a war but rather a docker container including app and slim linux.
Add to web.xml app engine params.
Docker file is an image.
Same app in google app engine ran in 1.7sec

No comments:

Post a Comment