2. Generally, we talk about cloud computing when
taking applications and running them on other
infrastructure than your own.
As a developer, think of cloud computing as a service
that provides a resource that your application needs
to work (this resource may be a platform, an
infrastructure (i.e. servers), a framework).
What is Cloud?
4. Google Cloud Platform enables developers to build, test
and deploy applications on Google’s highly-scalable and
reliable infrastructure. Choose from computing, storage
and application services for your web, mobile and backend
solutions.
Google Cloud Platform is a set of modular cloud-based
services that allow you to create anything from simple
websites to complex applications.
Introduction
7. Build on the same infrastructure that allows Google to
return billions of search results in milliseconds, serve 6
billion hours of YouTube video per month and provide
storage for 425 million Gmail users.
➔ Global Network
➔ Redundancy
➔ Innovative Infrastructure
#1 Run on Google’s Infrastructure
8. Rapidly develop, deploy and iterate your applications
without worrying about system administration. Google
manages your application, database and storage servers so
you don’t have to.
➔ Managed services
➔ Developer Tools and SDKs
➔ Console and Administration
#2 Focus on your product
9. Virtual machines. Managed platform. Blob storage. Block
storage. NoSQL datastore. MySQL database. Big Data
analytics.
Google Cloud Platform has all the services your application
architecture needs.
➔ Compute
➔ Storage
➔ Services
#3 Mix and Match Services
10. Applications hosted on Cloud Platform can automatically scale up
to handle the most demanding workloads and scale down when
traffic subsides. You pay only for what you use.
Scale-up: Cloud Platform is designed to scale like Google’s
own products, even when you experience a huge traffic
spike. Managed services such as App Engine or Cloud
Datastore give you auto-scaling that enables your application
to grow with your users.
Scale-down: Just as Cloud Platform allows you to scale-up,
managed services also scale down. You don’t pay for
computing resources that you don’t need.
#4 Scale to millions of users
11. Google’s compute infrastructure gives you consistent CPU,
memory and disk performance. The network and edge cache
serve responses rapidly to your users across the world.
➔ CPU, Memory and Disk
➔ Global Network
➔ Transparent maintenance
#5 Performance you can count on
12. With a worldwide community of users, partner ecosystem
and premium support packages, Google provides a full
range of resources to help you get started and grow.
#6 Get the support you need
14. Run your applications on a fully-managed Platform-as-a-
Service (PaaS) using built-in services that make you more
productive.
Use App Engine, when you just want to focus on your
code and not worry about patching or maintenance.
App Engine
15. Popular languages and frameworks
Focus on your code
Multiple storage options
Powerful built-in services
Familiar development tools
Deploy at Google scale
App Engine Features
16. Run large-scale workloads on virtual machines hosted on
Google's infrastructure. Choose a VM that fits your needs and
gain the performance of Google’s worldwide fiber network.
Compute Engine
17. High-performance virtual machines
Powered by Google’s global network
(Really) Pay for what you use
Global load balancing
Fast and easy provisioning
Compliance and security
Compute Engine Features
18. The App Engine offers frequently standard Java API's and
App Engine specific API's for the same task. If you want to
be able to port your application from the AppEngine to
other webcontainers, e.g. Tomcat or Jetty, you should
only use Java standard API.
Google App Engine for Java
19. App Engine uses the Jetty servlet container to host
applications and supports the Java Servlet API. It provides
access to databases via Java Data Objects (JDO) and
the Java Persistence API (JPA). In the background App
Engine uses Google Bigtable as the distributed storage
system for persisting application data.
Google App Engine for Java
20. Google provides Memcache as a caching mechanism.
Developers who want to code against the standard Java
API can use the JCache implementation (based on JSR
107).
Google App Engine for Java
21. Google App Engine supports the creation of several
version of your application. In the Admin Console you can
select which version should be active. Your active
application "your-name" will be accessible via the URL
"http://your-name.appspot.com". Each version can also
be accessed for example to test a new version. The
version are accessable via
"http://versionnumber.latest.your-name.appspot.com"
where version is for example "2" and "latest" is a fixed
string.
Google App Engine for Java
22. You cannot use Threads or frameworks which uses Threads.
You can also not write to the filesystem and only read files
which are part of your application. Certain "java.lang.System"
actions, e.g. gc() or exit() will do nothing. You can not call JNI
code. Reflection is possible for your own classes and standard
Java classes but your cannot use reflection to access other
classes outside your application.
A servlet needs also to reply within 30 seconds otherwise a
"com.google.apphosting.api.DeadlineExceededException" is
thrown.
Google App Engine for Java
23. Google offers an Eclipse plug-in that provides support for the
development with the Google App Engine as well as GWT
development
Google lists the currently supported version in its Google Plug-
in for Eclipse page.
Use Eclipse update manager to install the tools in the version
for your Eclipse IDE.
The installation will also setup the GWT and App Engine SDK
into your Eclipse preferences.
To check this use Window →Preferences → Google
→ App Engine / Web Toolkit.
Installation of the Google Tools
for Eclipse
29. Visit the Google Cloud console.
If necessary, sign in to your Google Account, select or create
a project, and agree to the terms of service. Click Continue.
Select the "Web Application" platform, and click Register.
Within "OAuth 2.0 Client ID", click on "Download JSON".
Register Your Application
30. Later on, after you check out the sample project, you will
copy this downloaded file
(e.g. ~/Downloads/client_secrets.json) to
src/main/resources/client_secrets.json. If you skip this step,
when trying to run the sample you will get a 400
INVALID_CLIENT error in the browser.
Within "OAuth 2.0 Client ID", in the "Redirect URI" field
enter some redirect URIs, for example
"https://yourappname.appspot.com/oauth2callback" and
"http://localhost:8888/oauth2callback".
Register Your Application
31. cd [someDirectory]
hg clone https://code.google.com/p/google-api-java-client.samples/
google-api-java-client-samples
cd google-api-java-client-samples/calendar-appengine-sample
cp ~/Downloads/client_secrets.json
src/main/resources/client_secrets.json
mvn clean package
Checkout Instructions
32. To run your application locally on a development server:
mvn appengine:devserver
To deploy your application to appspot.com:
If this is the first time you are deploying your application to
appspot.com, you will to perform the following steps first.
Go to https://appengine.google.com and create an application.
Edit src/main/webapp/WEB-INF/appengine-web.xml, and enter the
unique application identifier (you chose it in the prior step)
between the <application> tags.
Running and Deploying Your
Application
33. If you've done the above, you can deploy at any time:
mvn appengine:update
If this is the first time you have run "update" on the project, a
browser window will open prompting you to log in. Log in with
the same Google account the app is registered with.
Running and Deploying Your
Application
34. Setup Eclipse Preferences
Window > Preferences... (or on Mac, Eclipse > Preferences...)
Select Maven
check on "Download Artifact Sources"
check on "Download Artifact JavaDoc"
Setup Project in Eclipse
35. Import calendar-appengine-sample project
File > Import...
Select "General > Existing Project into Workspace" and click "Next"
Click "Browse" next to "Select root directory",
find [someDirectory]/google-api-java-client-samples/calendar-
appengine-sample and click "Next"
Click "Finish"
NOTE: please ignore the "The App Engine SDK JAR * is missing in
the WEB-INF/lib directory" error messages.
Setup Project in Eclipse
36. Run
Right-click on project calendar-appengine-sample
Run As > Web Application
Setup Project in Eclipse
38. Use a durable and highly available object storage service.
With global edge-caching, your users have fast access to
your app’s data from any location.
Cloud Storage
39. Secure and safe
Competitive and flexible pricing
Object storage with a fully-featured API
Flexible access
Cloud Storage Features
40. Use a managed, NoSQL, schemaless database for storing
non-relational data. Cloud Datastore automatically scales
as you need it and supports transactions as well as robust,
SQL-like queries.
Cloud Datastore
41. Schemaless access, with SQL-like querying
Managed database
Autoscale with your users
ACID transactions
Built-in redundancy
Local development tools
Access your data from anywhere
Cloud Datastore Features
42. Store and manage data using a fully-managed, relational
MySQL database. Google handles replication, patch
management and database management to ensure
availability and performance.
Cloud SQL
43. Familiar Infrastructure
Flexible Charging
Security, Availability, Durability
Easier Migration; No Lock-in
Control
Fully managed
Cloud SQL Features
45. Analyze Big Data in the cloud with BigQuery.
Run fast, SQL-like queries against multi-terabyte datasets
in seconds.
Scalable and easy to use, BigQuery gives you real-time
insights about your data.
Flexible Access (ReST APIs, JSON-RPC, Google Apps Script).
Big Query
50. Compact subset of SQL
SELECT ... FROM ...
WHERE ...
GROUP BY ... ORDER BY ...
LIMIT ...;
Writing Queries
Common functions
Math, String, Time, ...
Statistical approximations
TOP
COUNT DISTINCT
51. GET /bigquery/v1/tables/{table name}
GET /bigquery/v1/query?q={query}
Sample JSON Reply:
{
"results": {
"fields": { [
{"id":"COUNT(*)","type":"uint64"}, ... ]
},
"rows": [
{"f":[{"v":"2949"}, ...]},
{"f":[{"v":"5387"}, ...]}, ... ]
}
}
Also supports JSON-RPC
Big Query via ReST
52. Standard Google Authentication
● Client Login
● OAuth
● AuthSub
HTTPS support
● protects your credentials
● protects your data
Relies on Google Storage to manage access
Big Query Security and Privacy
54. Create ReSTful services and make them accessible to iOS,
Android and Javascript clients. Automatically generate
client libraries to make wiring up the frontend easy. Built-in
features include denial-of-service protection, OAuth 2.0
support and client key management.
Cloud Endpoints
56. Quickly and dynamically translate between thousands of
available language pairs within your app, integrating with
Google Translate.
Translate API
57. Dynamically access languages
Accessible with Google API
Affordable, easy pricing
Translate API Features
58. Use Google’s machine learning algorithms to analyze data
and predict future outcomes using a familiar ReSTful
interface.
Prediction API
59. Put your data to use
Fast and reliable
Cloud integration
Powerful development tools
Examples and support
Flexible pricing
Prediction API Features
63. Upload your training data to Google Storage
● Training data: outputs and input features
● Data format: comma separated value format (CSV)
"english","To err is human, but to really ..."
"spanish","No hay mal que por bien no venga."
...
Upload to Google Storage
gsutil cp ${data} gs://yourbucket/${data}
Step 1: Upload
64. Create a new model by training on data
To train a model:
POST prediction/v1.3/training
{"id":"mybucket/mydata"}
Training runs asynchronously.
To see if it has finished:
GETprediction/v1.3/training/mybucket%2Fmydata
{"kind": "prediction#training", ... ,"training
status": "DONE"}
Step 2: Train
65. Apply the trained model to make predictions on new data
POST
prediction/v1.3/training/mybucket%2Fmydata/predict
{ "data":{
"input": { "text" : [
"J'aime X! C'est le meilleur" ]}}}
Step 3: Predict
66. Apply the trained model to make predictions on new data
{ data : {
"kind" : "prediction#output",
"outputLabel":"French",
"outputMulti" :[
{"label":"French", "score": x.xx}
{"label":"English", "score": x.xx}
{"label":"Spanish", "score": x.xx}]}}
Step 3: Predict
67. import httplib
// put new data in JSON format in params variable
header = {"Content-Type" : "application/json"}#...
conn =
httplib.HTTPConnection("www.googleapis.com")conn.request
("POST", "/prediction/v1.3/query/bucket%2Fdata/predict",
params, header) print conn.getresponse()
Step 3: Predict
68. Google Cloud Platform offer $300 in credit to spend on all
Cloud Platform products for your first 60 days. Your trial is
absolutely free and you will not be billed unless you decide to
upgrade to a paid account.
During free trial, there are some product limitations. Compute
Engine is limited to eight concurrent cores at a time.
Free trial is for anyone new to Cloud Platform. Existing
customers that have paid for Cloud Platform in the past are
not eligible.
Pricing: free trial
70. • Google Cloud Platform Developers Portal:
https://cloud.google.com/developers
• Google Developers Global Portal:
https://developers.google.com
• Google Cloud Platform Products list:
https://cloud.google.com/products/
• Google App Engine
http://code.google.com/apis/storage
• Google Storage for Developers
http://code.google.com/apis/storage
• Google Prediction API
http://code.google.com/apis/predict
• Google BigQuery
http://code.google.com/apis/bigquery
Useful links
71. Thank You!
please leave a feedback
Francesco Marchitelli
marchitelli.francesco@gmail.com
@marcyborg