SlideShare a Scribd company logo
Google App Engine
Assoc.Prof. Dr.Thanachart Numnonda
 Asst.Prof. Thanisa Kruawaisayawan

        www.imcinstitute.com
             July 2012
Agenda
What is Cloud Computing?

What is Google App Engine?

Google App Engine for Java

Google App Engine Development cycle
What is Cloud Computing?
Cloud computing : Definition (Wikipedia)

   Cloud Computing is Internet-based computing,
whereby shared resources, software, and information
  are provided to computers and other devices on
          demand, like the electricity grid.
Cloud computing characteristics
Massive, abstracted infrastructure
Dynamic allocation, scaling, movement of applications
Pay per use
No long-term commitments
OS, application architecture independent
No hardware or software to install
Grid to Cloud Evolution
Web 2.0 & Cloud Computing
Web 2,0 concentrate on the private user and clouds
 are decscendents of data centers which services the
 enterprise
Web 2.0 promote SaaS
Web 2.0 needs massive scaling technologies
User centric Web 2.0 companies (Twitter, Slideshare)
 are relying on Cloud Services
ISP to Cloud Evolution
Software as a Service (SaaS)
SaaS is at the highest layer and features a complete
 application offered as a service, on-demand,
via multitenancy — meaning a single instance of the
 software runs on the provider’s infrastructure and
 serves multiple client organizations.
Platform as a Service (PaaS)
The middle layer, or PaaS, is the encapsulation of a
 development environment abstraction and the
 packaging of a payload of services
PaaS offerings can provide for every phase of software
 development and testing, or they can be specialized
 around a particular area, such as content management
Infrastructure as a Service (IaaS)
IaaS is at the lowest layer and is a means of delivering basic
 storage and compute capabilities as standardized services
 over the network.
Servers, storage systems, switches,routers, and other
 systems are pooled (through virtualization technology, for
 example) to handle specific types of workloads — from batch
 processing to server/storage augmentation during peak loads.
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Deployment Model
Public Cloud: provider refers to the cloud platform that
 targets any types of customers.
Private Cloud: infrastructure that’s hosted internally, targeting
 specific customers or sometimes exclusively within an
 organization.
Hybrid Cloud: the combination of public and private clouds,
 or sometimes on-premise services.
IaaS & PaaS: Developer's Perspectives
IaaS normally provides up to O/S level as your choice; for
 example Amazon Web Services (AWS) offers several types of
 Operating Systems such as Windows Server, Linux SUSE, and
 Linux Red Hat. Developer need to install own middleware,
 database, etc.
PaaS, given that the database server, VM, and web server VM
 are readily provisioned,
Setting Up App in IaaS




Source:http://acloudyplace.com/2012/01/comparing-iaas-and-paas-a-developers-perspective/
Setting Up App in PaaS




Source:http://acloudyplace.com/2012/01/comparing-iaas-and-paas-a-developers-perspective/
PaaS for Java
Amazon Elastic Beanstalk
CloudBees
Cloud Foundry
Google App Engine
Heroku for Java
Red Hat OpenShift
PaaS for Java: Comparison
PaaS for Java: Comparison




Source: http://www.infoq.com/articles/paas_comparison
What is Google App Engine?
Google App Engine : Definition (Wikipedia)

It is a platform for hosting web applications in Google-
      managed data centers. It is cloud computing
    technology which virtualizes applications across
            multiple servers and data centers.
Google App Engine
Running your web application in Google infrastructure
Support different runtime environments
  Java (JRE 6 with limitation, Servlet 2.5, JDO, JPA)
  Python (2.5.2)
Apps run in sandbox.
Automatic scaling and load balancing
No server restart, no network issues
Hosting Java web apps traditionally
Not so popular except enterprise
High rates as compared to PHP hosting
Shared Tomcat instance among users
Restrictions on any time deployments due to shared
 server
Dedicated hosts works fine but they are costly
You end up with all this
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Google Datacenters at Dallas, Oregon
GAE Architecture
GAE Physical Deployment Diagram
Architecture : Application Server
Distributed web hosting platform
Distributed Datastore
Distributed memcache
Specialized services
Google Apps + your apps
Google App Engine for Java
GAE/J
Was released on April 08 with Python support. Java
 included on August 09
App Engine for Java : One Year




