SlideShare una empresa de Scribd logo
1 de 34
Descargar para leer sin conexión
GAE Overview
Moch Nasrullah R
Samsung R&D Institute Indonesia
(SRIN)
November 2013
As presented at:
Agenda
•
•
•
•

Cloud Computing
GAE Overview
GAE/J Overview
GAE/J Getting Started
Cloud Computing
Cloud Services

Cloud Clients
(Web browser, Desktop App,
Mobile App, embeded, ...)
http://upload.wikimedia.org/wikipedia/commons/b/b5/Cloud_computing.svg
Cloud classification
Software as a Service (SaaS)

Application:
-Web Apps
-Desktop Apps
-Mobile Apps
(Google Apps, Google Translate, Office
360, NetSuite, IBM Lotus Live, GitHub)

Platform as a Service (PaaS)

Development Platform + Runtime Tools +
Environment
(Google App Engine, Heroku, Windows
Azure, force.com, Rollbase)

Infrastructure as a Service (IaaS)

CPU
Networks
Data Storage
(AWS, VM Ware, Joyent, Rackspace)
Google App Engine
• run your web applications on Google's
infrastructure
– Google handles the maintenance infrasturcture:
hardware failures, security patches, OS upgrades

• Free ... within quota
GAE Limits & Quota
•
•
•
•

10 Apps per user
5 Mio pageview free per month
6.5 hours of CPU and 1 Gb in & out traffic
https://developers.google.com/appengine/do
cs/quotas
Why GAE
• Easy to build
– Language support (Java, Python, GO, PHP)
– Automatic scaling & load balancing

• Easy to maintain
– Web based admin dashboard

• Easy to scale (traffic & data storage)
– GAE Datastore
– Google Cloud SQL
– Google Cloud Storage
GAE/J Overview

developers.google.com/appengine/docs/java/
Let’s give it a try
• Follow the getting started in link below:
•

https://developers.google.com/appengine/docs/java/gettingstarted/introduction
Run Eclipse after Installing JDK
Installing Plugin

https://developers.google.com/eclipse/docs/install-eclipse-4.3
Install from zip
Creating Project
Configure SDK

Directory where
Appengine extracted
The Servlet Class
package guestbook;
import java.io.IOException;
import javax.servlet.http.*;
public class GuestbookServlet extends HttpServlet {
public void doGet(HttpServletRequest req,
HttpServletResponse resp)
throws IOException {
resp.setContentType("text/plain");
resp.getWriter().println("Hello, world");
}
}
Project Structure
Java source code
other configuration

JARs for libraries

app configuration
JSPs, images, data files
Running Application
Preparation for deployment
• Register to Google App Engine
• Create an Application
• Deploy via Eclipse
Register to App Engine
• Register at: https://appengine.google.com/
• Create an Application
Create an Application
• For now, just fill in ‘Application Identifier’ and ‘Application
Title’, than accept ‘Term of Service’
Problem when Deploying

• Adding VM config
o Open eclipse.ini in the eclipse folder
o Add below lines before -vmargs
-vm
C:Javajdk1.7.0_40binjavaw.exe
Adding VM config
•
•
•
•

Open eclipse.ini in the eclipse folder
Add below lines before -vmargs
-vm
C:Javajdk1.7.0_40binjavaw.exe
Sign in to Deploy
Setting App ID & Version

Input Application Identifier
registered at appspot.com
Refactor Example to MVC
• Using JSP as View template
– JSP files will resides inside ‘WEB-INF/jsp’ folder
– So users can not access our template directly

• Using Servlet as Controller
– Put model in request attribute
– Forward to proper View
– Change SignGuestbookServlet.java so it redirect to
servlet (not JSP):
resp.sendRedirect("/guestbook?guestbookName=" + guestbookName);
GuestbookServlet.java – doGet()
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();

String signUrl = "";
String userNickname = "";
if (user!=null) {
signUrl = userService.createLogoutURL(req.getRequestURI());
userNickname = user.getNickname();
} else {
signUrl = userService.createLoginURL(req.getRequestURI());
}

Login or Logout URL

String guestbookName = req.getParameter("guestbookName");
if (guestbookName == null) {
guestbookName = "default";
}

