SlideShare a Scribd company logo
Google App Engine for Java Lars Vogel  http:///www.vogella.de Twitter:  http://www.twitter.com/vogella
Why do I qualify? Two popular tutorials in the internet about Google App Engine http://www.vogella.de/articles/GoogleAppEngineJava/article.html http://www.vogella.de/articles/GoogleAppEngine/article.html Published an article about robots on the App Engine in the (german) Eclipse Magazin Technical editor for a Google App Engine Book written by Google employees
What is cloud computing for me? What is the Google App Engine? Development for GAE with Java Persistence without SQL Tools - A fool with a tool is still a fool App Engine Services Testing on the cloud And of course coding
A typical system setup OS +Application Server + DB
You need scaling... Application Server Database Application Server Application Server
So you are fine, right?...
Designed for peek consumption Time Utilization
Cloud computing tries to solve this
What is a cloud computing not? Putting one or more computer in the internet is not necessary cloud computing That is just a server in the internet
What is a cloud computing? Cloud computing is Web-based processing, whereby shared resources, software, and information are provided to computers and other devices (such as smartphones) on demand over the Internet. Blabla, this means nothing...
Cloud: ....some kind of abstracting from the hardware and providing resources on demand Time
What types of cloud computing do we have? Infrastructure as a Service -> Amazon Platform as a Service -> Google App Engine Software as a service -> Salesforce.com, MyERP
Google App Engine Scalable Infrastructure GAE allows you to host webapplications on the Google infrastructure.
Difference to Amazons  Scalable Infrastructure Amazon provides virtual servers App Engine provides an interface to program against  App Engine give no access to the underlying system / hardware
Run your app on the Google Infrastructure Scalable Infrastructure
Google handles the infrastructure, e.g. hardware failures, security patches, OS upgrades
Sometimes there are issues
and the usage of App Engine is free…. within limits in any case you only pay for what your use
Google App Engine - Limits Scalable Infrastructure 10 Applications per User 5 Million Pageviews are free per month. Approx. 6.5 hours of CPU and 1 Gigabyte of inbound and outbound traffic. 100 hits per secs (non-billing) and 500 for billing enabled applications http://code.google.com/intl/en-EN/appengine/docs/billing.html
Real Costs Example - Game …  the site was built on Google App Engine and, according to Google Analytics, it served about  3.4 million pageviews  (1 million unique visitors) in the 12 days it was live. It grossed over $1.2 million…. Google sent us a bill for a grand total of  $71.56. http://googleappengine.blogspot.com/2010/06/how-app-engine-served-humble-indie.html
How does Google run thousands of thousands Java apps at the same time? They don’t… applications which are not actively used will be frozen and saved to big table    Initial startup time
App Engine Architecture App Engine FrontEnd App Engine FrontEnd App Engine FrontEnd AppServer AppServer AppServer Load Balancer
So it scales but what about Platform as a service?
Writing Java Webs application is hard from Guillaume Laforge and Patrick Chanezon http://www.slideshare.net/glaforge/google-app-engine-java-groovy-baby
To write a Java Web application Install / prepare the server Install / Configure the database Setup the webcontainer Develop your application  Package your application into a WAR file Deploy it on your server
...developing a Java Web application from scratch is really, really slow due to the initial setup required
Google App Engine –  Programming Languages Python   Java-isch Scala Groovy JRuby JPython … Still some issues with Grails....
Servlets and JSPs A servlet is a Java class which answers a HTTP request within a web container. JavaServer Pages (JSP) are files which contains HTML and Java code. The web container compiles the JSP into a servlet at the first time of accessing this JSP
Possible Web Frameworks on GAE Basically all Java Web frameworks, e.g. JSP, Servlets based GWT, JSF, Struts, Wicket
App Engine can be more then just a web application platform Scalable Infrastructure Doesn‘t have to be a webapplication, can be a backend for Android or iPhones... Can be used to do some serious number crunching
Access Can you from a Google domain or from your own You need only a Google User to get started
Develop according to Java standards from Guillaume Laforge and Patrick Chanezon http://www.slideshare.net/glaforge/google-app-engine-java-groovy-baby
Session Support Turned off by default  appengine-web.xml <sessions-enabled>true</sessions-enabled> Persistent and distributed
Configuration web.xml appengine-web.xml - allows several versions of your app can define static content -> super fast can define system variables enable ssl and http sessions
Development Tools
DevApp Server Scalable Infrastructure Emulates the Google App Engine, its service and restrictions Based on Jetty
Eclipse Scalable Infrastructure
Demo – A new project
Deployment Scalable Infrastructure Run your application on  [email_address]  or on your own domain Command line or Eclipse based
Logging java.util.logging.Logger System.out and System.err are also logged
Performance
Be fast You have to  be fast:  30 seconds to respond! Otherwise com.google.apphosting.api.DeadlineExceededException Google helps you that as its optimize its infrastructure all the time
Example for recent performance work Byte code used to enhanced dynamically, now App Engine does this this statically. JIT  and GC improvements Example Work on reflection Data from Google I/O 2010
Limits
Limits  No native threads – but Tasks No sockets No write access to file system No Native code Not all standard Java classes available (white list) Processes must finish without 30 secs (Tasks Chains…)
Compartibility is increasing Whitelist is growing. More and more libraries are supported
Datastore
Storing data Application can store data in memory, memcache, blobstore or the  datastore
Datastore The datastore is App Engine's non-relational database Uses internally Bigtable which is a key-value store Read / Write Consistent and distributed
Datastore Build for fast reading Update / Insert not that fast Individual datastore query can return a maximum of 1000 results Support concurrent queries
Datastore The performance of a query depends only on the size of your result set. It does not depend on the total number of data entries
Data Store Based on BigTable Sorted Map, no Joins Schemaless Transactional Low-level APIs JDO and JPA Blobstore
Datastore via JDO  Data Classes @PersistenceCapable public class Employee {     @Persistent     private String name } PersistenceManager PersistenceManager pm = PMF.get().getPersistenceManager(); pm.makePersistent(employee); pm.close; Retrieval and Queries employee = pm.getObjectById(Employee.class, key); Query query = pm.newQuery(Employee.class, “name = :name”); List<Employee> results = (List<Employee>) query.execute(&quot;Smith&quot;); Relations @Persistent(mappedBy = &quot;employee“) private List<ContactInfo> contactInfoSets;
Indexes App Engine builds indexes for several simple queries by default. If you run a query that filters on multiple entity properties or orders results by multiple properties, you will need an index for that query.  datastore-indexes.xml in WEB-INF/ 
Indexes Every query you run in the SDK automatically gets indexed.  Stored in application's datastore-indexes.xml (Java)
Other storage possibilities Blobstore Memcache
Memcache Cache data to avoid re-doing expensive operations Fast Developer can define a time-limit but App Engine may remove the data earlier -> do not rely on the availability Cache Values can be up to 1 MB
Blogstore Store, Upload and serve large files (<=2GB per blob) Create by upload a file via HTTP POST Read only Application can read blobs as if there are local files Requires billing enabled
App Engine  Services
Caching Channel API (push to client, comet) URL Fetching Mail Instant Messaging (XMPP) Image Manipulation User Management Background Tasks Map (no Reduce) XMPP (Chat) API’s
Lets apps issue HTTP and HTTPS requests and receive responses Really fast (uses Google Infrastructure) java.net HTTP API Port 80 and 443 supported  1 MB limited for request and 32 for response Supports both synchronous requests and asynchronous requests URL Fetch
Resize, rotate, flip…. Compose image from several images Image data from the app or from blobstore Image Service
Background processing by putting tasks into a queue GAE dispatches the tasks automatically Gets data and a URL as parameter, the URL represents the code which is executed Task Queue
Demos Lets write a chat bot for the App Engine using XMPP -  Extensible Messaging and Presence Protocol
Demos Lets send out emails...
Demos Receive email
Testing...
Testing Local Testing - equal functionality as the cloud - not equal in scale -  LocalServiceTestHelper(….services to be tested) Cloud Testing - serving HTTP requests - scalable and fast - all limits apply which apply for standard application -
Local Testing Similar to standard Java testing - JUnit, TestNG, Selenium Difference: Some classes require a certain App Engine setup, e.g. the datastore AppEngine Testing API
API.Proxy Register your own class as proxy for the GAE API calls and interfere them.
GAE 1.4
App Engine Recent Updates Running JVM (3 instances) WarmupRequest via appengine-web.xml The Channel API is now available for all users.  Task Queue released,  Deadline for Task Queue and Cron requests has been raised to 10  minutes.  Added a low-level AsyncDatastoreService for making calls to the datastore    asynchronously.  The whitelist has been updated to include all classes from javax.xml.soap.  Source: http://groups.google.com/group/google-appengine/browse_thread/thread/0f90ef8dda3b8400
Google Cloud for businesses 99.9 % SLA pay 8 Euros per user up to a maximum of 1000 Euro (==125 Users) Hosted SQL SSL (Secure Sockets Layer) for the domain Multi-tendency
Leverage the greatest IT infrastructure of the world Fast development of new functions Just to great to ignore Google App Engine
Photo credits  Please add  http://www.sxc.hu/photo/  to the number if not specified Cloud 1309726 Agenda 187747 Guy pulling the white wall http://www.sxc.hu/photo/702367 Balloon  http://www.sxc.hu/photo/566242 Critical guy  http://www.sxc.hu/photo/1173019 Question mark in the box 1084632 and 1084633 Hammer 604247 Server 175983 Turtle 1198861 Thinking Guy 130484 Picked Fence 695054 Performance 765733 Tools  1197009 Open Door http://www.sxc.hu/photo/1228296 Paper Chart http://www.sxc.hu/photo/565681 Binary http://www.sxc.hu/photo/1072645 Footprint http://www.sxc.hu/photo/442696 Old Computer http://www.sxc.hu/photo/1028528 Carton http://www.sxc.hu/photo/502161 Eye http://www.sxc.hu/photo/933394 Guitar playing man http://www.sxc.hu/photo/ 894247 Brown bag 250762 Future 1139530 Guy reading book 406547 Money House 1097251
Thank you For further questions: [email_address] http://www.vogella.de http://www.twitter.com/vogella
Hands-on Tutorial The following tutorials give an intro to GAE/J using servlets and JSP‘s http://www.vogella.de/articles/GoogleAppEngineJava/article.html http://code.google.com/intl/de-DE/appengine/docs/java/gettingstarted/ http://www.vogella.de/articles/GoogleAppEngine/article.html
License & Acknowledgements This work is licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License See  http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en_US