Source: What’s Hot in Java for App Engine Google Con 2010
GAE Java Runtime Environment
Java 6 VM
Servlet 2.5 Container
HTTP Session support (need to enable explicitly)
JDO/JPA for Datastore API
JSR 107 for Memcache API
javax.mail for Mail API
javax.net.URLConnection for URLFetch API
Java Standards on GAE
Services by App Engine
Memcache API – high performance in-memory key-value cache
Datastore – database storage and operations
URLFetch – invoking external URLs
Mail – sending mail from your application
Task Queues – for invoking background processes
Images – for image manipulation
Cron Jobs – scheduled tasks on defined time
User Accounts – using Google accounts for authentication
Limitations
Programming Model : Application runs in sandbox and
 can not
  Write to file system
  Make arbitrary network connections
  Use multiple threads/processes
  Perform long-lasting processing
  Permissions
  Know about other instances/applications
Quotas (Requests, In/Out bandwidth, CPU time, API
 calls)
GAE Datastore
GAE Datastore
Storing data and manipulation
Based on Bigtable
Bigtable is proprietary and hidden from the app developers
Not a relational database (No SQL)
GQL (Google Query Language) to query
Stores data as entities
Distribution, replication, load balancing behind the scene
Need to use JDO/JPA
User Service : Google Accounts
Google Accounts are encouraged as the preferred
 authentication mechanism for App Engine
   – It assumes that all users have a Google Account
   – Google authentication for private domains isn’t available yet
Access to Google account data -> email, id
The Development Server simulates Google Accounts
Access constraints based on roles
User API : Example
import com.google.appengine.api.users.*;
 import com.google.appengine.api.users.*;

UserService userService == UserServiceFactory.getUserService();
 UserService userService    UserServiceFactory.getUserService();
User user == userService.getCurrentUser();
 User user    userService.getCurrentUser();
String navBar;
 String navBar;
if (user == null) {{
 if (user == null)
     navBar == "<p>Welcome! <a href="" ++ userService.createLoginURL("/")
      navBar    "<p>Welcome! <a href=""    userService.createLoginURL("/")
     +"">Sign in or register</a> to customize.</p>";
      +"">Sign in or register</a> to customize.</p>";
}} else {{
    else
    navBar == "<p>Welcome, "" ++ user.getEmail() ++ "! You can <a href=""
     navBar    "<p>Welcome,       user.getEmail()    "! You can <a href=""
    +userService.createLogoutURL("/") +"">sign out</a>.</p>";
     +userService.createLogoutURL("/") +"">sign out</a>.</p>";
}}
URLFetch API
Invoking external URLs from your application over HTTP and
 HTTPs
import java.net.*;
 import java.net.*;
import java.io.*;
 import java.io.*;

URL url == new URL("htp://...");
 URL url    new URL("htp://...");
InputStream inp == new InputStreamReader(url.openStream());
 InputStream inp    new InputStreamReader(url.openStream());
BufferedReader reader == new BufferedReader(inp);
 BufferedReader reader    new BufferedReader(inp);
String line;
 String line;
while ((line == reader.readLine()) != null) {{
 while ((line    reader.readLine()) != null)
 //do something
  //do something
}}
reader.close();
 reader.close();
Mail API
Send emails on the behalf of app administrator to the Google
 account use.
You can not receive emails
import javax.mail.*;
 import javax.mail.*;

Session session == Session.getDefaultInstance(new Properties(), null);
 Session session    Session.getDefaultInstance(new Properties(), null);
InternetAddress admins == new InternetAddress("admins");
 InternetAddress admins    new InternetAddress("admins");
Message msg == new MimeMessage(session);
 Message msg    new MimeMessage(session);
msg.setFrom(admins);
 msg.setFrom(admins);
msg.addRecipient(Message.RecipientType.TO, admins);
 msg.addRecipient(Message.RecipientType.TO, admins);
msg.setSubject("subject");
 msg.setSubject("subject");
msg.setText("text");
 msg.setText("text");

Transport.send(msg);
 Transport.send(msg);
Memcache Service
Distributed in memory cache, better than DataStore
Key-value pair mapping
Configurable expiration time but
Unreliable might be vanished at any time
Supported Interfaces :
   – JACHE (JSR 107: JCACHE – Java Temporary Caching API)
   – The Low-Level Memcache API
Memcache API : Example