Retrieve data from

DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
datastore
Key guestbookKey = KeyFactory.createKey("Guestbook", guestbookName);
Query query = new Query("Greeting", guestbookKey).addSort("date", Query.SortDirection.DESCENDING);
List<Entity> greetings = datastore.prepare(query).asList(FetchOptions.Builder.withLimit(5));
// put data tobe displayed in JSP
req.setAttribute("signUrl", signUrl);
req.setAttribute("userNickname", userNickname);
req.setAttribute("guestbookName", guestbookName);
req.setAttribute("greetingList", greetings);

Put data in Request
Attribute

String templateFile = "/WEB-INF/jsp/guestbook.jsp";
RequestDispatcher rd = getServletContext().getRequestDispatcher(templateFile);
rd.forward(req, resp);

Forward to View
/WEB-INF/jsp/guestbook.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

Taglib

<html>
<head>
<link type="text/css" rel="stylesheet" href="/stylesheets/main.css" />
</head>
<body>
<c:if test="${userNickname!=''}">
<p>Hello, ${fn:escapeXml(userNickname)}! (You can <a href="${signUrl}">sign
out</a>.)</p>
Say proper hello to
</c:if>
sign in user
<c:if test="${userNickname==''}">
<p>Hello!
<a href="${signUrl}">Sign in</a> to include your name with greetings you post.</p>
</c:if>
<c:if test="${empty greetingList}">
<p>Guestbook '${fn:escapeXml(guestbookName)}' has no messages.</p>
</c:if>
<c:if test="${not empty greetingList}">
<p>Messages in Guestbook '${fn:escapeXml(guestbookName)}'.</p>
</c:if>
/WEB-INF/jsp/guestbook.jsp
Iterate Greeting List
<c:forEach items="${greetingList}" var="greeting">
Passed from Servlet
<c:if test="${not empty greeting.properties['user']}">
<p><b>${fn:escapeXml(greeting.properties['user'].nickname)}</b> wrote:</p>
</c:if>
<c:if test="${empty greeting.properties['user']}">
<p>An anonymous person wrote:</p>
</c:if>
<blockquote>${fn:escapeXml(greeting.properties['content'])}</blockquote>
</c:forEach>
Form same as
previous

<form action="/sign" method="post">
<div><textarea name="content" rows="3" cols="60"></textarea></div>
<div><input type="submit" value="Post Greeting" /></div>
<input type="hidden" name="guestbookName"
value="${fn:escapeXml(guestbookName)}"/>
</form>

</body>
</html>
Maybe Next Time
• Using Guice in GAE/J
• Using GAE Python
Reference
• http://www.slideshare.net/dimityrdanailov/google-app-enginevarna-lab-19062013
• http://www.slideshare.net/LarsVogel/google-app-engine-for-java7698966
• http://www.google.com/events/io/2009/sessions.html#appengine
• http://www.google.com/events/io/2010/sessions.html#App%20Eng
ine
• http://www.google.com/events/io/2011/sessions.html#appengine-track
• https://developers.google.com/events/io/2012/sessions#cloudplatform
• https://developers.google.com/events/io/2013/sessions#t-googlecloud-platform
• https://developers.google.com/appengine/
Thanks
• SRIN Members
About
• https://sites.google.com/site/meetnasrul/

Más contenido relacionado

La actualidad más candente

How to Puppetize Google Cloud Platform - PuppetConf 2014
How to Puppetize Google Cloud Platform - PuppetConf 2014How to Puppetize Google Cloud Platform - PuppetConf 2014
How to Puppetize Google Cloud Platform - PuppetConf 2014Puppet
 
MongoDB Days UK: Run MongoDB on Google Cloud Platform
MongoDB Days UK: Run MongoDB on Google Cloud PlatformMongoDB Days UK: Run MongoDB on Google Cloud Platform
MongoDB Days UK: Run MongoDB on Google Cloud PlatformMongoDB
 
Introduction to Google Compute Engine
Introduction to Google Compute EngineIntroduction to Google Compute Engine
Introduction to Google Compute EngineColin Su
 
