Google App Engine at a glance
        Stefan Christoph
Introduction
• PaaS
• Running own Apps in Google infrastructure
• Supports different runtime environments
  – Java ( JRE 6 with limitations, standard APIs like
    JDO, JPA, JavaMail)
  – Python ( 2.5.2, standard library)
• App runs in sandbox
• Automatic scaling and load balancing
Architecture - Overview

                                                           Internet
                                                            Internet



                                     http://<version>.<appid>.appspot.com/some/path


                                                       Loadbalancer




                       Frontend                            …                               Frontend




Static File Server      …             Static File Server              Application Server   …          Application Server



                     static files                                       resource files                 program files
                      static files                                       resource files                 program files
Architecture - Application Server

                                                                                             URLFetcher

                         Application
                                                                                                 Mail




                                                                                                                  Internet
                                                                                                                   Internet
                                                                                                XMPP
          Application sandbox /Runtime Environment

                                                                                          External Services



                                                                         Authentication
                                                              Memcache
                           Datastore
             Blobstore
Logging




                                           Image


                                                   Tasks




                                       Internal Services
                                                                                          Google App Engine




                Bigtable                                   memcache
                                                                                          Google Infrastructure
Services / Capabilities
•   Sandbox
•   Runtime Environment / Servlet Container
     – Java Interpreter
     – Read only filesystem
     – Memory
•   Data Store
•   Services
     –   User authentication
     –   URL Fetch
     –   Mail
     –   XMPP
     –   Memcache
     –   Image Manipulation
     –   Scheduled tasks / Task Queues
     –   Blobstore
     –   Logging
Limitations
• Programming Model
   – Application runs in sandbox and can not
       •   Write to filesystem
       •   Make arbitary network connections
       •   Use multiple threads/processes
       •   Perform long-lasting processing
       •   Permissions
       •   Know about other instances/applications
   – Sandbox restrictions are implemented as JVM
• Quotas (Requests, In/Out bandwidth, CPU time, API calls)
   – Billable Quotas
       • Set by the application owner to keep in budget
   – Fixed Quotas
       • Set by GAE to ensure integrity of the system
Development Environment
• Tools
  – Development Server
  – Application lifecycle management
  – Eclipse plugins / Firefox plugin (GWT)
  – Local unit testing / debugging
Deployment Environment
• Application is deployed as war which contains:
  – Static files
  – Resource Files
  – Program Files
  – Deployment Descriptor
• Rich Admin web console
• Deployment is integrated in IDE
• Deploy multiple version of the application at
  the same time
GWT-RPC
                         Client                                                   Server

                                            Framework


 <<interface>>                          <<interface>>
                                                                                RemoteServiceServlet
ServiceDefTarget                        RemoteService



                                           extends                                    extends




 <<interface>>          related          <<interface>>             implements
                                                                                   OurServiceImpl
OurServiceAsync                           OurService


                      implements             Our stuff

         implements



                                         ProxyService



                                   GWT framework (autogenerated)
App Engine Datastore
                                 Entity

                     key                         “data”

                Application ID              Property *

                     Kind                 name        Value *

                 ID / Name




• Non-relational Data-               • Distribution, replication,
  store                                load balancing behind
• Stores data as entities              the scene
• APIs:                              • Based on Bigtable / GFS
   – JDO / JPA
   – Low Level API
Using Email/XMPP
• Create Servlet for handling incoming
  messages
• Ensure proper url configuration ins
  deployment descriptor
• Configure as inbound service
• XMPP
  – implementation supports no Group Chat
  – App-id@appspot.com /
    anything@version.latest.app-id.appspotchat.com
Logging
•   Java.util.logging.Logger
•   View in Administration Console
•   Download logfiles
•   Standard output / standard error are written
    to the logs
Local Unit Testing
• LocalTestServiceHelper provides
  – local test environment including GAE services
     • Datastore
     • XMPP/Mail
     • User Management
  – Capability to use JUnit framework
Memcache Service
•   Distributed in memory cache
•   Configurable expiration time but
•   Unreliable might be vanished at any time
•   Supported Interfaces :
    – JACHE (JSR 107: JCACHE – Java Temporary
      Caching API)
    – The Low-Level Memcache API (documentation)
User Management – Google Accounts
• Optional feature
• Utilize Google Authentication system in your
  own application -> focus on business logic
• Access to Google account data -> email, id
• Access constraints based on roles
  – Declarative in deployment descriptor (URL
    based)
  – programmatically
