SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
You	
   know	
   Java,	
   but	
   what	
   is	
  
AppEngine?	
   In	
   this	
   session	
   Max	
   will	
  
walk	
   you	
   from	
   a	
   brief	
   introducAon	
   of	
  
Servlets	
   to	
   an	
   overview	
   of	
   the	
  
Google	
   AppEngine.	
   We	
   learn	
   about	
  
the	
   basics	
   such	
   as	
   the	
   data	
   store	
   –	
  
which	
   is	
   quite	
   different	
   from	
   SQL	
   -­‐,	
  
applicaAon	
   versions,	
   back-­‐ends,	
  
scheduler,	
   instances	
   and	
   logging.	
  
Services	
   such	
   as	
   mail,	
   url	
   fetch,	
   task	
  
queue	
   are	
   also	
   explained.	
   Since	
   we	
  
use	
   GAE/J	
   since	
   2010	
   in	
   Calpano	
   we	
  
also	
  talk	
  about	
  costs	
  and	
  experience	
  
in	
  pracAce.	
  
	
  





Dr. Max Völkel, Calpano
                                                                      1
Poll
§  Language?
§  Java?
§  AppEngine?
§  Servlets?




           GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                        2
Do you know Servlets?
§  HttpServlet
     •  void doGet( HttpServletRequest req,

        "HttpServletResponse res);"
     •  void doPost(…)"
§  HttpServletRequest
     •  get Header(…), get InputStream(...)"
§  HttpServletResponse
     •  set Header(…), getOutputStream(...)"

See: http://java.sun.com/products/servlet/, AppEngine supports version 2.5            "



                         GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                                          3
AppEngine is a Servlet Container
§  Servlet Container runs a Web Application
    Archive (WAR)
  •  Class files
  •  Static resources
  •  web.xml"

§  In AppEngine also:
  •  appengine-web.xml, queue.xml, cron.xml,
    backends.xml, indexes.xml,                           …


                GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                             4
AppEngine Architecture
                                  Java/Python/Go

§  Running Code
                                                HTTP,	
  Incoming	
  Mail,	
  
§  Storing Data
                                                  Cron,	
  Taskqueue	
  
    •  JVM
    •  Memcache
    •  Data store (Old vs. High
       Replication)
                                                 Servlet	
  Container	
  
§  Connect to the outside world
                                               	
  
    •  Mail (Incoming, Outgoing)
                                           JVM	
  
    •  Urlfetch
§  Delay or schedule work
    •  Taskqueue
                                                                   Memcache	
  
    •  Cron
                                              Data	
  Store	
            Images	
  
§  More helper services
    •  Images
                                                Urlfetch,	
  Outgoing	
  Mail,	
  
    •  Users
                                                        Taskqueue	
  


                    GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                                                   5
Hello AppEngine
§  Typical first test:
   •  Register, Verify mobile number via SMS
   •  Create new app “helloworld”
      •  http://helloworld.appspot.com
§  Next step:
   •  Buy domain name
   •  Configure …



              GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                           6
1.  Appspot.com > Create App




2.  Go to “Apps for your Domain”
    https://www.google.com/a/calpano.com
3.  Organization & Users > Create user
    ! Only those can send emails
4.  Domain Settings >
    Domain names >
    Add domain name or alias >



5.  Go to appspot.com and “Add Domain”

   

                    GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                                 7
Application Versions
§  http://{version}.{appid}.appspot.com"
§  http://{appid].appspot.com
    à main version (Selected in Dashboard)
§  All versions
  •  Share the same datastore, memcache (!)
  •  Different logs, stats, instances




            GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                         8
Running Code
§  Java 6 VM (experimental Java 7)
§  No Files (only read the ones you put in your .war)
§  Explicit whitelist which Java classes are allowed (many!)
   •  https://developers.google.com/appengine/docs/java/jrewhitelist


§  F1: 8 cent/hour 
   •  128MB memory (!), 
   •  600MHz CPU
§  F2 = F1 * 2; F4 = F1 * 4
§  ! Servlet response max. time is 60 seconds




                  GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                               9
Storing Data
§  JVM
  •  Great when “always on”
§  Memcache
  •  Really just a cache
§  Data store
  •  Old: Master-Slave (2 data centers)
  •  High Replication (3 data centers)


             GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                          10
Connect to the outside world
§  Mail
   •  Incoming
      •  Send as a servlet request
   •  Outgoing
      •  Via Java Mail API, only some headers used
      •  ! Bounce processing
            •  http://code.google.com/p/googleappengine/issues/
               detail?id=1800

§  Urlfetch
      •  ! Calling Twitter API etc.

                 GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                              11
Delay or schedule work
§  Taskqueue
Queue queue = QueueFactory.getDefaultQueue();!
queue.add(TaskOptions.Builder.withDefaults()!
.payload(task));!
   •  Task is a DeferredTask (has a run() method)
   •  Very quick to enqueue task
   •  Task queue service fires requests as
      HttpRequests at defined rates, unwraps task,
      runs it
   •  Max runtime: 10 minutes
§  Cron
   •  Scheduled GET-requests at defined urls

              GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                           12
More helper services
§  Images
   •  Looks like a subset of ImageMagick
§  Users
   •  Log in via Google Account




              GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                           13
Where is a request going?
Typical setup
§  DNS lookup: CNAME or A-record to Google
§  GAE scheduler: 
   •  Request queue for your app
   •  Boot new instance? Takes ca. 10-30 seconds.
§  On instance: 
   •  Run WAR, 
   •  Run servlet




               GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                            14
Instances




GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                             15
Time is Money. What time?
§  Free vs. Payment enabled
§  Quotas
   •  Usage – Free = Billable à Pay 
   •  Resource quota à Fair use limit à Error page
§  Data store
   •  See also
      http://blog.xam.de/2011/11/analysis-of-datastore-operation-
      cost.html
§  Instance hours
   •  Usage (code time * complexity + 15 min)
   •  What???

                 GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                              16
Real time vs. API time




§  CPU-intensive code is more expensive
  •  Is magically speed-up by AppEngine

           GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                        17
The Scheduler
Appspot > App Settings > Performance




                GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                             18
Appstats




GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                             19
More stuff
§  Backends
      •  Requests run for hours (or even days?)
§  Logging
      •  Java.util.logging runs fine
§    Blobstore
§    Channel ~ like websockets
§    XMPP
§    Remote API: 
      •  Call services remotely

                 GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                              20
Practical Tips on Datastore
§  Don’t use JDO abstraction
  •  Leaky abstraction anyway
§  Low-level API quite easy
  •  Objectify (open source) makes using it nice
  •  Xydra.org adds versioning/synchronisation




            GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                         21
Real-World Experiences
§  Xydra
                                                HTTP,	
  Incoming	
  Mail,	
  
                                                            Cron,	
  Taskqueue	
  
§  Calpano.com
§  SonicMetrics.com
                                         Servlet	
  Container	
  
                                                                         	
  
                                                                     JVM	
  


                                                                             Memcache	
  
                                                   Data	
  Store	
            Images	
  

                                                       Urlfetch,	
  Outgoing	
  Mail,	
  
                                                              Taskqueue	
  


           GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                                            22
When to use AppEngine?
§  Best: Spikes in demand
§  OK: Outsource server management




          GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                       23
Where to learn more?
§  Next talk from Florian Krupicka on
    Continuous Integration with AppEngine and
    Maven
§  Google webseits – Docu, JavaDocs, Articles,
§  Stackoverflow – Googles official developer
    support moved there
§  Books
  •  Programming Google AppEngine – was OK when
     it came out, but now too outdated
§  Book a workshop from Calpano Consulting
    J 
            GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                         24
HTTP,	
  Incoming	
  Mail,	
  
         Cron,	
  Taskqueue	
  



           Servlet	
  Container	
  
                      	
  
                  JVM	
  


                          Memcache	
  
Data	
  Store	
            Images	
  

    Urlfetch,	
  Outgoing	
  Mail,	
                                                
           Taskqueue	
                                                              Dr. Max Völkel

                       GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                                               25
Contact Information
§  Dr. Max Völkel
§  Max.voelkel@calpano.com
§  +49 171 8359678

§  www.Calpano.com




           GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com
                                                                        26

Contenu connexe

Tendances

Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)Jared Burrows
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksMike Hugo
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Ryan Cuprak
 