More Related Content

PPT
Developing Java Web Applications In Google App Engine
PDF
Cloud Computing Bootcamp On The Google App Engine v1.2.1
PDF
Google App Engine tutorial
KEY
Google App Engine Java, Groovy and Gaelyk
ODP
Introduction to Google App Engine
PDF
Google App Engine: An Introduction
PDF
What is Google App Engine?
KEY
Introduction to Google App Engine
Developing Java Web Applications In Google App Engine
Cloud Computing Bootcamp On The Google App Engine v1.2.1
Google App Engine tutorial
Google App Engine Java, Groovy and Gaelyk
Introduction to Google App Engine
Google App Engine: An Introduction
What is Google App Engine?
Introduction to Google App Engine

What's hot (20)

PDF
Gentle App Engine Intro
PPT
Google App Engine
PDF
What is Google App Engine
PPTX
Google app engine - Overview
PPTX
Google App Engine
PDF
I've (probably) been using Google App Engine for a week longer than you have
PDF
Introduction to Google App Engine
PPTX
Google app engine
PDF
Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...
PPTX
Google App Engine
ZIP
Google App Engine
PDF
Google App Engine (Introduction)
PDF
Google App Engine's Latest Features
PPTX
Introduction to Google App Engine with Python
PPTX
Google app engine
PPTX
Google App engine
PDF
App Engine Overview @ Google Hackathon SXSW 2010
PPT
Google app engine introduction
PPT
Google App Engine - Overview #3
PDF
Google Application Engine
Gentle App Engine Intro
Google App Engine
What is Google App Engine
Google app engine - Overview
Google App Engine
I've (probably) been using Google App Engine for a week longer than you have
Introduction to Google App Engine
Google app engine
Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...
Google App Engine
Google App Engine
Google App Engine (Introduction)
Google App Engine's Latest Features
Introduction to Google App Engine with Python
Google app engine
Google App engine
App Engine Overview @ Google Hackathon SXSW 2010
Google app engine introduction
Google App Engine - Overview #3
Google Application Engine
Ad