Building hybrid cloud with cloudify (public)
Building hybrid cloud with cloudify (public)Building hybrid cloud with cloudify (public)
Building hybrid cloud with cloudify (public)Nati Shalom
 
Best Practices for couchDB developers on Microsoft Azure
Best Practices for couchDB developers on Microsoft AzureBest Practices for couchDB developers on Microsoft Azure
Best Practices for couchDB developers on Microsoft AzureBrian Benz
 
AWS as platform for scalable applications
AWS as platform for scalable applicationsAWS as platform for scalable applications
AWS as platform for scalable applicationsRoman Gomolko
 
Automatically scaling your Kubernetes workloads - SVC201-S - Chicago AWS Summit
Automatically scaling your Kubernetes workloads - SVC201-S - Chicago AWS SummitAutomatically scaling your Kubernetes workloads - SVC201-S - Chicago AWS Summit
Automatically scaling your Kubernetes workloads - SVC201-S - Chicago AWS SummitAmazon Web Services
 
Google Cloud Platform as a Backend Solution for your Product
Google Cloud Platform as a Backend Solution for your ProductGoogle Cloud Platform as a Backend Solution for your Product
Google Cloud Platform as a Backend Solution for your ProductSergey Smetanin
 
Google Cloud Platform Special Training
Google Cloud Platform Special TrainingGoogle Cloud Platform Special Training
Google Cloud Platform Special TrainingSimon Su
 
AutoScaling and Drupal
AutoScaling and DrupalAutoScaling and Drupal
AutoScaling and DrupalPromet Source
 
Scaling Drupal & Deployment in AWS
Scaling Drupal & Deployment in AWSScaling Drupal & Deployment in AWS
Scaling Drupal & Deployment in AWS永对 陈
 
Amazon Web Services Building Blocks for Drupal Applications and Hosting
Amazon Web Services Building Blocks for Drupal Applications and HostingAmazon Web Services Building Blocks for Drupal Applications and Hosting
Amazon Web Services Building Blocks for Drupal Applications and HostingAcquia
 
A Tour of Google Cloud Platform
A Tour of Google Cloud PlatformA Tour of Google Cloud Platform
A Tour of Google Cloud PlatformColin Su
 
Introduction to Google Cloud Platform
Introduction to Google Cloud PlatformIntroduction to Google Cloud Platform
Introduction to Google Cloud PlatformOpsta
 
Infrastructure as Code for Beginners
Infrastructure as Code for BeginnersInfrastructure as Code for Beginners
Infrastructure as Code for BeginnersDavid Völkel
 
Deep Learning on AWS (November 2016)
Deep Learning on AWS (November 2016)Deep Learning on AWS (November 2016)
Deep Learning on AWS (November 2016)Julien SIMON
 
Autoscaling in kubernetes v1
Autoscaling in kubernetes v1Autoscaling in kubernetes v1
Autoscaling in kubernetes v1JurajHantk
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...Amazon Web Services
 

La actualidad más candente (20)

How to Puppetize Google Cloud Platform - PuppetConf 2014
How to Puppetize Google Cloud Platform - PuppetConf 2014How to Puppetize Google Cloud Platform - PuppetConf 2014
How to Puppetize Google Cloud Platform - PuppetConf 2014
 
MongoDB Days UK: Run MongoDB on Google Cloud Platform
MongoDB Days UK: Run MongoDB on Google Cloud PlatformMongoDB Days UK: Run MongoDB on Google Cloud Platform
MongoDB Days UK: Run MongoDB on Google Cloud Platform
 
Introduction to Google Compute Engine
Introduction to Google Compute EngineIntroduction to Google Compute Engine
Introduction to Google Compute Engine
 
Building hybrid cloud with cloudify (public)
Building hybrid cloud with cloudify (public)Building hybrid cloud with cloudify (public)
Building hybrid cloud with cloudify (public)
 
Best Practices for couchDB developers on Microsoft Azure
Best Practices for couchDB developers on Microsoft AzureBest Practices for couchDB developers on Microsoft Azure
Best Practices for couchDB developers on Microsoft Azure
 
AWS as platform for scalable applications
AWS as platform for scalable applicationsAWS as platform for scalable applications
AWS as platform for scalable applications
 