import static java.util.Collections.emptyMap;
 import static java.util.Collections.emptyMap;
import javax.cache.*;
 import javax.cache.*;

CacheFactory cacheFactory == CacheManager.getInstance().getCacheFactory();
 CacheFactory cacheFactory    CacheManager.getInstance().getCacheFactory();

Cache cache == cacheFactory.createCache(emptyMap());
 Cache cache    cacheFactory.createCache(emptyMap());

cache.put(key, value);
 cache.put(key, value);
cache.get(key);
 cache.get(key);
Task Queues API
Perform background processes by inserting tasks into queues.
Instructions need to be mention in file queue.xml, in the WEB-INF/ dir

import com.google.appengine.api.labs.taskqueue.Queue;
 import com.google.appengine.api.labs.taskqueue.Queue;
import com.google.appengine.api.labs.taskqueue.QueueFactory;
 import com.google.appengine.api.labs.taskqueue.QueueFactory;
import com.google.appengine.api.labs.taskqueue.TaskOptions;
 import com.google.appengine.api.labs.taskqueue.TaskOptions;

// ...
 // ...
TaskOptions taskOptions ==
 TaskOptions taskOptions
TaskOptions.Builder.url("/send_invitation_task")
 TaskOptions.Builder.url("/send_invitation_task")
   .param("address", "juliet@example.com")
    .param("address", "juliet@example.com")
   .param("firstname", "Juliet");
    .param("firstname", "Juliet");
Queue queue == QueueFactory.getDefaultQueue();
 Queue queue    QueueFactory.getDefaultQueue();
queue.add(taskOptions);
 queue.add(taskOptions);
Cron Jobs
Up to 20 scheduled tasks per app
Cron jobs (scheduled tasks) supported in cron.xml in WEB-INF dir
Schedule instructions contain Englis-like format
<?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
<cronentries>
 <cronentries>
<cron>
 <cron>
<url>/listbooks</url>
 <url>/listbooks</url>
<description>Repopulate the cache every day at
 <description>Repopulate the cache every day at
5am</description>
 5am</description>
<schedule>every day 05:00</schedule>
 <schedule>every day 05:00</schedule>
</cron>
 </cron>
</cronentries>
 </cronentries>
Images API
Manipulation of images
Transformation of images
Changing image formats
GAE Development Cycle
GAE Development Cycle
Getting Started
The application owner must have a Google Account to
 get the tools regardless of language.
Use Java 6 for development.
Eclipse and Netbeans have official plugins.
Both SDKs ship with a Development Web Server that
 runs locally and provides a sandbox almost identical to
 the real run-time.
Software Development Kit
App Engine SDK
  – Includes web server (Jetty)
  – Emulates all the GAE services
SDK includes an upload tool to deploy app to GAE
Command line tools included.
Google Plugin for Eclipse
Development Environment
Development Server
Application lifecycle
 management
Eclipse/NetBeans plugins /
 Firefox plugin (GWT).
Google Plugin for Eclipse
Development Server
   http://localhost:8888
Development Server Admin Console
       http://localhost:8888/_ah/admin
Deployment Environment
Application is deployed as .war which contains.
Deployment is integrated in IDE
Deploy multiple version of the application at the same
 time
Your app lives at
   – <app_id>.appspot.com or
   – Custom domain with Google Apps
Running your app on Google
http://<version>.<appid>.appspot.com/some/path
Managing Applications
Administration Console
 http://appengine.google.com/a/yourdomain.com
Application Dashboard
Multiple application versions
Analyzing log files (including admin)
Analyzing resource usag
GAE Dashboard
Resources
Google App Engine at a glance, Stefan Christoph
Developing Java Based Web Applications in
Google App Engine, Tahir Akram, Dec. 2009
Google App Engine, Patrick Chanezon, Mar 2010
Thank you

   thananum@gmail.com
www.facebook.com/imcinstitute
   www.imcinstitute.com

More Related Content

What's hot (20)

ODP
Java Spring MVC Framework with AngularJS by Google and HTML5
Tuna Tore
 
PDF
Spring mvc
Guo Albert
 
PPTX
Meteor Meet-up San Diego December 2014
Lou Sacco
 
PDF
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
SPTechCon
 
PDF
How to Webpack your Django!
David Gibbons
 
PPTX
Spring MVC
Emprovise
 
