Introduction to Google's Cloud Technologies

74
Introduction to Google’s Cloud Technologies Chris Schalk Google Developer Advocate OpenCF Summit Monday Feb 21 st , 2010

description

This is a presentation given by Google Developer Advocate, Chris Schalk, on Google's cloud technologies and how to build and run CFML apps on them.

Transcript of Introduction to Google's Cloud Technologies

Page 1: Introduction to Google's Cloud Technologies

Introduction to Google’s Cloud Technologies

Chris  Schalk  Google  Developer  Advocate  

OpenCF  Summit  Monday  Feb  21st,  2010  

Page 2: Introduction to Google's Cloud Technologies

Google Cloud Technologies at a Glance

Google  BigQuery   Google    Predic0on  API  

Google  Storage  

Google  App  Engine  

Google  App  Engine  for  Business  (new)  

ExisIng  

New!  

Page 3: Introduction to Google's Cloud Technologies

•  Part I - Intro to App Engine •  App Engine Details •  Development Tools •  App Engine for Business

•  Part II – Google’s new cloud technologies •  Google Storage •  Prediction API •  BigQuery

•  Part III - Dabbling with CFML on App Engine

Agenda

Page 4: Introduction to Google's Cloud Technologies

Part I – Intro to App Engine

Topics covered

•  App Engine a PaaS •  App Engine usage/customers •  App Engine Technical Details

Page 5: Introduction to Google's Cloud Technologies

Google App Engine Build your own applications in Google's cloud

Page 6: Introduction to Google's Cloud Technologies

6  

IaaS  

PaaS  

SaaS  

Source:  Gartner  AADI  Summit  Dec  2009  

Cloud Computing as Gartner Sees It

Page 7: Introduction to Google's Cloud Technologies

• Easy to build

• Easy to maintain

• Easy to scale

7

Why Google App Engine?

Page 8: Introduction to Google's Cloud Technologies

8

150,000+  ac0ve  apps  on  a  weekly  basis  

8

By the Numbers

Page 9: Introduction to Google's Cloud Technologies

9

100,000+  developers  use  every  month  

9

By the Numbers

Page 10: Introduction to Google's Cloud Technologies

10

1B+  daily  pageviews  

10

By the Numbers

Page 11: Introduction to Google's Cloud Technologies

11  

Some App Engine Partners

Page 12: Introduction to Google's Cloud Technologies

App Engine Details

12

Page 13: Introduction to Google's Cloud Technologies

Cloud Development in a Box

13

•   Downloadable SDK

•  Application runtimes •  Java, Python

•  Local development tools •  Eclipse plugin, AppEngine Launcher

•  Specialized application services

•  Cloud based dashboard

•  Ready to scale

•  Built in fault tolerance, load balancing

Page 14: Introduction to Google's Cloud Technologies

Specialized Services

14  

Blobstore  Images  

Mail   XMPP   Task  Queue  

Memcache   Datastore   URL  Fetch  

User  Service  

Page 15: Introduction to Google's Cloud Technologies

Language Runtimes

15  

Duke,  the  Java  mascot  Copyright  ©  Sun  Microsystems  Inc.,  all  rights  reserved.  

Page 16: Introduction to Google's Cloud Technologies

Ensuring Portability

16  

Page 17: Introduction to Google's Cloud Technologies

Extended Language support through JVM

•  Java •  Scala •  Ruby (JRuby) •  Groovy (Gaelyk) •  PHP (Quercus) •  JavaScript (Rhino) •  Python (Jython) •  CFML (Open BlueDragon)

17  

Duke,  the  Java  mascot  Copyright  ©  Sun  Microsystems  Inc.,  all  rights  reserved.  

Page 18: Introduction to Google's Cloud Technologies

Always free to get started