Resin Outperforms NginX
Resin Outperforms NginXResin Outperforms NginX
Resin Outperforms NginXbilldigman
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Matthew Groves
 
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013Marcus Barczak
 
Java EE Servlet JSP Tutorial- Cookbook 1
Java EE Servlet JSP Tutorial- Cookbook 1Java EE Servlet JSP Tutorial- Cookbook 1
Java EE Servlet JSP Tutorial- Cookbook 1billdigman
 
Plain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticalsPlain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticalsAngela Byron
 
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...DynamicInfraDays
 
Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]Ryan Cuprak
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript FrameworkAll Things Open
 
Java EE Servlet/JSP Tutorial- Cookbook 2
Java EE Servlet/JSP Tutorial- Cookbook 2Java EE Servlet/JSP Tutorial- Cookbook 2
Java EE Servlet/JSP Tutorial- Cookbook 2billdigman
 
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12cDeveloping Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12cBruno Borges
 
Introduction to Web Application Clustering
Introduction to Web Application ClusteringIntroduction to Web Application Clustering
Introduction to Web Application ClusteringPiyush Katariya
 
OSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian SchneiderOSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian Schneidermfrancis
 
Administration for Oracle ADF Applications
Administration for Oracle ADF ApplicationsAdministration for Oracle ADF Applications
Administration for Oracle ADF ApplicationsAndreas Koop
 