PDF
Spring as a Cloud Platform (Developer Summit 2011 17-C-5)
Kazuyuki Kawamura
 
PDF
The Role of Python in SPAs (Single-Page Applications)
David Gibbons
 
PPTX
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Atlassian
 
PDF
netbeans
tutorialsruby
 
PPTX
ADF Gold Nuggets (Oracle Open World 2011)
Lucas Jellema
 
PDF
An Introduction to Django Web Framework
David Gibbons
 
PPTX
4. jsp
AnusAhmad
 
PPTX
Google app engine by example
Alexander Zamkovyi
 
PPTX
Deploying applications to Cloud with Google App Engine
Alexander Zamkovyi
 
PPT
Struts N E W
patinijava
 
PDF
Android intents-3 www.j2program.blogspot.com
Mohamed Rimzan
 
PPT
CTS Conference Web 2.0 Tutorial Part 2
Geoffrey Fox
 
PPT
Programming Server side with Sevlet
backdoor
 
PPTX
REST Architecture with use case and example
Shailesh singh
 
Java Spring MVC Framework with AngularJS by Google and HTML5
Tuna Tore
 
Spring mvc
Guo Albert
 
Meteor Meet-up San Diego December 2014
Lou Sacco
 
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
SPTechCon
 
How to Webpack your Django!
David Gibbons
 
Spring MVC
Emprovise
 
Spring as a Cloud Platform (Developer Summit 2011 17-C-5)
Kazuyuki Kawamura
 
The Role of Python in SPAs (Single-Page Applications)
David Gibbons
 
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Atlassian
 
netbeans
tutorialsruby
 
ADF Gold Nuggets (Oracle Open World 2011)
Lucas Jellema
 
An Introduction to Django Web Framework
David Gibbons
 
4. jsp
AnusAhmad
 
Google app engine by example
Alexander Zamkovyi
 
Deploying applications to Cloud with Google App Engine
Alexander Zamkovyi
 
Struts N E W
patinijava
 
Android intents-3 www.j2program.blogspot.com
Mohamed Rimzan
 
CTS Conference Web 2.0 Tutorial Part 2
Geoffrey Fox
 
Programming Server side with Sevlet
backdoor
 
REST Architecture with use case and example
Shailesh singh
 

Viewers also liked (6)

PDF
๋Java Web Programming on Cloud Computing using Google App Engine
IMC Institute
 
PDF
App Engine Overview @ Google Hackathon SXSW 2010
Chris Schalk
 
PDF
วิธีลบภาพพื้นหลังรูปด้วย Microsoft word 2007 2013
พัน พัน
 
PPTX
Cloud computing and Grid Computing
prabathsl
 
PPT
Introduction to Google App Engine
rajdeep
 
KEY
Introduction to Google App Engine
Chakkrit (Kla) Tantithamthavorn
 
๋Java Web Programming on Cloud Computing using Google App Engine
IMC Institute
 
App Engine Overview @ Google Hackathon SXSW 2010
Chris Schalk
 
วิธีลบภาพพื้นหลังรูปด้วย Microsoft word 2007 2013
พัน พัน
 
Cloud computing and Grid Computing
prabathsl
 
Introduction to Google App Engine
rajdeep
 
Introduction to Google App Engine
Chakkrit (Kla) Tantithamthavorn
 
Ad

Similar to Java Web Programming on Google Cloud Platform [1/3] : Google App Engine (20)

PDF
Google App Engine
Software Park Thailand
 
PDF
Java Web Programming Using Cloud Platform: Module 10
IMC Institute
 
PPTX
Google Cloud Platform
Francesco Marchitelli
 
PDF
Introduction to Google's Cloud Technologies
Chris Schalk
 
PDF
Javaedge 2010-cschalk
Chris Schalk
 
PDF
Introduction to Google Cloud Platform Technologies
Chris Schalk
 
PDF
What's new in App Engine and intro to App Engine for Business
Chris Schalk
 
PDF
Cloudy in Indonesia: Java and Cloud
Eberhard Wolff
 
PDF
Don Schwarz App Engine Talk
Tech in the Middle
 
PDF
Google App Engine for Java v0.0.2
Matthew McCullough
 
PDF
Google Developer Days Brazil 2009 - Java Appengine
Patrick Chanezon
 
PDF
Java Support On Google App Engine
Xebia IT Architects
 