•  43M requests/day •  6.5 CPU hrs/day •  1 GB outgoing bandwidth •  1 GB blob storage •  650K URL Fetch calls/day •  2,000 recipients emailed •  1 GB/day bandwidth •  100,000 tasks api calls •  257K XMPP messages/minute

18

hWp://code.google.com/appengine/docs/quotas.html  

Page 19: Introduction to Google's Cloud Technologies

Manage your expansion – Easy Billing

19

Page 20: Introduction to Google's Cloud Technologies

Application Platform Management

20  

Page 21: Introduction to Google's Cloud Technologies

App Engine Dashboard

21  

Page 22: Introduction to Google's Cloud Technologies

Development Tools for App Engine

22  

Page 23: Introduction to Google's Cloud Technologies

Google Plugin for Eclipse

23  

Page 24: Introduction to Google's Cloud Technologies

SDK Console

24  

Page 25: Introduction to Google's Cloud Technologies

Two+ years in review

25  

Apr 2008! Python launch May 2008! Memcache, Images API Jul 2008! Logs export Aug 2008! Batch write/delete Oct 2008! HTTPS support Dec 2008! Status dashboard, quota details Feb 2009! Billing, larger files Apr 2009! Java launch, DB import, cron support, SDC May 2009! Key-only queries Jun 2009! Task queues Aug 2009! Kindless queries Sep 2009! XMPP Oct 2009! Incoming email Dec 2009! Blobstore Feb 2010! Datastore cursors, Appstats Mar 2010! Read policies, IPv6 May 2010! App Engine for Business Jun 2010! Task queue increases, Python pre-compilation… Jul 2010! Mapper API Aug 2010! Multi-tenancy, hi perf img serving, custom err pages Oct 2010! Instances Console, Delete Kind/App Data

Page 26: Introduction to Google's Cloud Technologies

App Engine 1.4 Release New Features

1.  Channel  API      Allows  for  Server  Push  (Comet)  to  browser      -­‐  hWp://code.google.com/appengine/docs/java/channel/  

2.  Always  On  

3.  Warm  Up  Requests  –   Enabled  by  default  for  Java  apps  –   Can  turn  off  in  appengine-­‐web.xml  via:  <warmup-­‐requests-­‐enabled>false</warmup-­‐requests-­‐enabled>  

Page 27: Introduction to Google's Cloud Technologies

App Engine 1.4 Release New Features

4.  Hard  Limit  Updates  –   No  more  30  second  limit  for  background  work  -­‐>  up  to  10  minutes  

–   Response  size  limits  for  URLFetch  have  been  raised  from  1MB  to  32MB  

–   Memcache  batch  get/put  can  now  also  do  up  to  32MB  requests  –   Image  API  requests  and  response  size  limits  have  been  raised  from  1MB  to  32MB  

–   Mail  API  outgoing  aWachments  have  been  increased  from  1MB  to  10MB  

Page 28: Introduction to Google's Cloud Technologies

Introducing App Engine for Business

29

Same scalable cloud platform, but designed for the Enterprise

App Engine for Business

Page 29: Introduction to Google's Cloud Technologies

Google App Engine for Business Details

•  Enterprise application management –  Centralized domain console (preview available)

•  Enterprise reliability and support –  99.9% Service Level Agreement –  Direct support

•  Hosted SQL –  Relational SQL database in the cloud (preview available)

•  SSL on your domain •  Extremely Secure by default

–  Integrated Single Sign On (SSO) •  Pricing that makes sense

–  Apps cost $8 per user, up to $1000 max per month

30  

Google App Engine for Business

Page 30: Introduction to Google's Cloud Technologies

32  

App Engine for Business Roadmap

Enterprise Administration Console Preview (signups available)

Direct Support Preview (signups available)

Hosted SQL Preview (signups available)

Service Level Agreement Preview (Draft published)

Custom Domain SSL Limited Release Q1 2011

Page 31: Introduction to Google's Cloud Technologies

App Engine Resources

Get started with App Engine •  http://code.google.com/appengine