Automatically scaling your Kubernetes workloads - SVC201-S - Chicago AWS Summit
Automatically scaling your Kubernetes workloads - SVC201-S - Chicago AWS SummitAutomatically scaling your Kubernetes workloads - SVC201-S - Chicago AWS Summit
Automatically scaling your Kubernetes workloads - SVC201-S - Chicago AWS Summit
 
Google Cloud Platform as a Backend Solution for your Product
Google Cloud Platform as a Backend Solution for your ProductGoogle Cloud Platform as a Backend Solution for your Product
Google Cloud Platform as a Backend Solution for your Product
 
Google Cloud Platform Special Training
Google Cloud Platform Special TrainingGoogle Cloud Platform Special Training
Google Cloud Platform Special Training
 
AutoScaling and Drupal
AutoScaling and DrupalAutoScaling and Drupal
AutoScaling and Drupal
 
Scaling Drupal & Deployment in AWS
Scaling Drupal & Deployment in AWSScaling Drupal & Deployment in AWS
Scaling Drupal & Deployment in AWS
 
Amazon Web Services Building Blocks for Drupal Applications and Hosting
Amazon Web Services Building Blocks for Drupal Applications and HostingAmazon Web Services Building Blocks for Drupal Applications and Hosting
Amazon Web Services Building Blocks for Drupal Applications and Hosting
 
A Tour of Google Cloud Platform
A Tour of Google Cloud PlatformA Tour of Google Cloud Platform
A Tour of Google Cloud Platform
 
infrastructure as code
infrastructure as codeinfrastructure as code
infrastructure as code
 
Introduction to Google Cloud Platform
Introduction to Google Cloud PlatformIntroduction to Google Cloud Platform
Introduction to Google Cloud Platform
 
Infrastructure as Code for Beginners
Infrastructure as Code for BeginnersInfrastructure as Code for Beginners
Infrastructure as Code for Beginners
 
Deep Learning on AWS (November 2016)
Deep Learning on AWS (November 2016)Deep Learning on AWS (November 2016)
Deep Learning on AWS (November 2016)
 
Autoscaling in kubernetes v1
Autoscaling in kubernetes v1Autoscaling in kubernetes v1
Autoscaling in kubernetes v1
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
 
Cloud hosting survey
Cloud hosting surveyCloud hosting survey
Cloud hosting survey
 

Destacado

Google App Engine: An Introduction
Google App Engine: An IntroductionGoogle App Engine: An Introduction
Google App Engine: An IntroductionAbu Ashraf Masnun
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Enginerajdeep
 
Google app engine
Google app engineGoogle app engine
Google app engineRenjith318
 
App Engine Overview @ Google Hackathon SXSW 2010
App Engine Overview @ Google Hackathon SXSW 2010App Engine Overview @ Google Hackathon SXSW 2010
App Engine Overview @ Google Hackathon SXSW 2010Chris Schalk
 
Google app engine introduction
Google app engine introductionGoogle app engine introduction
Google app engine introductionrajsandhu1989
 
Google app engine - Overview
Google app engine - OverviewGoogle app engine - Overview
Google app engine - OverviewNathan Quach
 
Google app engine
Google app engineGoogle app engine
Google app engineSuraj Mehta
 
Google app engine
Google app engineGoogle app engine
Google app engineSuraj Mehta
 
Download presentation
Download presentationDownload presentation
Download presentationwebhostingguy
 
Best topics for seminar
Best topics for seminarBest topics for seminar
Best topics for seminarshilpi nagpal
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksSlideShare
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShareSlideShare
 

Destacado (15)

Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
Google App Engine: An Introduction
Google App Engine: An IntroductionGoogle App Engine: An Introduction
Google App Engine: An Introduction
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
 
Google app engine
Google app engineGoogle app engine
Google app engine
 
App Engine Overview @ Google Hackathon SXSW 2010
App Engine Overview @ Google Hackathon SXSW 2010App Engine Overview @ Google Hackathon SXSW 2010
App Engine Overview @ Google Hackathon SXSW 2010
 