Tendances (20)

Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)
 
Apache Lucene for Java EE Developers
Apache Lucene for Java EE DevelopersApache Lucene for Java EE Developers
Apache Lucene for Java EE Developers
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And Tricks
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]
 
Resin Outperforms NginX
Resin Outperforms NginXResin Outperforms NginX
Resin Outperforms NginX
 
Rebooting a Cloud
Rebooting a CloudRebooting a Cloud
Rebooting a Cloud
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
 
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013
 
Virtualization and Containers
Virtualization and ContainersVirtualization and Containers
Virtualization and Containers
 
Java EE Servlet JSP Tutorial- Cookbook 1
Java EE Servlet JSP Tutorial- Cookbook 1Java EE Servlet JSP Tutorial- Cookbook 1
Java EE Servlet JSP Tutorial- Cookbook 1
 
Into The Box 2018 Ortus Keynote
Into The Box 2018 Ortus KeynoteInto The Box 2018 Ortus Keynote
Into The Box 2018 Ortus Keynote
 
Plain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticalsPlain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticals
 
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
 
Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript Framework
 
Java EE Servlet/JSP Tutorial- Cookbook 2
Java EE Servlet/JSP Tutorial- Cookbook 2Java EE Servlet/JSP Tutorial- Cookbook 2
Java EE Servlet/JSP Tutorial- Cookbook 2
 
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12cDeveloping Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
 
Introduction to Web Application Clustering
Introduction to Web Application ClusteringIntroduction to Web Application Clustering
Introduction to Web Application Clustering
 
OSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian SchneiderOSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian Schneider
 
Administration for Oracle ADF Applications
Administration for Oracle ADF ApplicationsAdministration for Oracle ADF Applications
Administration for Oracle ADF Applications
 

Similaire à Google AppEngine (GAE/J) - Introduction and Overview from a Java Guy