Managing Applications
• Administration Console
  @http://appengine.google.com/a/yourdomai
  n.com
  – Application Dashboard
  – Multiple application versions
  – Analyzing log files (including admin)
  – Analyzing resource usage
Further Readings
• Google App Engine documentation
• GWT documentation
• “Beginning Java Google App” – Kyle Roche,
  Jeff Douglas
• “Programming Google App Engine” – Dan
  Sanderson

Google App Engine At A Glance

  • 1.
    Google App Engineat a glance Stefan Christoph
  • 2.
    Introduction • PaaS • Runningown Apps in Google infrastructure • Supports different runtime environments – Java ( JRE 6 with limitations, standard APIs like JDO, JPA, JavaMail) – Python ( 2.5.2, standard library) • App runs in sandbox • Automatic scaling and load balancing
  • 3.
    Architecture - Overview Internet Internet http://<version>.<appid>.appspot.com/some/path Loadbalancer Frontend … Frontend Static File Server … Static File Server Application Server … Application Server static files resource files program files static files resource files program files
  • 4.
    Architecture - ApplicationServer URLFetcher Application Mail Internet Internet XMPP Application sandbox /Runtime Environment External Services Authentication Memcache Datastore Blobstore Logging Image Tasks Internal Services Google App Engine Bigtable memcache Google Infrastructure
  • 5.
    Services / Capabilities • Sandbox • Runtime Environment / Servlet Container – Java Interpreter – Read only filesystem – Memory • Data Store • Services – User authentication – URL Fetch – Mail – XMPP – Memcache – Image Manipulation – Scheduled tasks / Task Queues – Blobstore – Logging
  • 6.
    Limitations • Programming Model – Application runs in sandbox and can not • Write to filesystem • Make arbitary network connections • Use multiple threads/processes • Perform long-lasting processing • Permissions • Know about other instances/applications – Sandbox restrictions are implemented as JVM • Quotas (Requests, In/Out bandwidth, CPU time, API calls) – Billable Quotas • Set by the application owner to keep in budget – Fixed Quotas • Set by GAE to ensure integrity of the system
  • 7.
    Development Environment • Tools – Development Server – Application lifecycle management – Eclipse plugins / Firefox plugin (GWT) – Local unit testing / debugging
  • 8.
    Deployment Environment • Applicationis deployed as war which contains: – Static files – Resource Files – Program Files – Deployment Descriptor • Rich Admin web console • Deployment is integrated in IDE • Deploy multiple version of the application at the same time
  • 9.
    GWT-RPC Client Server Framework <<interface>> <<interface>> RemoteServiceServlet ServiceDefTarget RemoteService extends extends <<interface>> related <<interface>> implements OurServiceImpl OurServiceAsync OurService implements Our stuff implements ProxyService GWT framework (autogenerated)
  • 10.
    App Engine Datastore Entity key “data” Application ID Property * Kind name Value * ID / Name • Non-relational Data- • Distribution, replication, store load balancing behind • Stores data as entities the scene • APIs: • Based on Bigtable / GFS – JDO / JPA – Low Level API
  • 11.
    Using Email/XMPP • CreateServlet for handling incoming messages • Ensure proper url configuration ins deployment descriptor • Configure as inbound service • XMPP – implementation supports no Group Chat – App-id@appspot.com / anything@version.latest.app-id.appspotchat.com
  • 12.
    Logging • Java.util.logging.Logger • View in Administration Console • Download logfiles • Standard output / standard error are written to the logs
  • 13.
    Local Unit Testing •LocalTestServiceHelper provides – local test environment including GAE services • Datastore • XMPP/Mail • User Management – Capability to use JUnit framework
  • 14.
    Memcache Service • Distributed in memory cache • Configurable expiration time but • Unreliable might be vanished at any time • Supported Interfaces : – JACHE (JSR 107: JCACHE – Java Temporary Caching API) – The Low-Level Memcache API (documentation)
  • 15.
    User Management –Google Accounts • Optional feature • Utilize Google Authentication system in your own application -> focus on business logic • Access to Google account data -> email, id • Access constraints based on roles – Declarative in deployment descriptor (URL based) – programmatically
  • 16.
    Managing Applications • AdministrationConsole @http://appengine.google.com/a/yourdomai n.com – Application Dashboard – Multiple application versions – Analyzing log files (including admin) – Analyzing resource usage
  • 17.
    Further Readings • GoogleApp Engine documentation • GWT documentation • “Beginning Java Google App” – Kyle Roche, Jeff Douglas • “Programming Google App Engine” – Dan Sanderson