Similar to Google App Engine for Java (20)

PDF
Google App Engine for Java
PPTX
Google Cloud Platform
PPT
The 90-Day Startup with Google AppEngine for Java
PDF
Google App Engine for Java v0.0.2
PPTX
File Repository on GAE
PDF
Hands on App Engine
PDF
Cannibalising The Google App Engine
PPT
Google App Engine - Java Style
PPTX
Deploying applications to Cloud with Google App Engine
PPTX
Googleappengineintro 110410190620-phpapp01
PDF
What is App Engine? O
PDF
Google App Engine
PDF
Google App Engine With Java And Groovy
PPTX
Simple stock market analysis
PDF
App Engine On Air: Munich
PDF
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
PPTX
Azure Functions.pptx
PPT
Stepin evening presented
ODP
Google App Engine
ODP
eXo Platform SEA - Play Framework Introduction
Google App Engine for Java
Google Cloud Platform
The 90-Day Startup with Google AppEngine for Java
Google App Engine for Java v0.0.2
File Repository on GAE
Hands on App Engine
Cannibalising The Google App Engine
Google App Engine - Java Style
Deploying applications to Cloud with Google App Engine
Googleappengineintro 110410190620-phpapp01
What is App Engine? O
Google App Engine
Google App Engine With Java And Groovy
Simple stock market analysis
App Engine On Air: Munich
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Azure Functions.pptx
Stepin evening presented
Google App Engine
eXo Platform SEA - Play Framework Introduction
Ad