Read up on App Engine for Business and become a trusted tester •  http://code.google.com/appengine/business

Page 32: Introduction to Google's Cloud Technologies

App Engine Demos

•  App Engine •  Getting started

•  App Engine for Business •  Domain Console •  Guestbook on SQL on GAE4B

Page 33: Introduction to Google's Cloud Technologies

Part II - Google’s new Cloud Technologies

Topics covered •  Google Storage for Developers •  Prediction API (machine learning) •  BigQuery

Page 34: Introduction to Google's Cloud Technologies

Google Storage for Developers Store your data in Google's cloud

Page 35: Introduction to Google's Cloud Technologies

What Is Google Storage?

•  Store  your  data  in  Google's  cloud  o  any  format,  any  amount,  any  Ime  

•  You  control  access  to  your  data  o  private,  shared,  or  public  

•   Access  via  Google  APIs  or  3rd  party  tools/libraries  

Page 36: Introduction to Google's Cloud Technologies

Sample Use Cases

Static content hosting e.g. static html, images, music, video

Backup and recovery e.g. personal data, business records

Sharing e.g. share data with your customers

Data storage for applications e.g. used as storage backend for Android, AppEngine, Cloud based apps

Storage for Computation e.g. BigQuery, Prediction API

Page 37: Introduction to Google's Cloud Technologies

Google Storage Benefits

High  Performance  and  Scalability                Backed  by  Google  infrastructure    

Strong  Security  and  Privacy                  Control  access  to  your  data  

Easy  to  Use  Get  started  fast  with  Google  &  3rd  party  tools  

Page 38: Introduction to Google's Cloud Technologies

Google Storage Technical Details

•  RESTful API   o  Verbs: GET, PUT, POST, HEAD, DELETE   o  Resources: identified by URI  o  Compatible with S3   

•  Buckets   o  Flat containers   

•  Objects   o  Any type  o  Size: 100 GB / object  

•  Access Control for Google Accounts   o  For individuals and groups  

•  Two Ways to Authenticate Requests   o  Sign request using access keys   o  Web browser login#

Page 39: Introduction to Google's Cloud Technologies

Performance and Scalability

•  Objects of any type and 100 GB / Object •  Unlimited numbers of objects, 1000s of buckets

•  All data replicated to multiple US data centers •  Utilizes Google's worldwide network for data delivery

•  Only you can use bucket names with your domain names •  Read-your-writes data consistency •  Range Get

Page 40: Introduction to Google's Cloud Technologies

Some  Early  Google  Storage  Adopters  

Page 41: Introduction to Google's Cloud Technologies

Google Storage - Availability

•  Preview in US currently o  100GB free storage and network from Google per

account o  Sign up for waitlist at http://code.google.com/apis/

storage/

•  Note: Non US preview available on case-by-case basis •  http://bit.ly/dKm770 (for Storage, BigQuery, Prediction)

Page 42: Introduction to Google's Cloud Technologies

Demo

•  Tools: o  GS Manager o  GSUtil

•  Upload / Download

Page 43: Introduction to Google's Cloud Technologies

Google Prediction API Google's prediction engine in the cloud

Page 44: Introduction to Google's Cloud Technologies

Introducing the Google Prediction API

•  Google's sophisticated machine learning technology •  Available as an on-demand RESTful HTTP web service

Page 45: Introduction to Google's Cloud Technologies

How  does  it  work?  

"english"   The  quick  brown  fox  jumped  over  the  lazy  dog.  

"english"   To  err  is  human,  but  to  really  foul  things  up  you  need  a  computer.  

"spanish"   No  hay  mal  que  por  bien  no  venga.  

"spanish"   La  tercera  es  la  vencida.  

?   To  be  or  not  to  be,  that  is  the  quesIon.  

?   La  fe  mueve  montañas.  

The Prediction API finds relevant features in the sample data during training.