Google app engine introduction
Google app engine introductionGoogle app engine introduction
Google app engine introduction
 
Google app engine - Overview
Google app engine - OverviewGoogle app engine - Overview
Google app engine - Overview
 
Google app engine
Google app engineGoogle app engine
Google app engine
 
Google app engine
Google app engineGoogle app engine
Google app engine
 
Cse ppt
Cse pptCse ppt
Cse ppt
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
 
Download presentation
Download presentationDownload presentation
Download presentation
 
Best topics for seminar
Best topics for seminarBest topics for seminar
Best topics for seminar
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & Tricks
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 

Similar a Google App Engine overview (GAE/J)

Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineIMC Institute
 
ASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesEamonn Boyle
 
Enabling .NET Apps with Monitoring and Management Using Steeltoe
Enabling .NET Apps with Monitoring and Management Using SteeltoeEnabling .NET Apps with Monitoring and Management Using Steeltoe
Enabling .NET Apps with Monitoring and Management Using SteeltoeVMware Tanzu
 
Deploying applications to Cloud with Google App Engine
Deploying applications to Cloud with Google App EngineDeploying applications to Cloud with Google App Engine
Deploying applications to Cloud with Google App EngineAlexander Zamkovyi
 
Mobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesMobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesAndrew Ferrier
 
SPEC INDIA Java Case Study
SPEC INDIA Java Case StudySPEC INDIA Java Case Study
SPEC INDIA Java Case StudySPEC INDIA
 
Modernize Java Apps on Microsoft Azure
Modernize Java Apps on Microsoft AzureModernize Java Apps on Microsoft Azure
Modernize Java Apps on Microsoft AzureDavid J Rosenthal
 
Java Web Programming Using Cloud Platform: Module 10
Java Web Programming Using Cloud Platform: Module 10Java Web Programming Using Cloud Platform: Module 10
Java Web Programming Using Cloud Platform: Module 10IMC Institute
 
Azure Cloud Application Development Workshop - UGIdotNET
Azure Cloud Application Development Workshop - UGIdotNETAzure Cloud Application Development Workshop - UGIdotNET
Azure Cloud Application Development Workshop - UGIdotNETLorenzo Barbieri
 
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud EnvironmentsTools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud EnvironmentsVMware Tanzu
 
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)Daniel Bryant
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundryrajdeep
 
Made for Mobile - Let Office 365 Power Your Mobile Apps
Made for Mobile - Let Office 365 Power Your Mobile AppsMade for Mobile - Let Office 365 Power Your Mobile Apps
Made for Mobile - Let Office 365 Power Your Mobile AppsSPC Adriatics
 
Connecting Xamarin Apps with IBM Worklight in Bluemix
Connecting Xamarin Apps with IBM Worklight in BluemixConnecting Xamarin Apps with IBM Worklight in Bluemix
Connecting Xamarin Apps with IBM Worklight in BluemixIBM
 
Azure Serverless Toolbox
Azure Serverless ToolboxAzure Serverless Toolbox
Azure Serverless ToolboxJohan Eriksson
 

Similar a Google App Engine overview (GAE/J) (20)

Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
 
ASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesASP .Net Core SPA Templates
ASP .Net Core SPA Templates
 
Enabling .NET Apps with Monitoring and Management Using Steeltoe
Enabling .NET Apps with Monitoring and Management Using SteeltoeEnabling .NET Apps with Monitoring and Management Using Steeltoe
Enabling .NET Apps with Monitoring and Management Using Steeltoe
 
Azure web apps
Azure web appsAzure web apps
Azure web apps
 
Deploying applications to Cloud with Google App Engine
Deploying applications to Cloud with Google App EngineDeploying applications to Cloud with Google App Engine
Deploying applications to Cloud with Google App Engine
 
Mobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesMobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best Practices
 
Chinnasamy Manickam
Chinnasamy ManickamChinnasamy Manickam
Chinnasamy Manickam
 
SPEC INDIA Java Case Study
SPEC INDIA Java Case StudySPEC INDIA Java Case Study
SPEC INDIA Java Case Study
 