PDF
Developing, deploying and monitoring Java applications using Google App Engine
IndicThreads
 
PDF
Nadeus Education Services session on Google Apps and Google App Engine
Nadeus Education Services
 
PDF
Cloud PaaS with Java
Eberhard Wolff
 
PPT
Google App Engine for Java
Lars Vogel
 
PDF
Google app-engine-cloudcamplagos2011
Opevel
 
PDF
Google App Engine
cloudcampnigeria
 
PDF
PaaS with Java
Eberhard Wolff
 
PDF
App Engine Overview Cloud Futures Publish
Chris Schalk
 
Google App Engine
Software Park Thailand
 
Java Web Programming Using Cloud Platform: Module 10
IMC Institute
 
Google Cloud Platform
Francesco Marchitelli
 
Introduction to Google's Cloud Technologies
Chris Schalk
 
Javaedge 2010-cschalk
Chris Schalk
 
Introduction to Google Cloud Platform Technologies
Chris Schalk
 
What's new in App Engine and intro to App Engine for Business
Chris Schalk
 
Cloudy in Indonesia: Java and Cloud
Eberhard Wolff
 
Don Schwarz App Engine Talk
Tech in the Middle
 
Google App Engine for Java v0.0.2
Matthew McCullough
 
Google Developer Days Brazil 2009 - Java Appengine
Patrick Chanezon
 
Java Support On Google App Engine
Xebia IT Architects
 
Developing, deploying and monitoring Java applications using Google App Engine
IndicThreads
 
Nadeus Education Services session on Google Apps and Google App Engine
Nadeus Education Services
 
Cloud PaaS with Java
Eberhard Wolff
 
Google App Engine for Java
Lars Vogel
 
Google app-engine-cloudcamplagos2011
Opevel
 
Google App Engine
cloudcampnigeria
 
PaaS with Java
Eberhard Wolff
 
App Engine Overview Cloud Futures Publish
Chris Schalk
 
Ad

More from IMC Institute (20)

PDF
นิตยสาร Digital Trends ฉบับที่ 14
IMC Institute
 
PDF
Digital trends Vol 4 No. 13 Sep-Dec 2019
IMC Institute
 
PDF
บทความ The evolution of AI
IMC Institute
 
PDF
IT Trends eMagazine Vol 4. No.12
IMC Institute
 
PDF
เพราะเหตุใด Digitization ไม่ตอบโจทย์ Digital Transformation
IMC Institute
 
PDF
IT Trends 2019: Putting Digital Transformation to Work
IMC Institute
 
PDF
มูลค่าตลาดดิจิทัลไทย 3 อุตสาหกรรม
IMC Institute
 
PDF
IT Trends eMagazine Vol 4. No.11
IMC Institute
 
PDF
แนวทางการทำ Digital transformation
IMC Institute
 
PDF
บทความ The New Silicon Valley
IMC Institute
 
PDF
นิตยสาร IT Trends ของ IMC Institute ฉบับที่ 10
IMC Institute
 
PDF
แนวทางการทำ Digital transformation
IMC Institute
 
PDF
The Power of Big Data for a new economy (Sample)
IMC Institute
 
PDF
บทความ Robotics แนวโน้มใหม่สู่บริการเฉพาะทาง
IMC Institute
 
PDF
IT Trends eMagazine Vol 3. No.9
IMC Institute
 
PDF
Thailand software & software market survey 2016
IMC Institute
 
PPTX
Developing Business Blockchain Applications on Hyperledger
IMC Institute
 
PDF
Digital transformation @thanachart.org
IMC Institute
 
PDF
บทความ Big Data จากบล็อก thanachart.org
IMC Institute
 
PDF
กลยุทธ์ 5 ด้านกับการทำ Digital Transformation
IMC Institute
 
นิตยสาร Digital Trends ฉบับที่ 14
IMC Institute
 
Digital trends Vol 4 No. 13 Sep-Dec 2019
IMC Institute
 
บทความ The evolution of AI
IMC Institute
 
IT Trends eMagazine Vol 4. No.12
IMC Institute
 
เพราะเหตุใด Digitization ไม่ตอบโจทย์ Digital Transformation
IMC Institute
 
IT Trends 2019: Putting Digital Transformation to Work
IMC Institute
 
มูลค่าตลาดดิจิทัลไทย 3 อุตสาหกรรม
IMC Institute
 