Golang @ Tokopedia
Golang @ TokopediaGolang @ Tokopedia
Golang @ TokopediaQasim Zaidi
 
Buildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbBuildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbMongoDB APAC
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Enginecatherinewall
 
Gaelyk - JFokus 2011 - Guillaume Laforge
Gaelyk - JFokus 2011 - Guillaume LaforgeGaelyk - JFokus 2011 - Guillaume Laforge
Gaelyk - JFokus 2011 - Guillaume LaforgeGuillaume Laforge
 
The State of Java under Oracle at JCertif 2011
The State of Java under Oracle at JCertif 2011The State of Java under Oracle at JCertif 2011
The State of Java under Oracle at JCertif 2011Arun Gupta
 
Getting Started on Google Cloud Platform
Getting Started on Google Cloud PlatformGetting Started on Google Cloud Platform
Getting Started on Google Cloud PlatformAaron Taylor
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java3Pillar Global
 
What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9Ivan Krylov
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Ryan Cuprak
 
Scala, ECS, Docker: Delayed Execution @Coursera
Scala, ECS, Docker: Delayed Execution @CourseraScala, ECS, Docker: Delayed Execution @Coursera
Scala, ECS, Docker: Delayed Execution @CourseraC4Media
 
Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesBruno Borges
 
DrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtDrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtNick Santamaria
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGuillaume Laforge
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWebDave Bouwman
 
Realtime Analytics with MongoDB Counters (mongonyc 2012)
Realtime Analytics with MongoDB Counters (mongonyc 2012)Realtime Analytics with MongoDB Counters (mongonyc 2012)
Realtime Analytics with MongoDB Counters (mongonyc 2012)Scott Hernandez
 
DevOps <3 node.js
DevOps <3 node.jsDevOps <3 node.js
DevOps <3 node.jsJeff Miccolis
 
Apache Airflow (incubating) NL HUG Meetup 2016-07-19
Apache Airflow (incubating) NL HUG Meetup 2016-07-19Apache Airflow (incubating) NL HUG Meetup 2016-07-19
Apache Airflow (incubating) NL HUG Meetup 2016-07-19Bolke de Bruin
 
Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)Camuel Gilyadov
 

Similaire à Google AppEngine (GAE/J) - Introduction and Overview from a Java Guy (20)

Implementing your own Google App Engine
Implementing your own Google App Engine Implementing your own Google App Engine
Implementing your own Google App Engine
 
Golang @ Tokopedia
Golang @ TokopediaGolang @ Tokopedia
Golang @ Tokopedia
 
Buildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbBuildingsocialanalyticstoolwithmongodb
Buildingsocialanalyticstoolwithmongodb
 
PaaS with Java
PaaS with JavaPaaS with Java
PaaS with Java
 
Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
 
Gaelyk - JFokus 2011 - Guillaume Laforge
Gaelyk - JFokus 2011 - Guillaume LaforgeGaelyk - JFokus 2011 - Guillaume Laforge
Gaelyk - JFokus 2011 - Guillaume Laforge
 
The State of Java under Oracle at JCertif 2011
The State of Java under Oracle at JCertif 2011The State of Java under Oracle at JCertif 2011
The State of Java under Oracle at JCertif 2011
 
Getting Started on Google Cloud Platform
Getting Started on Google Cloud PlatformGetting Started on Google Cloud Platform
Getting Started on Google Cloud Platform
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java
 
What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
 
Scala, ECS, Docker: Delayed Execution @Coursera
Scala, ECS, Docker: Delayed Execution @CourseraScala, ECS, Docker: Delayed Execution @Coursera
Scala, ECS, Docker: Delayed Execution @Coursera
 
Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on Kubernetes
 
DrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtDrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an Afterthought
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWeb
 
