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

Preview:

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.

Citation preview

Living In The CloudHosting Data & Apps Using The Google Infrastructure

Introductions

Pamela Fox

USC

Google

MS/BS CS

Introductions

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

The Cloud!

Tonight’s Agenda

Google Data APIs App Engine

Before the Cloud: Web Apps

After the Cloud: Web Apps

• Viral Spread

• Simultaneous Edits

• = Scaling Nightmare

Mo’ Users, Mo’ Problems

Solution: App Engine

What Is App Engine?

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

• Servers• Network• Datastore• Backups• Pagers

Scalable}

Why App Engine

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

— Guido van Rossum

Simplicity

App Engine is designed to be simple.

Simple application configuration.

No systems administration.

No performance tuning.

Automatic scaling.

App Engine Architecture

code data

Non-Scalable Architecture

code/data

Python

Data Store

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)

Memcache

Users

@gmail.com

@myappsdomain.com

Demo

Google App Engine

Before the Cloud: User Apps

Before the Cloud: User Apps

• Users demand ownership of their content.

• Other sites want to access that content.

Damn Needy Users

Solution: Google data APIs

How Do You Make Things Accessible?

Application

Programming

Interface( )

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

APIs

RPC || REST

* SOAP

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++

REST

Representational

State

Transfer( )[Fielding 2000]

REST

Fundamentals of REST:

Application state and functionality is abstracted into discrete resources.

REST

Fundamentals of REST:

Resources are accessible via URLs.

/blog/posts/1234

REST

Fundamentals of REST:

Resources share a uniform interface for transferring state.

HTTP://

GET POST

PUT DELETE

}

RSS/ATOM

Feed

{Entries

Example ATOM feed.

ATOMPub

Feed

{Entries

Google data APIs Protocol

Feed

Query

{Entries

The Google Data Protocol

REST

Google Data Protocol

RSS 2.0

Architecture

Syndication

UpdatesAtomPub

Atom

The Google Data Protocol

RSS 2.0 Atom(Pub)

Google Data

Syndication Format ✓ ✓ ✓

Queries ✓

Updates ✓ ✓

Optimistic Concurrency ✓

Authentication ✓

The Google Data Protocol

Over 15 APIs, 1 Protocol

Many Uses

Case Study: CalGoo

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

The Google Data Protocol

POST /myFeed

<?xml version="1.0"?>

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

<author>

<name>Elizabeth Bennet</name>

<email>liz@gmail.com</email>

</author>

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

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

</entry>

Creating a new resource

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>liz@gmail.com</email>

</author>

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

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

</entry>

Creating a new resource

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>liz@gmail.com</email>

</author>

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

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

</entry>

Updating an entry

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>liz@gmail.com</email>

</author>

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

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

</entry>

Updating an entry

The Google Data Protocol

DELETE /myFeed/1/2/

200 OK

Updating an entry

Demo

Google Data CRUD

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

Demo

Youtube Searcher

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

Client Libraries

PHP

.NET

Java

JavaScriptObjective-C

Python

+ Community Contributed

DemoGoogle Data Sample Applications

My Secret Motivation For Giving This Talk

Google Data APIs

♥App Engine

DemoGoogle Data APIs + App Engine

Questions?

Questions?

Pamela Foxpamelafox@google.com@pamelafox

More Infohttp://code.google.com

Recommended