The  PredicIon  API  later  searches  for  those  features  during  predicIon.  

Page 46: Introduction to Google's Cloud Technologies

A  virtually  endless  number  of  applicaIons...  

Customer Sentiment

TransacIon  Risk  

Species  IdenIficaIon  

Message  RouIng  

Legal  Docket  ClassificaIon  

Suspicious  AcIvity  

Work  Roster  Assignment  

Recommend  Products  

PoliIcal  Bias  

Uplin  MarkeIng  

Email  Filtering  

DiagnosIcs  

Inappropriate  Content  

Career  Counselling  

Churn  PredicIon  

...  and  many  more  ...  

Page 47: Introduction to Google's Cloud Technologies

Using the Prediction API

1.  Upload  

2.  Train  

Upload  your  training  data  to  Google  Storage    

Build  a  model  from  your  data  

Make  new  predicIons  3.  Predict  

A  simple  three  step  process...  

Page 48: Introduction to Google's Cloud Technologies

Step  1:  Upload  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}

Page 49: Introduction to Google's Cloud Technologies

Step  2:  Train  Create  a  new  model  by  training  on  data  

To train a model:

POST prediction/v1.1/training?data=mybucket%2Fmydata Training runs asynchronously. To see if it has finished:

GET prediction/v1.1/training/mybucket%2Fmydata

{"data":{ "data":"mybucket/mydata", "modelinfo":"estimated accuracy: 0.xx"}}}

Page 50: Introduction to Google's Cloud Technologies

Step  3:  Predict  Apply  the  trained  model  to  make  predicIons  on  new  data  

POST prediction/v1.1/query/mybucket%2Fmydata/predict { "data":{ "input": { "text" : [ "J'aime X! C'est le meilleur" ]}}}

Page 51: Introduction to Google's Cloud Technologies

Step  3:  Predict  Apply  the  trained  model  to  make  predicIons  on  new  data  

POST prediction/v1.1/query/mybucket%2Fmydata/predict { "data":{ "input": { "text" : [ "J'aime X! C'est le meilleur" ]}}} { data : { "kind" : "prediction#output", "outputLabel":"French", "outputMulti" :[ {"label":"French", "score": x.xx} {"label":"English", "score": x.xx} {"label":"Spanish", "score": x.xx}]}}

Page 52: Introduction to Google's Cloud Technologies

Step  3:  Predict  Apply  the  trained  model  to  make  predicIons  on  new  data  

import httplib

header = {"Content-Type" : "application/json"}

#...put new data in JSON format in params variable conn = httplib.HTTPConnection("www.googleapis.com")conn.request("POST", "/prediction/v1.1/query/mybucket%2Fmydata/predict”, params, header)

print conn.getresponse()

An  example  using  Python  

Page 53: Introduction to Google's Cloud Technologies

Prediction API Capabilities Data •  Input Features: numeric or unstructured text •  Output: up to hundreds of discrete categories

Training •  Many machine learning techniques •  Automatically selected •  Performed asynchronously

Access from many platforms: •  Web app from Google App Engine •  Apps Script (e.g. from Google Spreadsheet) •  Desktop app

Page 54: Introduction to Google's Cloud Technologies

Prediction API v1.1 - features

•  Updated Syntax •  Multi-category prediction

o  Tag entry with multiple labels •  Continuous Output

o  Finer grained prediction rankings based on multiple labels •  Mixed Inputs

o  Both numeric and text inputs are now supported

Can combine continuous output with mixed inputs

Page 55: Introduction to Google's Cloud Technologies

Prediction API Demos

•  Creating training data – recipes.csv •  Simple REST access

•  Training the prediction engine •  Start predicting!

•  A Java Web example

Page 56: Introduction to Google's Cloud Technologies

Google BigQuery Interactive analysis of large datasets in Google's cloud

Page 57: Introduction to Google's Cloud Technologies

Introducing Google BigQuery