Realtime Analytics with MongoDB Counters (mongonyc 2012)
Realtime Analytics with MongoDB Counters (mongonyc 2012)Realtime Analytics with MongoDB Counters (mongonyc 2012)
Realtime Analytics with MongoDB Counters (mongonyc 2012)
 
DevOps <3 node.js
DevOps <3 node.jsDevOps <3 node.js
DevOps <3 node.js
 
Apache Airflow (incubating) NL HUG Meetup 2016-07-19
Apache Airflow (incubating) NL HUG Meetup 2016-07-19Apache Airflow (incubating) NL HUG Meetup 2016-07-19
Apache Airflow (incubating) NL HUG Meetup 2016-07-19
 
Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)Apache Drill (ver. 0.1, check ver. 0.2)
Apache Drill (ver. 0.1, check ver. 0.2)
 

Plus de Max Völkel

Lean Startup Cost and Benefits
Lean Startup Cost and BenefitsLean Startup Cost and Benefits
Lean Startup Cost and BenefitsMax Völkel
 
Summary of 'The Mom Test' (v2 2013-11-05)
Summary of 'The Mom Test' (v2 2013-11-05)Summary of 'The Mom Test' (v2 2013-11-05)
Summary of 'The Mom Test' (v2 2013-11-05)Max Völkel
 
Innovation Ohne Risiko - Lean Startup für Unternehmen
Innovation Ohne Risiko - Lean Startup für UnternehmenInnovation Ohne Risiko - Lean Startup für Unternehmen
Innovation Ohne Risiko - Lean Startup für UnternehmenMax Völkel
 
2012-07 Lean Startup at #bcka by Calpano
2012-07 Lean Startup at #bcka by Calpano2012-07 Lean Startup at #bcka by Calpano
2012-07 Lean Startup at #bcka by CalpanoMax Völkel
 
Lessons Learned from reading "The Lean Startup"
Lessons Learned from reading "The Lean Startup"Lessons Learned from reading "The Lean Startup"
Lessons Learned from reading "The Lean Startup"Max Völkel
 
REQUIREMENTS FOR PERSONAL KNOWLEDGE MANAGEMENT TOOLS
REQUIREMENTS FOR PERSONAL KNOWLEDGE MANAGEMENT TOOLSREQUIREMENTS FOR PERSONAL KNOWLEDGE MANAGEMENT TOOLS
REQUIREMENTS FOR PERSONAL KNOWLEDGE MANAGEMENT TOOLSMax Völkel
 
The 10 Processes of using Knowledge Models
The 10 Processes of using Knowledge ModelsThe 10 Processes of using Knowledge Models
The 10 Processes of using Knowledge ModelsMax Völkel
 
TagFS — Tag Semantics for Hierarchical File Systems
TagFS — Tag Semantics for Hierarchical File SystemsTagFS — Tag Semantics for Hierarchical File Systems
TagFS — Tag Semantics for Hierarchical File SystemsMax Völkel
 
Artificial Memory - tasks, structure, performance indicators
Artificial Memory - tasks, structure, performance indicatorsArtificial Memory - tasks, structure, performance indicators
Artificial Memory - tasks, structure, performance indicatorsMax Völkel
 
Personal Knowledge Mapping with Semantic Web Technologies
Personal Knowledge Mapping with Semantic Web TechnologiesPersonal Knowledge Mapping with Semantic Web Technologies
Personal Knowledge Mapping with Semantic Web TechnologiesMax Völkel
 
Personal Knowledge Models for More Productive Knowledge Workers
Personal Knowledge Models for More Productive Knowledge WorkersPersonal Knowledge Models for More Productive Knowledge Workers
Personal Knowledge Models for More Productive Knowledge WorkersMax Völkel
 
A Survey of the Landscape and State-of-Art in Semantic Wiki
A Survey of the Landscape and State-of-Art in Semantic WikiA Survey of the Landscape and State-of-Art in Semantic Wiki
A Survey of the Landscape and State-of-Art in Semantic WikiMax Völkel
 
