living in the cloud: hosting data & apps using the google infrastructure

55
Living In The Cloud Hosting Data & Apps Using The Google Infrastructure

Upload: guest517f2f

Post on 15-May-2015

1.652 views

Category:

Technology


2 download

DESCRIPTION

In the modern web, the user rules. Nearly every successful web app has to worry about scaling to an exponentially growing user base and giving those users multiple ways of interacting with their data. This talk will provide an overview of two technologies that aim to make web development and data portability easier: Google App Engine and the Google Data APIs. This talk was presented by Pamela Fox, who works on the Google Developer Relations team as the Maps API Support Engineer.

TRANSCRIPT

Page 1: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Living In The CloudHosting Data & Apps Using The Google Infrastructure

Page 2: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Introductions

Pamela Fox

USC

Google

MS/BS CS

Page 3: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Introductions

http://www.wordle.net/gallery/wrdl/710650/fkedupmonkey_tags

Page 4: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

The Cloud!

Page 5: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Tonight’s Agenda

Google Data APIs App Engine

Page 6: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Before the Cloud: Web Apps

Page 7: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

After the Cloud: Web Apps

Page 8: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

• Viral Spread

• Simultaneous Edits

• = Scaling Nightmare

Mo’ Users, Mo’ Problems

Page 9: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Solution: App Engine

Page 10: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

What Is App Engine?

Lets you run your web application on top of Google’s infrastructure.

• Servers• Network• Datastore• Backups• Pagers

Scalable}

Page 11: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Why App Engine

“We wear pagers so you don’t have to.”

— Guido van Rossum

Page 12: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Simplicity

App Engine is designed to be simple.

Simple application configuration.

No systems administration.

No performance tuning.

Automatic scaling.

Page 13: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

App Engine Architecture

code data

Page 14: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Non-Scalable Architecture

code/data

Page 15: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Python

Page 16: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Data Store

Page 17: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Data Store

db.GqlQuery("SELECT * FROM Shout " "WHERE who >= 'b' AND who < ' c ' " "ORDER BY when DESC").fetch(100)

query = Shout.all()query.order('-date')query.filter('who >=', 'b')query.filter('who <', ‘c')shouts = query.fetch(100)

Page 18: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Memcache

Page 19: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Users

@gmail.com

@myappsdomain.com

Page 20: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Demo

Google App Engine

Page 21: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Before the Cloud: User Apps

Page 22: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Before the Cloud: User Apps

Page 23: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

• Users demand ownership of their content.

• Other sites want to access that content.

Damn Needy Users

Page 24: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Solution: Google data APIs

Page 25: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

How Do You Make Things Accessible?

Application

Programming

Interface( )

Page 26: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

APIs

An application programming interface (API) is a set of functions, procedures, methods or classes that an operating system, library or service provides to support requests made by computer programs.

Source: Wikipedia

C/C++ Header File

Page 27: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

APIs

RPC || REST

* SOAP

Page 28: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Remote Procedure Calls

fooInstance->addNumbers(2, 3);

<?xml version="1.0"?><methodCall> <methodName>Foo.addNumbers</methodName> <params> <param> <value><int>2</int></value> <value><int>3</int></value> </param> </params></methodCall>

fooInstance.addNumbers(2, 3);

PHP

XML(Network)

C++

Page 29: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

REST

Representational

State

Transfer( )[Fielding 2000]

Page 30: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

REST

Fundamentals of REST:

Application state and functionality is abstracted into discrete resources.

Page 31: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

REST

Fundamentals of REST:

Resources are accessible via URLs.

/blog/posts/1234

Page 32: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

REST

Fundamentals of REST:

Resources share a uniform interface for transferring state.

HTTP://

GET POST

PUT DELETE

}

Page 33: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

RSS/ATOM

Feed