Modernize Java Apps on Microsoft Azure
Modernize Java Apps on Microsoft AzureModernize Java Apps on Microsoft Azure
Modernize Java Apps on Microsoft Azure
 
Java Web Programming Using Cloud Platform: Module 10
Java Web Programming Using Cloud Platform: Module 10Java Web Programming Using Cloud Platform: Module 10
Java Web Programming Using Cloud Platform: Module 10
 
Azure Cloud Application Development Workshop - UGIdotNET
Azure Cloud Application Development Workshop - UGIdotNETAzure Cloud Application Development Workshop - UGIdotNET
Azure Cloud Application Development Workshop - UGIdotNET
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
 
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud EnvironmentsTools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
 
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
 
Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundry
 
Made for Mobile - Let Office 365 Power Your Mobile Apps
Made for Mobile - Let Office 365 Power Your Mobile AppsMade for Mobile - Let Office 365 Power Your Mobile Apps
Made for Mobile - Let Office 365 Power Your Mobile Apps
 
Connecting Xamarin Apps with IBM Worklight in Bluemix
Connecting Xamarin Apps with IBM Worklight in BluemixConnecting Xamarin Apps with IBM Worklight in Bluemix
Connecting Xamarin Apps with IBM Worklight in Bluemix
 
Azure Serverless Toolbox
Azure Serverless ToolboxAzure Serverless Toolbox
Azure Serverless Toolbox
 
Sug bangalore - headless jss
Sug bangalore - headless jssSug bangalore - headless jss
Sug bangalore - headless jss
 
Azure App Services
Azure App ServicesAzure App Services
Azure App Services
 