More from Lars Vogel (20)

PDF
Eclipse IDE and Platform news on Fosdem 2020
PDF
Eclipse platform news and how to contribute to the Eclipse Open Source project
PDF
Android design and Custom views
PDF
How to become an Eclipse committer in 20 minutes and fork the IDE
PDF
Building beautiful User Interface in Android
PDF
What is so cool about Android 4.0
PDF
What is so cool about Android 4.0?
PDF
Android Jumpstart Jfokus
PDF
Eclipse e4 - Google Eclipse Day
PPT
Android C2DM Presentation at O'Reilly AndroidOpen Conference
PPTX
Android Overview (Karlsruhe VKSI)
PPTX
Android Introduction on Java Forum Stuttgart 11
PPT
Eclipse 2011 Hot Topics
PPTX
Android Cloud to Device Messaging with the Google App Engine
PPTX
Eclipse 4.0 - Dynamic Models
PDF
Eclipse 40 Labs- Eclipse Summit Europe 2010
PDF
Eclipse 40 - Eclipse Summit Europe 2010
PPTX
Android Programming made easy
PPTX
Eclipse 40 and Eclipse e4
PPTX
Eclipse RCP Overview @ Rheinjug
Eclipse IDE and Platform news on Fosdem 2020
Eclipse platform news and how to contribute to the Eclipse Open Source project
Android design and Custom views
How to become an Eclipse committer in 20 minutes and fork the IDE
Building beautiful User Interface in Android
What is so cool about Android 4.0
What is so cool about Android 4.0?
Android Jumpstart Jfokus
Eclipse e4 - Google Eclipse Day
Android C2DM Presentation at O'Reilly AndroidOpen Conference
Android Overview (Karlsruhe VKSI)
Android Introduction on Java Forum Stuttgart 11
Eclipse 2011 Hot Topics
Android Cloud to Device Messaging with the Google App Engine
Eclipse 4.0 - Dynamic Models
Eclipse 40 Labs- Eclipse Summit Europe 2010
Eclipse 40 - Eclipse Summit Europe 2010
Android Programming made easy
Eclipse 40 and Eclipse e4
Eclipse RCP Overview @ Rheinjug

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
Teaching material agriculture food technology
PDF
KodekX | Application Modernization Development
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Cloud computing and distributed systems.
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
A Presentation on Artificial Intelligence
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Modernizing your data center with Dell and AMD
PPTX
Big Data Technologies - Introduction.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Empathic Computing: Creating Shared Understanding
PDF
Approach and Philosophy of On baking technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
NewMind AI Weekly Chronicles - August'25 Week I
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Teaching material agriculture food technology
KodekX | Application Modernization Development
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
“AI and Expert System Decision Support & Business Intelligence Systems”
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Cloud computing and distributed systems.
Unlocking AI with Model Context Protocol (MCP)
A Presentation on Artificial Intelligence
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Modernizing your data center with Dell and AMD
Big Data Technologies - Introduction.pptx
Encapsulation_ Review paper, used for researhc scholars
Empathic Computing: Creating Shared Understanding
Approach and Philosophy of On baking technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Understanding_Digital_Forensics_Presentation.pptx

