Google App Engine Java style Peter Sönnergren Lind GTUG Stockholm 2010-01-14
whoami Java dev since like 1999 Ruby enthusiast Consultant @ Devoteam Quaint Owner and CTO @ Pockus A book club that doesn't suck http://www.pockus.se
App Engine 101 Googles Cloud offering Run your web apps on Google's infrastructure Platform As A Service Unique Selling Point - Scalability on demand Instances are added when needed Two flavors Python since spring 2008 Java since spring 2009 Technology preview :S
The first hit is always free App quotas Free to start, 5 million pageviews/month 10 apps per user Can enable billing AdWords payment model $32 worth of resources/month http://yourapp.appspot.com http://www.yourapp.com using Google Apps for Domains
GAE/J in a nutshell A place to run Java Servlets (2.5 API) Meaning support for Servlets/JSP Web Frameworks (Spring MVC/Wicket/Tapestry/Struts ...) In a sandbox All apps in isolation Subset of the JRE Jetty customized Don't use the Jetty features, this might change
Limitations JRE White List No threads Cron jobs Task queues No outgoing connections (except mail/http/xmpp) Read-only FS  30 second request limit, no push (upcoming?) App spin-up time No SLA available
Datastore - BigTable NoSQL Stores “entities” Parent-Child relationships Add “properties” at will (beware of restrictions in queries) GQL to query Transactions – but not global like in databases != for one column only Max number of entities returned is 1000
Services – using standard APIs Datastore (BigTable) JDO JPA Memcache – javax.cache URL Fetch – java.net Mail – javax.mail Low-level APIs are available
Services – Google APIs Google Accounts XMPP Image manipulation  Task Queues Blobstore Cron jobs
Teh awesome Scalability is job #1 On demand Easy to get started No sysadm work needed An App Engine app is built to scale No long running requests NoSQL Move processing out of persistence layer
Getting started Sign up using phone nr (for verification sms) Create app id  Download Eclipse plugin Or use SDK with scripts Generate app Push to cloud
Development dev_appserver.sh User service Datastore Et al, but no cron or tasks Generates indexes for Datastore Blacklist/whitelist emulation Eclipse plugin (official) Netbeans, IntelliJ Support for mocking the environment for testing
Administration https://appengine.google.com One app can have several developers Concurrent versions  http://<version>.latest.appspot.com Manage billing settings Bandwidth/CPU time/storage/mail Logs Datastore viewer
Language support App Engine accepts Java byte code, not source code Permissive with reflection magic, creating classloaders etc App Engine team works together with JVM Lang implementors http://lotrepls.appspot.com/ beanshell, clojure, groovy, javascript, jython, jruby, scala, scheme PHP through Caucho/Quercus
Vendor lock-in? Use standard Java APIs Demoed on IBM Websphere http://code.google.com/p/appscale/ http://code.google.com/p/typhoonae/ Python only http://arachnid.github.com/bdbdatastore/ Use dev_appserver with alternative datastore
Demo Your first cloud application in a few minutes!
Resources http://code.google.com/appengine/ http://googleappengine.blogspot.com/ Programming Google App Engine On O'Reilly Written by a Googler Google Groups http://code.google.com/appengine/community.html
Contact mailto:peter@lind.be http://github.com/peterlind http://twitter.com/peter_lind

Google App Engine - Java Style

  • 1.
    Google App EngineJava style Peter Sönnergren Lind GTUG Stockholm 2010-01-14
  • 2.
    whoami Java devsince like 1999 Ruby enthusiast Consultant @ Devoteam Quaint Owner and CTO @ Pockus A book club that doesn't suck http://www.pockus.se
  • 3.
    App Engine 101Googles Cloud offering Run your web apps on Google's infrastructure Platform As A Service Unique Selling Point - Scalability on demand Instances are added when needed Two flavors Python since spring 2008 Java since spring 2009 Technology preview :S
  • 4.
    The first hitis always free App quotas Free to start, 5 million pageviews/month 10 apps per user Can enable billing AdWords payment model $32 worth of resources/month http://yourapp.appspot.com http://www.yourapp.com using Google Apps for Domains
  • 5.
    GAE/J in anutshell A place to run Java Servlets (2.5 API) Meaning support for Servlets/JSP Web Frameworks (Spring MVC/Wicket/Tapestry/Struts ...) In a sandbox All apps in isolation Subset of the JRE Jetty customized Don't use the Jetty features, this might change
  • 6.
    Limitations JRE WhiteList No threads Cron jobs Task queues No outgoing connections (except mail/http/xmpp) Read-only FS 30 second request limit, no push (upcoming?) App spin-up time No SLA available
  • 7.
    Datastore - BigTableNoSQL Stores “entities” Parent-Child relationships Add “properties” at will (beware of restrictions in queries) GQL to query Transactions – but not global like in databases != for one column only Max number of entities returned is 1000
  • 8.
    Services – usingstandard APIs Datastore (BigTable) JDO JPA Memcache – javax.cache URL Fetch – java.net Mail – javax.mail Low-level APIs are available
  • 9.
    Services – GoogleAPIs Google Accounts XMPP Image manipulation Task Queues Blobstore Cron jobs
  • 10.
    Teh awesome Scalabilityis job #1 On demand Easy to get started No sysadm work needed An App Engine app is built to scale No long running requests NoSQL Move processing out of persistence layer
  • 11.
    Getting started Signup using phone nr (for verification sms) Create app id Download Eclipse plugin Or use SDK with scripts Generate app Push to cloud
  • 12.
    Development dev_appserver.sh Userservice Datastore Et al, but no cron or tasks Generates indexes for Datastore Blacklist/whitelist emulation Eclipse plugin (official) Netbeans, IntelliJ Support for mocking the environment for testing
  • 13.
    Administration https://appengine.google.com Oneapp can have several developers Concurrent versions http://<version>.latest.appspot.com Manage billing settings Bandwidth/CPU time/storage/mail Logs Datastore viewer
  • 14.
    Language support AppEngine accepts Java byte code, not source code Permissive with reflection magic, creating classloaders etc App Engine team works together with JVM Lang implementors http://lotrepls.appspot.com/ beanshell, clojure, groovy, javascript, jython, jruby, scala, scheme PHP through Caucho/Quercus
  • 15.
    Vendor lock-in? Usestandard Java APIs Demoed on IBM Websphere http://code.google.com/p/appscale/ http://code.google.com/p/typhoonae/ Python only http://arachnid.github.com/bdbdatastore/ Use dev_appserver with alternative datastore
  • 16.
    Demo Your firstcloud application in a few minutes!
  • 17.
    Resources http://code.google.com/appengine/ http://googleappengine.blogspot.com/Programming Google App Engine On O'Reilly Written by a Googler Google Groups http://code.google.com/appengine/community.html
  • 18.