Persönliches Wissensmanagement mit Semantischen Technologien
Persönliches Wissensmanagement mit Semantischen TechnologienPersönliches Wissensmanagement mit Semantischen Technologien
Persönliches Wissensmanagement mit Semantischen TechnologienMax Völkel
 
Cost-Benefit Analysis for the Design of Personal Knowledge Management Systems
Cost-Benefit Analysis for the Design of Personal Knowledge Management SystemsCost-Benefit Analysis for the Design of Personal Knowledge Management Systems
Cost-Benefit Analysis for the Design of Personal Knowledge Management SystemsMax Völkel
 
Talk of Max Völkel at SemWiki2008 workshop
Talk of Max Völkel at SemWiki2008 workshopTalk of Max Völkel at SemWiki2008 workshop
Talk of Max Völkel at SemWiki2008 workshopMax Völkel
 

Plus de Max Völkel (15)

Lean Startup Cost and Benefits
Lean Startup Cost and BenefitsLean Startup Cost and Benefits
Lean Startup Cost and Benefits
 
Summary of 'The Mom Test' (v2 2013-11-05)
Summary of 'The Mom Test' (v2 2013-11-05)Summary of 'The Mom Test' (v2 2013-11-05)
Summary of 'The Mom Test' (v2 2013-11-05)
 
Innovation Ohne Risiko - Lean Startup für Unternehmen
Innovation Ohne Risiko - Lean Startup für UnternehmenInnovation Ohne Risiko - Lean Startup für Unternehmen
Innovation Ohne Risiko - Lean Startup für Unternehmen
 
2012-07 Lean Startup at #bcka by Calpano
2012-07 Lean Startup at #bcka by Calpano2012-07 Lean Startup at #bcka by Calpano
2012-07 Lean Startup at #bcka by Calpano
 
Lessons Learned from reading "The Lean Startup"
Lessons Learned from reading "The Lean Startup"Lessons Learned from reading "The Lean Startup"
Lessons Learned from reading "The Lean Startup"
 
REQUIREMENTS FOR PERSONAL KNOWLEDGE MANAGEMENT TOOLS
REQUIREMENTS FOR PERSONAL KNOWLEDGE MANAGEMENT TOOLSREQUIREMENTS FOR PERSONAL KNOWLEDGE MANAGEMENT TOOLS
REQUIREMENTS FOR PERSONAL KNOWLEDGE MANAGEMENT TOOLS
 
The 10 Processes of using Knowledge Models
The 10 Processes of using Knowledge ModelsThe 10 Processes of using Knowledge Models
The 10 Processes of using Knowledge Models
 
TagFS — Tag Semantics for Hierarchical File Systems
TagFS — Tag Semantics for Hierarchical File SystemsTagFS — Tag Semantics for Hierarchical File Systems
TagFS — Tag Semantics for Hierarchical File Systems
 
Artificial Memory - tasks, structure, performance indicators
Artificial Memory - tasks, structure, performance indicatorsArtificial Memory - tasks, structure, performance indicators
Artificial Memory - tasks, structure, performance indicators
 
Personal Knowledge Mapping with Semantic Web Technologies
Personal Knowledge Mapping with Semantic Web TechnologiesPersonal Knowledge Mapping with Semantic Web Technologies
Personal Knowledge Mapping with Semantic Web Technologies
 
Personal Knowledge Models for More Productive Knowledge Workers
Personal Knowledge Models for More Productive Knowledge WorkersPersonal Knowledge Models for More Productive Knowledge Workers
Personal Knowledge Models for More Productive Knowledge Workers
 
A Survey of the Landscape and State-of-Art in Semantic Wiki
A Survey of the Landscape and State-of-Art in Semantic WikiA Survey of the Landscape and State-of-Art in Semantic Wiki
A Survey of the Landscape and State-of-Art in Semantic Wiki
 