Último

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Último (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Google App Engine overview (GAE/J)

  • 1. GAE Overview Moch Nasrullah R Samsung R&D Institute Indonesia (SRIN) November 2013
  • 4. Cloud Computing Cloud Services Cloud Clients (Web browser, Desktop App, Mobile App, embeded, ...)
  • 6. Cloud classification Software as a Service (SaaS) Application: -Web Apps -Desktop Apps -Mobile Apps (Google Apps, Google Translate, Office 360, NetSuite, IBM Lotus Live, GitHub) Platform as a Service (PaaS) Development Platform + Runtime Tools + Environment (Google App Engine, Heroku, Windows Azure, force.com, Rollbase) Infrastructure as a Service (IaaS) CPU Networks Data Storage (AWS, VM Ware, Joyent, Rackspace)
  • 7. Google App Engine • run your web applications on Google's infrastructure – Google handles the maintenance infrasturcture: hardware failures, security patches, OS upgrades • Free ... within quota
  • 8. GAE Limits & Quota • • • • 10 Apps per user 5 Mio pageview free per month 6.5 hours of CPU and 1 Gb in & out traffic https://developers.google.com/appengine/do cs/quotas
  • 9. Why GAE • Easy to build – Language support (Java, Python, GO, PHP) – Automatic scaling & load balancing • Easy to maintain – Web based admin dashboard • Easy to scale (traffic & data storage) – GAE Datastore – Google Cloud SQL – Google Cloud Storage
  • 11. Let’s give it a try • Follow the getting started in link below: • https://developers.google.com/appengine/docs/java/gettingstarted/introduction
  • 12. Run Eclipse after Installing JDK
  • 17. The Servlet Class package guestbook; import java.io.IOException; import javax.servlet.http.*; public class GuestbookServlet extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setContentType("text/plain"); resp.getWriter().println("Hello, world"); } }
  • 18. Project Structure Java source code other configuration JARs for libraries app configuration JSPs, images, data files
  • 20. Preparation for deployment • Register to Google App Engine • Create an Application • Deploy via Eclipse
  • 21. Register to App Engine • Register at: https://appengine.google.com/ • Create an Application
  • 22. Create an Application • For now, just fill in ‘Application Identifier’ and ‘Application Title’, than accept ‘Term of Service’
  • 23. Problem when Deploying • Adding VM config o Open eclipse.ini in the eclipse folder o Add below lines before -vmargs -vm C:Javajdk1.7.0_40binjavaw.exe
  • 24. Adding VM config • • • • Open eclipse.ini in the eclipse folder Add below lines before -vmargs -vm C:Javajdk1.7.0_40binjavaw.exe
  • 25. Sign in to Deploy
  • 26. Setting App ID & Version Input Application Identifier registered at appspot.com
  • 27. Refactor Example to MVC • Using JSP as View template – JSP files will resides inside ‘WEB-INF/jsp’ folder – So users can not access our template directly • Using Servlet as Controller – Put model in request attribute – Forward to proper View – Change SignGuestbookServlet.java so it redirect to servlet (not JSP): resp.sendRedirect("/guestbook?guestbookName=" + guestbookName);
  • 28. GuestbookServlet.java – doGet() UserService userService = UserServiceFactory.getUserService(); User user = userService.getCurrentUser(); String signUrl = ""; String userNickname = ""; if (user!=null) { signUrl = userService.createLogoutURL(req.getRequestURI()); userNickname = user.getNickname(); } else { signUrl = userService.createLoginURL(req.getRequestURI()); } Login or Logout URL String guestbookName = req.getParameter("guestbookName"); if (guestbookName == null) { guestbookName = "default"; } Retrieve data from DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); datastore Key guestbookKey = KeyFactory.createKey("Guestbook", guestbookName); Query query = new Query("Greeting", guestbookKey).addSort("date", Query.SortDirection.DESCENDING); List<Entity> greetings = datastore.prepare(query).asList(FetchOptions.Builder.withLimit(5)); // put data tobe displayed in JSP req.setAttribute("signUrl", signUrl); req.setAttribute("userNickname", userNickname); req.setAttribute("guestbookName", guestbookName); req.setAttribute("greetingList", greetings); Put data in Request Attribute String templateFile = "/WEB-INF/jsp/guestbook.jsp"; RequestDispatcher rd = getServletContext().getRequestDispatcher(templateFile); rd.forward(req, resp); Forward to View
  • 29. /WEB-INF/jsp/guestbook.jsp <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> Taglib <html> <head> <link type="text/css" rel="stylesheet" href="/stylesheets/main.css" /> </head> <body> <c:if test="${userNickname!=''}"> <p>Hello, ${fn:escapeXml(userNickname)}! (You can <a href="${signUrl}">sign out</a>.)</p> Say proper hello to </c:if> sign in user <c:if test="${userNickname==''}"> <p>Hello! <a href="${signUrl}">Sign in</a> to include your name with greetings you post.</p> </c:if> <c:if test="${empty greetingList}"> <p>Guestbook '${fn:escapeXml(guestbookName)}' has no messages.</p> </c:if> <c:if test="${not empty greetingList}"> <p>Messages in Guestbook '${fn:escapeXml(guestbookName)}'.</p> </c:if>
  • 30. /WEB-INF/jsp/guestbook.jsp Iterate Greeting List <c:forEach items="${greetingList}" var="greeting"> Passed from Servlet <c:if test="${not empty greeting.properties['user']}"> <p><b>${fn:escapeXml(greeting.properties['user'].nickname)}</b> wrote:</p> </c:if> <c:if test="${empty greeting.properties['user']}"> <p>An anonymous person wrote:</p> </c:if> <blockquote>${fn:escapeXml(greeting.properties['content'])}</blockquote> </c:forEach> Form same as previous <form action="/sign" method="post"> <div><textarea name="content" rows="3" cols="60"></textarea></div> <div><input type="submit" value="Post Greeting" /></div> <input type="hidden" name="guestbookName" value="${fn:escapeXml(guestbookName)}"/> </form> </body> </html>
  • 31. Maybe Next Time • Using Guice in GAE/J • Using GAE Python
  • 32. Reference • http://www.slideshare.net/dimityrdanailov/google-app-enginevarna-lab-19062013 • http://www.slideshare.net/LarsVogel/google-app-engine-for-java7698966 • http://www.google.com/events/io/2009/sessions.html#appengine • http://www.google.com/events/io/2010/sessions.html#App%20Eng ine • http://www.google.com/events/io/2011/sessions.html#appengine-track • https://developers.google.com/events/io/2012/sessions#cloudplatform • https://developers.google.com/events/io/2013/sessions#t-googlecloud-platform • https://developers.google.com/appengine/