2009/11/17

Devoxx 2009 – Google Application Engine - A Real Live Voyage to The Cloud

17/11/2009, University Sessions, Sam Brodkin and Scott Stevenson

Google Application Engine for Java (GAE/J) is a cloud computing solution that provides
  • a JVM
  • OS support
  • access to the Servlet API
  • a management console
  • access to Google utilities:
    • Logon / Sign up → com.google...User
    • image service: resize images
    • mails
  • building blocks:
    • DataStore
    • MemCache
Cost model is based on actual usage, with a free quota for easy starting:
  • bandwidth usage (in/out)
  • cpu usage
  • datastore size
  • emails sent
Management console:
  • access to logs
  • shows bandwidth / cpu usage → cost
  • users with admin role
  • statistics
  • manage multiple versions: one default, and many test versions (beware of data-incompatibilities)
Limits of GAE/J:
  • requests timeout: 30sec
  • no background processes allowed
  • no server push
  • no threads
  • read-only file-system
  • no transaction
  • only access to white-listed classes (e.g. ImageIO class of java is not accessible → use Google Image service)
  • a maximum of 3000 static resources per application
  • Migrating your application off the GAE/J cloud: difficult, but not impossible → google for “GEA Bar”
DataStore for data persisency
  • not a relational database
  • BigTable → like a big HashMap
  • no transaction
  • JDO or JPA access
Development Environment:
  • eclipse plugin
  • Jetty based emulator → fair emulation, but not 100% relevant
  • MemCache
  • disk-based datastore
  • compile-time checks
  • no maven support yet
  • DIY ant scripts are possible and recommended.
Demo: “swagswap.org”
  • 3 tiers:
    • DAO
    • service layer
    • 4 frontends that use the same
      service layer:
      • jsf 2.0 (+IPhone version)
      • gwt 1.7
      • SmartGwt
      • Spring MVC
  • wired through Spring 3.0
  • get detailed cost of a request by setting a special HTTP header
Quirks:
  • BLOB type
  • Text type for long Strings
  • white-listed classes
    • → find workarounds for blocked classes (e.g. Image services)
    • → some thirdparty libraries don't work
  • JSF2.0:
    • disable threading in web.xml
    • no JNDI: hack WebConfiguration class
    • server side state doesn't work → use client side state
    • RichFaces, IceFaces and Commons FileUpload use non-whitelisted classes → incompatible with GAE
  • GWT:
    • BLOB and Text are non-serializable
    • GWT <> Spring integration requires a special service class
  • SmartGWT:
    • requires 1000 static resources → closer to the max of 3000 of GAE → workaround with zip-file and cache, but increases cpu-cost

1 comment:

Sam Brodkin said...

Wow great summary. That should have been our last slide.