Persönliches Wissensmanagement mit Semantischen Technologien
Persönliches Wissensmanagement mit Semantischen TechnologienPersönliches Wissensmanagement mit Semantischen Technologien
Persönliches Wissensmanagement mit Semantischen Technologien
 
Cost-Benefit Analysis for the Design of Personal Knowledge Management Systems
Cost-Benefit Analysis for the Design of Personal Knowledge Management SystemsCost-Benefit Analysis for the Design of Personal Knowledge Management Systems
Cost-Benefit Analysis for the Design of Personal Knowledge Management Systems
 
Talk of Max Völkel at SemWiki2008 workshop
Talk of Max Völkel at SemWiki2008 workshopTalk of Max Völkel at SemWiki2008 workshop
Talk of Max Völkel at SemWiki2008 workshop
 

Google AppEngine (GAE/J) - Introduction and Overview from a Java Guy

  • 1. You   know   Java,   but   what   is   AppEngine?   In   this   session   Max   will   walk   you   from   a   brief   introducAon   of   Servlets   to   an   overview   of   the   Google   AppEngine.   We   learn   about   the   basics   such   as   the   data   store   –   which   is   quite   different   from   SQL   -­‐,   applicaAon   versions,   back-­‐ends,   scheduler,   instances   and   logging.   Services   such   as   mail,   url   fetch,   task   queue   are   also   explained.   Since   we   use   GAE/J   since   2010   in   Calpano   we   also  talk  about  costs  and  experience   in  pracAce.     Dr. Max Völkel, Calpano 1
  • 2. Poll §  Language? §  Java? §  AppEngine? §  Servlets? GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 2
  • 3. Do you know Servlets? §  HttpServlet •  void doGet( HttpServletRequest req,
 "HttpServletResponse res);" •  void doPost(…)" §  HttpServletRequest •  get Header(…), get InputStream(...)" §  HttpServletResponse •  set Header(…), getOutputStream(...)" See: http://java.sun.com/products/servlet/, AppEngine supports version 2.5 " GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 3
  • 4. AppEngine is a Servlet Container §  Servlet Container runs a Web Application Archive (WAR) •  Class files •  Static resources •  web.xml" §  In AppEngine also: •  appengine-web.xml, queue.xml, cron.xml, backends.xml, indexes.xml, … GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 4
  • 5. AppEngine Architecture Java/Python/Go §  Running Code HTTP,  Incoming  Mail,   §  Storing Data Cron,  Taskqueue   •  JVM •  Memcache •  Data store (Old vs. High Replication) Servlet  Container   §  Connect to the outside world   •  Mail (Incoming, Outgoing) JVM   •  Urlfetch §  Delay or schedule work •  Taskqueue Memcache   •  Cron Data  Store   Images   §  More helper services •  Images Urlfetch,  Outgoing  Mail,   •  Users Taskqueue   GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 5
  • 6. Hello AppEngine §  Typical first test: •  Register, Verify mobile number via SMS •  Create new app “helloworld” •  http://helloworld.appspot.com §  Next step: •  Buy domain name •  Configure … GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 6
  • 7. 1.  Appspot.com > Create App 2.  Go to “Apps for your Domain” https://www.google.com/a/calpano.com 3.  Organization & Users > Create user ! Only those can send emails 4.  Domain Settings > Domain names > Add domain name or alias > 5.  Go to appspot.com and “Add Domain” GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 7
  • 8. Application Versions §  http://{version}.{appid}.appspot.com" §  http://{appid].appspot.com à main version (Selected in Dashboard) §  All versions •  Share the same datastore, memcache (!) •  Different logs, stats, instances GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 8
  • 9. Running Code §  Java 6 VM (experimental Java 7) §  No Files (only read the ones you put in your .war) §  Explicit whitelist which Java classes are allowed (many!) •  https://developers.google.com/appengine/docs/java/jrewhitelist §  F1: 8 cent/hour •  128MB memory (!), •  600MHz CPU §  F2 = F1 * 2; F4 = F1 * 4 §  ! Servlet response max. time is 60 seconds GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 9
  • 10. Storing Data §  JVM •  Great when “always on” §  Memcache •  Really just a cache §  Data store •  Old: Master-Slave (2 data centers) •  High Replication (3 data centers) GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 10
  • 11. Connect to the outside world §  Mail •  Incoming •  Send as a servlet request •  Outgoing •  Via Java Mail API, only some headers used •  ! Bounce processing •  http://code.google.com/p/googleappengine/issues/ detail?id=1800 §  Urlfetch •  ! Calling Twitter API etc. GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 11
  • 12. Delay or schedule work §  Taskqueue Queue queue = QueueFactory.getDefaultQueue();! queue.add(TaskOptions.Builder.withDefaults()! .payload(task));! •  Task is a DeferredTask (has a run() method) •  Very quick to enqueue task •  Task queue service fires requests as HttpRequests at defined rates, unwraps task, runs it •  Max runtime: 10 minutes §  Cron •  Scheduled GET-requests at defined urls GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 12
  • 13. More helper services §  Images •  Looks like a subset of ImageMagick §  Users •  Log in via Google Account GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 13
  • 14. Where is a request going? Typical setup §  DNS lookup: CNAME or A-record to Google §  GAE scheduler: •  Request queue for your app •  Boot new instance? Takes ca. 10-30 seconds. §  On instance: •  Run WAR, •  Run servlet GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 14
  • 15. Instances GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 15
  • 16. Time is Money. What time? §  Free vs. Payment enabled §  Quotas •  Usage – Free = Billable à Pay •  Resource quota à Fair use limit à Error page §  Data store •  See also http://blog.xam.de/2011/11/analysis-of-datastore-operation- cost.html §  Instance hours •  Usage (code time * complexity + 15 min) •  What??? GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 16
  • 17. Real time vs. API time §  CPU-intensive code is more expensive •  Is magically speed-up by AppEngine GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 17
  • 18. The Scheduler Appspot > App Settings > Performance GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 18
  • 19. Appstats GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 19
  • 20. More stuff §  Backends •  Requests run for hours (or even days?) §  Logging •  Java.util.logging runs fine §  Blobstore §  Channel ~ like websockets §  XMPP §  Remote API: •  Call services remotely GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 20
  • 21. Practical Tips on Datastore §  Don’t use JDO abstraction •  Leaky abstraction anyway §  Low-level API quite easy •  Objectify (open source) makes using it nice •  Xydra.org adds versioning/synchronisation GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 21
  • 22. Real-World Experiences §  Xydra HTTP,  Incoming  Mail,   Cron,  Taskqueue   §  Calpano.com §  SonicMetrics.com Servlet  Container     JVM   Memcache   Data  Store   Images   Urlfetch,  Outgoing  Mail,   Taskqueue   GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 22
  • 23. When to use AppEngine? §  Best: Spikes in demand §  OK: Outsource server management GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 23
  • 24. Where to learn more? §  Next talk from Florian Krupicka on Continuous Integration with AppEngine and Maven §  Google webseits – Docu, JavaDocs, Articles, §  Stackoverflow – Googles official developer support moved there §  Books •  Programming Google AppEngine – was OK when it came out, but now too outdated §  Book a workshop from Calpano Consulting J GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 24
  • 25. HTTP,  Incoming  Mail,   Cron,  Taskqueue   Servlet  Container     JVM   Memcache   Data  Store   Images   Urlfetch,  Outgoing  Mail,   Taskqueue   Dr. Max Völkel GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 25
  • 26. Contact Information §  Dr. Max Völkel §  Max.voelkel@calpano.com §  +49 171 8359678 §  www.Calpano.com GDG Karlsruhe DevFest 2012 | Dr. Max Völkel | Calpano.com 26