You are on page 1of 30

DEPLOYING

APPLICATIONS TO CLOUD
W

IT

IN

ABOUT ME
Alexander Zamkovyi
Java Developer @ Intro Pro
Linked[in]: ua.linkedin.com/in/invaa/
e-mail: alex@zamkovyi.name

GOOGLE APP ENGINE

Part of Google Cloud Platform (trusted by 4 million applications)

Platform-as-a-Service (Java, Python, PHP, Go)

264k websites (258k is active), according to builtwith.com

Coca-cola, Snapchat, Ubisoft, Rovio, BestBuy, Sony Music, ...

REASONS TO LEARN GOOGLE APP


ENGINE

Highly scalable

Integration

Cost-effective

Well documented

Its Google

CLOUD, CLOUD, CLOUD!

PLAN

Google Cloud Endpoints

Google App Engine Development Process

Deployment and Troubleshooting

Persistence

Limitations

GOOGLE CLOUD ENDPOINTS

IN

GOOGLE CLOUD ENDPOINTS

THE SANDBOX

Java 7 JVM in a safe "sandboxed" environment

Servlet 2.5 standard

Standard WAR directory structure

Secured "sandbox" environment isolates application for service and


security

The JVM can execute any Java bytecode that operates within the
sandbox restrictions

DEMO (CLOUD ENDPOINTS)


Web frontend

Deployed: https://cloudendpointstic.appspot.com
Sources: https://github.com/GoogleCloudPlatform

DEMO (CLOUD ENDPOINTS)


Android client

Deployed: https://
play.google.com/store/apps/details?id=com.devrel.sam
ples.ttt
Sources: https://github.com/GoogleCloudPlatform

DEVELOPMENT PROCESS

IN

REQUIREMENTS AND PREREQUISITES

JDK 1.7 (recommended)

Apache Maven 3.1+

MySQL 5+ (for local dev server)

Google account

Application ID

IDE

GAE JAVA PROJECT STRUCTURE

You'll add your own application Java classes


tosrc/main/java/...

You'll configure your application using the


filesrc/main/webapp/WEBINF/appengine.web.xml

You'll configure your application deployment


using the filesrc/main/webapp/WEBINF/web.xml

THE JAVA DEVELOPMENT SERVER

jetty-6.1.x (built-in)

The development web server simulates the App Engine Java runtime
environment and all of its services, including the datastore

ADMIN CONSOLE

http://localhost:port/_ah/admin

DEPLOYMENT AND TROUBLESHOOTING

IN

UPLOADING APP

mvn appengine:update

DEVELOPER'S CONSOLE

https://console.developers.google.com/

APPCFG

appcfg.cmd
[options]
<action>
<war-location>

PERSISTENCE

IN

DATASTORE AND RDBMS

DEMO (CLOUD DATASTORE AND CLOUD


SQL)
Calendar app
Features:
JPA (Cloud SQL vs Cloud Datastores)
Spring MVC
jQuery
Deployed: http://cloudcalendarservice.appspot.com/
Sources: https://github.com/invaa/CloudCalendar

LIMITATIONS

IN

AN APP ENGINE APPLICATION CANNOT

write to the filesystem. Applications must usethe App Engine


datastorefor storing persistent data. Reading from the filesystem is
allowed, and all application files uploaded with the application are
available

respond slowly. A web request to an application must be handled


within a few seconds. Processes that take a very long time to
respond are terminated to avoid overloading the web server

make other kinds of system calls

WEB.XML FEATURES NOT SUPPORTED

App Engine supports the<load-on-startup>element for servlet


declarations. However, the load actually occurs during the first
request handled by the web server instance, not prior to it

Some deployment descriptor elements can take a human readable


display name, description and icon for use in IDEs. App Engine doesn't
use these, and ignores them

App Engine doesn't support JNDI environment variables (<env-entry>)

App Engine doesn't support EJB resources (<resource-ref>)

Notification of the destruction of servlets, servlet context, or filters is


not supported

The<distributable>element is ignored

Servlet scheduling with<run-at>is not supported

JPA FEATURES NOT SUPPORTED

Owned many-to-many relationships

"Join" queries. You cannot use a field of a child entity in a filter when
performing a query on the parent kind. Note that you can test the
parent's relationship field directly in a query using a key

Aggregation queries (group by, having, sum, avg, max, min)

Polymorphic queries. You cannot perform a query of a class to get


instances of a subclass. Each class is represented by a separate
entity kind in the datastore

JRE WHITE LIST

Q&A

ua.linkedin.com/in/invaa
/
alex@zamkovyi.name

You might also like