Google App Engine for Java

  • 1. Google App Engine for Java Lars Vogel http:///www.vogella.de Twitter: http://www.twitter.com/vogella
  • 2. Why do I qualify? Two popular tutorials in the internet about Google App Engine http://www.vogella.de/articles/GoogleAppEngineJava/article.html http://www.vogella.de/articles/GoogleAppEngine/article.html Published an article about robots on the App Engine in the (german) Eclipse Magazin Technical editor for a Google App Engine Book written by Google employees
  • 3. What is cloud computing for me? What is the Google App Engine? Development for GAE with Java Persistence without SQL Tools - A fool with a tool is still a fool App Engine Services Testing on the cloud And of course coding
  • 4. A typical system setup OS +Application Server + DB
  • 5. You need scaling... Application Server Database Application Server Application Server
  • 6. So you are fine, right?...
  • 7. Designed for peek consumption Time Utilization
  • 8. Cloud computing tries to solve this
  • 9. What is a cloud computing not? Putting one or more computer in the internet is not necessary cloud computing That is just a server in the internet
  • 10. What is a cloud computing? Cloud computing is Web-based processing, whereby shared resources, software, and information are provided to computers and other devices (such as smartphones) on demand over the Internet. Blabla, this means nothing...
  • 11. Cloud: ....some kind of abstracting from the hardware and providing resources on demand Time
  • 12. What types of cloud computing do we have? Infrastructure as a Service -> Amazon Platform as a Service -> Google App Engine Software as a service -> Salesforce.com, MyERP
  • 13. Google App Engine Scalable Infrastructure GAE allows you to host webapplications on the Google infrastructure.
  • 14. Difference to Amazons Scalable Infrastructure Amazon provides virtual servers App Engine provides an interface to program against App Engine give no access to the underlying system / hardware
  • 15. Run your app on the Google Infrastructure Scalable Infrastructure
  • 16. Google handles the infrastructure, e.g. hardware failures, security patches, OS upgrades
  • 18. and the usage of App Engine is free…. within limits in any case you only pay for what your use
  • 19. Google App Engine - Limits Scalable Infrastructure 10 Applications per User 5 Million Pageviews are free per month. Approx. 6.5 hours of CPU and 1 Gigabyte of inbound and outbound traffic. 100 hits per secs (non-billing) and 500 for billing enabled applications http://code.google.com/intl/en-EN/appengine/docs/billing.html
  • 20. Real Costs Example - Game … the site was built on Google App Engine and, according to Google Analytics, it served about 3.4 million pageviews (1 million unique visitors) in the 12 days it was live. It grossed over $1.2 million…. Google sent us a bill for a grand total of $71.56. http://googleappengine.blogspot.com/2010/06/how-app-engine-served-humble-indie.html
  • 21. How does Google run thousands of thousands Java apps at the same time? They don’t… applications which are not actively used will be frozen and saved to big table  Initial startup time
  • 22. App Engine Architecture App Engine FrontEnd App Engine FrontEnd App Engine FrontEnd AppServer AppServer AppServer Load Balancer
  • 23. So it scales but what about Platform as a service?
  • 24. Writing Java Webs application is hard from Guillaume Laforge and Patrick Chanezon http://www.slideshare.net/glaforge/google-app-engine-java-groovy-baby
  • 25. To write a Java Web application Install / prepare the server Install / Configure the database Setup the webcontainer Develop your application Package your application into a WAR file Deploy it on your server
  • 26. ...developing a Java Web application from scratch is really, really slow due to the initial setup required
  • 27. Google App Engine – Programming Languages Python Java-isch Scala Groovy JRuby JPython … Still some issues with Grails....
  • 28. Servlets and JSPs A servlet is a Java class which answers a HTTP request within a web container. JavaServer Pages (JSP) are files which contains HTML and Java code. The web container compiles the JSP into a servlet at the first time of accessing this JSP
  • 29. Possible Web Frameworks on GAE Basically all Java Web frameworks, e.g. JSP, Servlets based GWT, JSF, Struts, Wicket
  • 30. App Engine can be more then just a web application platform Scalable Infrastructure Doesn‘t have to be a webapplication, can be a backend for Android or iPhones... Can be used to do some serious number crunching
  • 31. Access Can you from a Google domain or from your own You need only a Google User to get started
  • 32. Develop according to Java standards from Guillaume Laforge and Patrick Chanezon http://www.slideshare.net/glaforge/google-app-engine-java-groovy-baby
  • 33. Session Support Turned off by default appengine-web.xml <sessions-enabled>true</sessions-enabled> Persistent and distributed
  • 34. Configuration web.xml appengine-web.xml - allows several versions of your app can define static content -> super fast can define system variables enable ssl and http sessions
  • 36. DevApp Server Scalable Infrastructure Emulates the Google App Engine, its service and restrictions Based on Jetty
  • 38. Demo – A new project
  • 39. Deployment Scalable Infrastructure Run your application on [email_address] or on your own domain Command line or Eclipse based
  • 40. Logging java.util.logging.Logger System.out and System.err are also logged
  • 42. Be fast You have to be fast: 30 seconds to respond! Otherwise com.google.apphosting.api.DeadlineExceededException Google helps you that as its optimize its infrastructure all the time
  • 43. Example for recent performance work Byte code used to enhanced dynamically, now App Engine does this this statically. JIT and GC improvements Example Work on reflection Data from Google I/O 2010
  • 45. Limits No native threads – but Tasks No sockets No write access to file system No Native code Not all standard Java classes available (white list) Processes must finish without 30 secs (Tasks Chains…)
  • 46. Compartibility is increasing Whitelist is growing. More and more libraries are supported
  • 48. Storing data Application can store data in memory, memcache, blobstore or the datastore
  • 49. Datastore The datastore is App Engine's non-relational database Uses internally Bigtable which is a key-value store Read / Write Consistent and distributed
  • 50. Datastore Build for fast reading Update / Insert not that fast Individual datastore query can return a maximum of 1000 results Support concurrent queries
  • 51. Datastore The performance of a query depends only on the size of your result set. It does not depend on the total number of data entries
  • 52. Data Store Based on BigTable Sorted Map, no Joins Schemaless Transactional Low-level APIs JDO and JPA Blobstore
  • 53. Datastore via JDO Data Classes @PersistenceCapable public class Employee {     @Persistent     private String name } PersistenceManager PersistenceManager pm = PMF.get().getPersistenceManager(); pm.makePersistent(employee); pm.close; Retrieval and Queries employee = pm.getObjectById(Employee.class, key); Query query = pm.newQuery(Employee.class, “name = :name”); List<Employee> results = (List<Employee>) query.execute(&quot;Smith&quot;); Relations @Persistent(mappedBy = &quot;employee“) private List<ContactInfo> contactInfoSets;
  • 54. Indexes App Engine builds indexes for several simple queries by default. If you run a query that filters on multiple entity properties or orders results by multiple properties, you will need an index for that query.  datastore-indexes.xml in WEB-INF/ 
  • 55. Indexes Every query you run in the SDK automatically gets indexed. Stored in application's datastore-indexes.xml (Java)
  • 56. Other storage possibilities Blobstore Memcache
  • 57. Memcache Cache data to avoid re-doing expensive operations Fast Developer can define a time-limit but App Engine may remove the data earlier -> do not rely on the availability Cache Values can be up to 1 MB
  • 58. Blogstore Store, Upload and serve large files (<=2GB per blob) Create by upload a file via HTTP POST Read only Application can read blobs as if there are local files Requires billing enabled
  • 59. App Engine Services
  • 60. Caching Channel API (push to client, comet) URL Fetching Mail Instant Messaging (XMPP) Image Manipulation User Management Background Tasks Map (no Reduce) XMPP (Chat) API’s
  • 61. Lets apps issue HTTP and HTTPS requests and receive responses Really fast (uses Google Infrastructure) java.net HTTP API Port 80 and 443 supported 1 MB limited for request and 32 for response Supports both synchronous requests and asynchronous requests URL Fetch
  • 62. Resize, rotate, flip…. Compose image from several images Image data from the app or from blobstore Image Service
  • 63. Background processing by putting tasks into a queue GAE dispatches the tasks automatically Gets data and a URL as parameter, the URL represents the code which is executed Task Queue
  • 64. Demos Lets write a chat bot for the App Engine using XMPP - Extensible Messaging and Presence Protocol
  • 65. Demos Lets send out emails...
  • 68. Testing Local Testing - equal functionality as the cloud - not equal in scale - LocalServiceTestHelper(….services to be tested) Cloud Testing - serving HTTP requests - scalable and fast - all limits apply which apply for standard application -
  • 69. Local Testing Similar to standard Java testing - JUnit, TestNG, Selenium Difference: Some classes require a certain App Engine setup, e.g. the datastore AppEngine Testing API
  • 70. API.Proxy Register your own class as proxy for the GAE API calls and interfere them.
  • 72. App Engine Recent Updates Running JVM (3 instances) WarmupRequest via appengine-web.xml The Channel API is now available for all users. Task Queue released, Deadline for Task Queue and Cron requests has been raised to 10 minutes. Added a low-level AsyncDatastoreService for making calls to the datastore   asynchronously. The whitelist has been updated to include all classes from javax.xml.soap. Source: http://groups.google.com/group/google-appengine/browse_thread/thread/0f90ef8dda3b8400
  • 73. Google Cloud for businesses 99.9 % SLA pay 8 Euros per user up to a maximum of 1000 Euro (==125 Users) Hosted SQL SSL (Secure Sockets Layer) for the domain Multi-tendency
  • 74. Leverage the greatest IT infrastructure of the world Fast development of new functions Just to great to ignore Google App Engine
  • 75. Photo credits Please add http://www.sxc.hu/photo/ to the number if not specified Cloud 1309726 Agenda 187747 Guy pulling the white wall http://www.sxc.hu/photo/702367 Balloon http://www.sxc.hu/photo/566242 Critical guy http://www.sxc.hu/photo/1173019 Question mark in the box 1084632 and 1084633 Hammer 604247 Server 175983 Turtle 1198861 Thinking Guy 130484 Picked Fence 695054 Performance 765733 Tools 1197009 Open Door http://www.sxc.hu/photo/1228296 Paper Chart http://www.sxc.hu/photo/565681 Binary http://www.sxc.hu/photo/1072645 Footprint http://www.sxc.hu/photo/442696 Old Computer http://www.sxc.hu/photo/1028528 Carton http://www.sxc.hu/photo/502161 Eye http://www.sxc.hu/photo/933394 Guitar playing man http://www.sxc.hu/photo/ 894247 Brown bag 250762 Future 1139530 Guy reading book 406547 Money House 1097251
  • 76. Thank you For further questions: [email_address] http://www.vogella.de http://www.twitter.com/vogella
  • 77. Hands-on Tutorial The following tutorials give an intro to GAE/J using servlets and JSP‘s http://www.vogella.de/articles/GoogleAppEngineJava/article.html http://code.google.com/intl/de-DE/appengine/docs/java/gettingstarted/ http://www.vogella.de/articles/GoogleAppEngine/article.html
  • 78. License & Acknowledgements This work is licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License See http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en_US