{Entries

Example ATOM feed.

Page 34: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

ATOMPub

Feed

{Entries

Page 35: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Google data APIs Protocol

Feed

Query

{Entries

Page 36: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

The Google Data Protocol

REST

Google Data Protocol

RSS 2.0

Architecture

Syndication

UpdatesAtomPub

Atom

Page 37: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

The Google Data Protocol

RSS 2.0 Atom(Pub)

Google Data

Syndication Format ✓ ✓ ✓

Queries ✓

Updates ✓ ✓

Optimistic Concurrency ✓

Authentication ✓

Page 38: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

The Google Data Protocol

Over 15 APIs, 1 Protocol

Many Uses

Page 39: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Case Study: CalGoo

Page 40: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

The Google Data Protocol

GET /myFeed

200 OK

<?xml version="1.0"?>

<feed xmlns="http://www.w3.org/2005/Atom">

<title>Foo</title>

<updated>2006-01-23T16:25:00-08:00</updated>

<id>http://www.example.com/myFeed</id>

<author>

<name>Jo March</name>

</author>

<link href="/myFeed" rel="self"/>

</feed>

Requesting a feed or resource

Page 41: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

The Google Data Protocol

POST /myFeed

<?xml version="1.0"?>

<entry xmlns="http://www.w3.org/2005/Atom">

<author>

<name>Elizabeth Bennet</name>

<email>[email protected]</email>

</author>

<title type="text">Entry 1</title>

<content type="text">This is my entry</content>

</entry>

Creating a new resource

Page 42: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

The Google Data Protocol

201 CREATED

<?xml version="1.0"?>

<entry xmlns="http://www.w3.org/2005/Atom">

<id>http://www.example.com/id/1</id>

<link rel="edit" href="http://example.com/myFeed/1/1/"/>

<updated>2006-01-23T16:26:03-08:00</updated>

<author>

<name>Elizabeth Bennet</name>

<email>[email protected]</email>

</author>

<title type="text">Entry 1</title>

<content type="text">This is my entry</content>

</entry>

Creating a new resource

Page 43: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

The Google Data Protocol

PUT /myFeed/1/1/

<?xml version="1.0"?>

<entry xmlns="http://www.w3.org/2005/Atom">

<id>http://www.example.com/id/1</id>

<link rel="edit" href="http://example.com/myFeed/1/1/"/>

<updated>2006-01-23T16:28:05-08:00</updated>

<author>

<name>Elizabeth Bennet</name>

<email>[email protected]</email>

</author>

<title type="text">Entry 1</title>

<content type="text">This is my first entry.</content>

</entry>

Updating an entry

Page 44: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

The Google Data Protocol

200 OK

<?xml version="1.0"?>

<entry xmlns="http://www.w3.org/2005/Atom">

<id>http://www.example.com/id/1</id>

<link rel="edit" href="http://example.com/myFeed/1/2/"/>

<updated>2006-01-23T16:28:05-08:00</updated>

<author>

<name>Elizabeth Bennet</name>

<email>[email protected]</email>

</author>

<title type="text">Entry 1</title>

<content type="text">This is my first entry.</content>

</entry>

Updating an entry

Page 45: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

The Google Data Protocol

DELETE /myFeed/1/2/

200 OK

Updating an entry

Page 46: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Demo

Google Data CRUD

Page 47: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

The Google Data Protocol

GET /myFeed?q=This

200 OK

<?xml version="1.0"?>

<feed xmlns="http://www.w3.org/2005/Atom">

<title>Foo</title>

<updated>2006-01-23T16:26:03-08:00</updated>

<id>http://www.example.com/myFeed</id>

<link href="/myFeed" rel="self"/>

<entry>

<id>http://www.example.com/id/1</id>

<link rel="edit" href="http://example.com/myFeed/1/1/"/>

<updated>2006-01-23T16:26:03-08:00</updated>

<title type="text">Entry 1</title>

<content type="text">This is my entry</content>

</entry>

</feed>

Searching for a resource

Page 48: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Demo

Youtube Searcher

Page 49: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

JSON and RSS

Other formats are also supported:

?alt=json

?alt=json-in-script

?alt=kml

?alt=rss

http://code.google.com/apis/gdata/json.html

Page 50: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Client Libraries

PHP

.NET

Java

JavaScriptObjective-C

Python

+ Community Contributed

Page 51: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

DemoGoogle Data Sample Applications

Page 52: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

My Secret Motivation For Giving This Talk

Google Data APIs

♥App Engine

Page 53: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

DemoGoogle Data APIs + App Engine

Page 54: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Questions?

Page 55: Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure

Questions?

Pamela [email protected]@pamelafox

More Infohttp://code.google.com