Professional Documents
Culture Documents
Google App Engine Overview
Google App Engine Overview
About me
Developer in the Emerging markets team. Joined Google in 2007. Previously worked on Social graphs, Gmail and Google Accounts. Currently work on SMS products (Chat SMS, G+ SMS and more to come...) G+ profile: http://gplus.name/GuyFlysher
Agenda
Part I: What is App Engine? Part II: App Engine Product Usage Part III: How to use App Engine Hello world example App Engine Services Code examples Demos of non web uses
App Engine provides great tools, APIs & hosting Easy to build Easy to manage Easy to scale
GO
Experimental
Java
XMPP
Task Queue
Images
Blobstore
User Service
Administration Console
Agenda
Part I: What is App Engine? Part II: App Engine Product Usage Part III: How to use App Engine Hello world example App Engine Services Code examples Demos of non web uses
1,500,000,000+
Page views per day
On Wedding day...
Blog app served: Up to 2k requests per second 15 million pageviews 5.6 million visitors Live stream app served: Up to 32k requests per second 37.7 million pageviews 13.7 million visitors
http://goo.gl/F1SGc
Need backend server processing? Want to build your own? Go cloud with App Engine!
No UI needed for app to talk to App Engine, just need HTTP or XMPP Great place for user info e.g., high scores, contacts, levels/badges, etc. Better UI: move user data off phone & make universally available
Agenda
Part I: What is App Engine? Part II: App Engine Product Usage Part III: How to use App Engine Servlets and JSP files Hello world example App Engine Services and code examples Demos of non web uses
Java HttpServlet
Abstract class for processing HTTP requests. Override its methods for processing various HTTP requests, e.g: doGet doPost doHead etc Part of Java (not App Engine specific)
HttpServlet example
public class Hello_worldServlet extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { String userIp = req.getRemoteAddr(); resp.setContentType("text/plain"); resp.getWriter().println("Hello, " + userIp); } }
JSP example
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <html><head> <title> Welcome!</title></head><body> <% if (request.getParameter("name") != null) { %> <p>Hello, <%= request.getParameter("name") %> </p> <% } else { %> <p>Hello, stranger. </p> <% } %>
Configuration files
web.xml
Used to map URLs to the servlets that will handle them:
web.xml
web.xml
Used to map URLs to the servlets that will handle them:
Demos
Q&A
More documentation and information: http://code.google.com/appengine
Backup
web.xml
<servlet> <servlet-name>xmppreceiver</servlet-name> <servlet-class>gday.ReceiveChatMessageServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>xmppreceiver</servlet-name> <url-pattern>/_ah/xmpp/message/chat/</url-pattern> </servlet-mapping>