IT Trends eMagazine Vol 4. No.11
IMC Institute
 
แนวทางการทำ Digital transformation
IMC Institute
 
บทความ The New Silicon Valley
IMC Institute
 
นิตยสาร IT Trends ของ IMC Institute ฉบับที่ 10
IMC Institute
 
แนวทางการทำ Digital transformation
IMC Institute
 
The Power of Big Data for a new economy (Sample)
IMC Institute
 
บทความ Robotics แนวโน้มใหม่สู่บริการเฉพาะทาง
IMC Institute
 
IT Trends eMagazine Vol 3. No.9
IMC Institute
 
Thailand software & software market survey 2016
IMC Institute
 
Developing Business Blockchain Applications on Hyperledger
IMC Institute
 
Digital transformation @thanachart.org
IMC Institute
 
บทความ Big Data จากบล็อก thanachart.org
IMC Institute
 
กลยุทธ์ 5 ด้านกับการทำ Digital Transformation
IMC Institute
 

Recently uploaded (20)

PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
July Patch Tuesday
Ivanti
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 

Java Web Programming on Google Cloud Platform [1/3] : Google App Engine

  • 1. Google App Engine Assoc.Prof. Dr.Thanachart Numnonda Asst.Prof. Thanisa Kruawaisayawan www.imcinstitute.com July 2012
  • 2. Agenda What is Cloud Computing? What is Google App Engine? Google App Engine for Java Google App Engine Development cycle
  • 3. What is Cloud Computing?
  • 4. Cloud computing : Definition (Wikipedia) Cloud Computing is Internet-based computing, whereby shared resources, software, and information are provided to computers and other devices on demand, like the electricity grid.
  • 5. Cloud computing characteristics Massive, abstracted infrastructure Dynamic allocation, scaling, movement of applications Pay per use No long-term commitments OS, application architecture independent No hardware or software to install
  • 6. Grid to Cloud Evolution
  • 7. Web 2.0 & Cloud Computing Web 2,0 concentrate on the private user and clouds are decscendents of data centers which services the enterprise Web 2.0 promote SaaS Web 2.0 needs massive scaling technologies User centric Web 2.0 companies (Twitter, Slideshare) are relying on Cloud Services
  • 8. ISP to Cloud Evolution
  • 9. Software as a Service (SaaS) SaaS is at the highest layer and features a complete application offered as a service, on-demand, via multitenancy — meaning a single instance of the software runs on the provider’s infrastructure and serves multiple client organizations.
  • 10. Platform as a Service (PaaS) The middle layer, or PaaS, is the encapsulation of a development environment abstraction and the packaging of a payload of services PaaS offerings can provide for every phase of software development and testing, or they can be specialized around a particular area, such as content management
  • 11. Infrastructure as a Service (IaaS) IaaS is at the lowest layer and is a means of delivering basic storage and compute capabilities as standardized services over the network. Servers, storage systems, switches,routers, and other systems are pooled (through virtualization technology, for example) to handle specific types of workloads — from batch processing to server/storage augmentation during peak loads.
  • 13. Deployment Model Public Cloud: provider refers to the cloud platform that targets any types of customers. Private Cloud: infrastructure that’s hosted internally, targeting specific customers or sometimes exclusively within an organization. Hybrid Cloud: the combination of public and private clouds, or sometimes on-premise services.
  • 14. IaaS & PaaS: Developer's Perspectives IaaS normally provides up to O/S level as your choice; for example Amazon Web Services (AWS) offers several types of Operating Systems such as Windows Server, Linux SUSE, and Linux Red Hat. Developer need to install own middleware, database, etc. PaaS, given that the database server, VM, and web server VM are readily provisioned,
  • 15. Setting Up App in IaaS Source:http://acloudyplace.com/2012/01/comparing-iaas-and-paas-a-developers-perspective/
  • 16. Setting Up App in PaaS Source:http://acloudyplace.com/2012/01/comparing-iaas-and-paas-a-developers-perspective/
  • 17. PaaS for Java Amazon Elastic Beanstalk CloudBees Cloud Foundry Google App Engine Heroku for Java Red Hat OpenShift
  • 18. PaaS for Java: Comparison
  • 19. PaaS for Java: Comparison Source: http://www.infoq.com/articles/paas_comparison
  • 20. What is Google App Engine?
  • 21. Google App Engine : Definition (Wikipedia) It is a platform for hosting web applications in Google- managed data centers. It is cloud computing technology which virtualizes applications across multiple servers and data centers.
  • 22. Google App Engine Running your web application in Google infrastructure Support different runtime environments Java (JRE 6 with limitation, Servlet 2.5, JDO, JPA) Python (2.5.2) Apps run in sandbox. Automatic scaling and load balancing No server restart, no network issues
  • 23. Hosting Java web apps traditionally Not so popular except enterprise High rates as compared to PHP hosting Shared Tomcat instance among users Restrictions on any time deployments due to shared server Dedicated hosts works fine but they are costly
  • 24. You end up with all this
  • 26. Google Datacenters at Dallas, Oregon
  • 34. Google Apps + your apps
  • 35. Google App Engine for Java
  • 36. GAE/J Was released on April 08 with Python support. Java included on August 09
  • 37. App Engine for Java : One Year Source: What’s Hot in Java for App Engine Google Con 2010
  • 38. GAE Java Runtime Environment Java 6 VM Servlet 2.5 Container HTTP Session support (need to enable explicitly) JDO/JPA for Datastore API JSR 107 for Memcache API javax.mail for Mail API javax.net.URLConnection for URLFetch API
  • 40. Services by App Engine Memcache API – high performance in-memory key-value cache Datastore – database storage and operations URLFetch – invoking external URLs Mail – sending mail from your application Task Queues – for invoking background processes Images – for image manipulation Cron Jobs – scheduled tasks on defined time User Accounts – using Google accounts for authentication
  • 41. Limitations Programming Model : Application runs in sandbox and can not Write to file system Make arbitrary network connections Use multiple threads/processes Perform long-lasting processing Permissions Know about other instances/applications Quotas (Requests, In/Out bandwidth, CPU time, API calls)
  • 43. GAE Datastore Storing data and manipulation Based on Bigtable Bigtable is proprietary and hidden from the app developers Not a relational database (No SQL) GQL (Google Query Language) to query Stores data as entities Distribution, replication, load balancing behind the scene Need to use JDO/JPA
  • 44. User Service : Google Accounts Google Accounts are encouraged as the preferred authentication mechanism for App Engine – It assumes that all users have a Google Account – Google authentication for private domains isn’t available yet Access to Google account data -> email, id The Development Server simulates Google Accounts Access constraints based on roles
  • 45. User API : Example import com.google.appengine.api.users.*; import com.google.appengine.api.users.*; UserService userService == UserServiceFactory.getUserService(); UserService userService UserServiceFactory.getUserService(); User user == userService.getCurrentUser(); User user userService.getCurrentUser(); String navBar; String navBar; if (user == null) {{ if (user == null) navBar == "<p>Welcome! <a href="" ++ userService.createLoginURL("/") navBar "<p>Welcome! <a href="" userService.createLoginURL("/") +"">Sign in or register</a> to customize.</p>"; +"">Sign in or register</a> to customize.</p>"; }} else {{ else navBar == "<p>Welcome, "" ++ user.getEmail() ++ "! You can <a href="" navBar "<p>Welcome, user.getEmail() "! You can <a href="" +userService.createLogoutURL("/") +"">sign out</a>.</p>"; +userService.createLogoutURL("/") +"">sign out</a>.</p>"; }}
  • 46. URLFetch API Invoking external URLs from your application over HTTP and HTTPs import java.net.*; import java.net.*; import java.io.*; import java.io.*; URL url == new URL("htp://..."); URL url new URL("htp://..."); InputStream inp == new InputStreamReader(url.openStream()); InputStream inp new InputStreamReader(url.openStream()); BufferedReader reader == new BufferedReader(inp); BufferedReader reader new BufferedReader(inp); String line; String line; while ((line == reader.readLine()) != null) {{ while ((line reader.readLine()) != null) //do something //do something }} reader.close(); reader.close();
  • 47. Mail API Send emails on the behalf of app administrator to the Google account use. You can not receive emails import javax.mail.*; import javax.mail.*; Session session == Session.getDefaultInstance(new Properties(), null); Session session Session.getDefaultInstance(new Properties(), null); InternetAddress admins == new InternetAddress("admins"); InternetAddress admins new InternetAddress("admins"); Message msg == new MimeMessage(session); Message msg new MimeMessage(session); msg.setFrom(admins); msg.setFrom(admins); msg.addRecipient(Message.RecipientType.TO, admins); msg.addRecipient(Message.RecipientType.TO, admins); msg.setSubject("subject"); msg.setSubject("subject"); msg.setText("text"); msg.setText("text"); Transport.send(msg); Transport.send(msg);
  • 48. Memcache Service Distributed in memory cache, better than DataStore Key-value pair mapping Configurable expiration time but Unreliable might be vanished at any time Supported Interfaces : – JACHE (JSR 107: JCACHE – Java Temporary Caching API) – The Low-Level Memcache API
  • 49. Memcache API : Example import static java.util.Collections.emptyMap; import static java.util.Collections.emptyMap; import javax.cache.*; import javax.cache.*; CacheFactory cacheFactory == CacheManager.getInstance().getCacheFactory(); CacheFactory cacheFactory CacheManager.getInstance().getCacheFactory(); Cache cache == cacheFactory.createCache(emptyMap()); Cache cache cacheFactory.createCache(emptyMap()); cache.put(key, value); cache.put(key, value); cache.get(key); cache.get(key);
  • 50. Task Queues API Perform background processes by inserting tasks into queues. Instructions need to be mention in file queue.xml, in the WEB-INF/ dir import com.google.appengine.api.labs.taskqueue.Queue; import com.google.appengine.api.labs.taskqueue.Queue; import com.google.appengine.api.labs.taskqueue.QueueFactory; import com.google.appengine.api.labs.taskqueue.QueueFactory; import com.google.appengine.api.labs.taskqueue.TaskOptions; import com.google.appengine.api.labs.taskqueue.TaskOptions; // ... // ... TaskOptions taskOptions == TaskOptions taskOptions TaskOptions.Builder.url("/send_invitation_task") TaskOptions.Builder.url("/send_invitation_task") .param("address", "[email protected]") .param("address", "[email protected]") .param("firstname", "Juliet"); .param("firstname", "Juliet"); Queue queue == QueueFactory.getDefaultQueue(); Queue queue QueueFactory.getDefaultQueue(); queue.add(taskOptions); queue.add(taskOptions);
  • 51. Cron Jobs Up to 20 scheduled tasks per app Cron jobs (scheduled tasks) supported in cron.xml in WEB-INF dir Schedule instructions contain Englis-like format <?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?> <cronentries> <cronentries> <cron> <cron> <url>/listbooks</url> <url>/listbooks</url> <description>Repopulate the cache every day at <description>Repopulate the cache every day at 5am</description> 5am</description> <schedule>every day 05:00</schedule> <schedule>every day 05:00</schedule> </cron> </cron> </cronentries> </cronentries>
  • 52. Images API Manipulation of images Transformation of images Changing image formats
  • 55. Getting Started The application owner must have a Google Account to get the tools regardless of language. Use Java 6 for development. Eclipse and Netbeans have official plugins. Both SDKs ship with a Development Web Server that runs locally and provides a sandbox almost identical to the real run-time.
  • 56. Software Development Kit App Engine SDK – Includes web server (Jetty) – Emulates all the GAE services SDK includes an upload tool to deploy app to GAE Command line tools included.
  • 57. Google Plugin for Eclipse
  • 58. Development Environment Development Server Application lifecycle management Eclipse/NetBeans plugins / Firefox plugin (GWT).
  • 59. Google Plugin for Eclipse
  • 60. Development Server http://localhost:8888
  • 61. Development Server Admin Console http://localhost:8888/_ah/admin
  • 62. Deployment Environment Application is deployed as .war which contains. Deployment is integrated in IDE Deploy multiple version of the application at the same time Your app lives at – <app_id>.appspot.com or – Custom domain with Google Apps
  • 63. Running your app on Google http://<version>.<appid>.appspot.com/some/path
  • 64. Managing Applications Administration Console http://appengine.google.com/a/yourdomain.com Application Dashboard Multiple application versions Analyzing log files (including admin) Analyzing resource usag
  • 66. Resources Google App Engine at a glance, Stefan Christoph Developing Java Based Web Applications in Google App Engine, Tahir Akram, Dec. 2009 Google App Engine, Patrick Chanezon, Mar 2010
  • 67. Thank you [email protected] www.facebook.com/imcinstitute www.imcinstitute.com