•  Google's large data adhoc analysis technology o  Analyze massive amounts of data in seconds

•  Simple SQL-like query language •  Flexible access

o  REST APIs, JSON-RPC, Google Apps Script

Page 58: Introduction to Google's Cloud Technologies

Why  BigQuery?    

Working  with  large  data  is  a  challenge  

Page 59: Introduction to Google's Cloud Technologies

Many  Use  Cases  ...  

Spam Trends  

DetecIon  

Web  Dashboards   Network  OpImizaIon  

InteracIve  Tools  

Page 60: Introduction to Google's Cloud Technologies

Key  CapabiliIes  of  BigQuery  

•  Scalable: Billions of rows •  Fast: Response in seconds

•  Simple: Queries in SQL

•  Web Service o  REST o  JSON-RPC o  Google App Scripts

Page 61: Introduction to Google's Cloud Technologies

Using BigQuery

1.  Upload  

2.  Import  

Upload  your  raw  data  to  Google  Storage    

Import  raw  data  into  BigQuery  table  

Perform  SQL  queries  on  table  3.  Query  

Another  simple  three  step  process...  

Page 62: Introduction to Google's Cloud Technologies

Writing Queries

Compact subset of SQL o  SELECT ... FROM ...

WHERE ... GROUP BY ... ORDER BY ... LIMIT ...;

Common functions o  Math, String, Time, ...

Statistical approximations o  TOP o  COUNT DISTINCT

Page 63: Introduction to Google's Cloud Technologies

BigQuery via REST

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

Page 64: Introduction to Google's Cloud Technologies

Security and Privacy

Standard Google Authentication •  Client Login •  OAuth •  AuthSub

HTTPS support •  protects your credentials •  protects your data

Relies on Google Storage to manage access

Page 65: Introduction to Google's Cloud Technologies

Large Data Analysis Example

Wikimedia  Revision  history  data  from:  hWp://download.wikimedia.org/enwiki/latest/enwiki-­‐latest-­‐pages-­‐meta-­‐history.xml.7z  

Wikimedia  Revision  History  

Page 66: Introduction to Google's Cloud Technologies

Using  BigQuery  Shell  

Python DB API 2.0 + B. Clapper's sqlcmd http://www.clapper.org/software/python/sqlcmd/

Page 67: Introduction to Google's Cloud Technologies

BigQuery from a Spreadsheet

Page 68: Introduction to Google's Cloud Technologies

BigQuery from a Spreadsheet

Page 69: Introduction to Google's Cloud Technologies

Further  info  available  at:  

•  Google Storage for Developers o  http://code.google.com/apis/storage

•  Prediction API o  http://code.google.com/apis/predict

•  BigQuery o  http://code.google.com/apis/bigquery

Page 70: Introduction to Google's Cloud Technologies

Recap

•  Google App Engine o  Google’s PaaS cloud development platform

•  Google App Engine for Business o  New enterprise version of App Engine

•  Google Storage o  New high speed data storage on Google Cloud

•  Prediction API o  New machine learning technology able to predict

outcomes based on sample data

•  BigQuery o  New service for Interactive analysis of very large data

sets using SQL

Page 71: Introduction to Google's Cloud Technologies

Part III – Dabbling with CFML on App Engine

•  How? –  Answer: Open BlueDragon

•  OpenBD is a Java CFML runtime engine •  Has Google App Engine port •  Easy installation

–  Just copy an example War directory to new GAE Java Web App –  Make sure to merge the jar files from the new WEBINF/lib with

the existing WEBINF/lib

Page 72: Introduction to Google's Cloud Technologies

Demo – App Engine’s Guestbook application on OpenBD

•  http://guestbookcfm.appspot.com/

Page 73: Introduction to Google's Cloud Technologies

Q&A

Page 74: Introduction to Google's Cloud Technologies

Thank You!

Chris Schalk Google Developer Advocate

http://twitter.com/cschalk