Living In The Cloud Hosting Data & Apps Using The Google Infrastructure
Introductions Pamela Fox  USC/Google 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 + User Edits = Scaling Nightmare Mo’ Users, Mo’ Problems
Old Architecture code/data
Old Architecture
Old Architecture
Old Architecture
Solution: App Engine
What Is App Engine? Lets you run your  web  application on top of Google’s infrastructure. Servers Network Datastore Backups Pagers “ We wear pagers so you don’t have to.” —  Guido van Rossum Scalable }
App Engine Architecture code data
Simple, Automatic Scaling
App Engine Components code data
Python
Data Store
Data Store db.GqlQuery(&quot;SELECT * FROM Shout &quot; &quot;WHERE who >= 'b '  AND who <  '   c  '   &quot; &quot;ORDER BY when DESC&quot;).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
After 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? 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 A pplication P rogramming I nterface ( )
APIs RPC || REST * SOAP
Remote Procedure Calls fooInstance->addNumbers(2, 3); <?xml version=&quot;1.0&quot;?><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 [Fielding 2000] Re presentational S tate T ransfer ( )
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 RSS feed.
ATOMPub Feed { Entries GET POST PUT DELETE
Google data APIs Protocol Feed Query { Entries GET POST PUT DELETE
The Google Data Protocol REST Google Data Protocol RSS 2.0 Architecture Syndication Updates AtomPub 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=&quot;1.0&quot;?> <feed xmlns=&quot; http://www.w3.org/2005/Atom &quot;> <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=&quot;/myFeed&quot; rel=&quot;self&quot;/> </feed> Requesting a feed or resource
The Google Data Protocol POST /myFeed <?xml version=&quot;1.0&quot;?> <entry xmlns=&quot; http://www.w3.org/2005/Atom &quot;> <author> <name>Elizabeth Bennet</name>  <email> [email_address] </email>  </author> <title type=&quot;text&quot;>Entry 1</title> <content type=&quot;text&quot;>This is my entry</content> </entry> Creating a new resource
The Google Data Protocol 201 CREATED <?xml version=&quot;1.0&quot;?> <entry xmlns=&quot; http://www.w3.org/2005/Atom &quot;> <id> http://www.example.com/id/1 </id> <link rel=&quot;edit&quot; href=&quot; http://example.com/myFeed/1/1/ &quot;/> <updated>2006-01-23T16:26:03-08:00</updated> <author> <name>Elizabeth Bennet</name>  <email> [email_address] </email>  </author> <title type=&quot;text&quot;>Entry 1</title> <content type=&quot;text&quot;>This is my entry</content> </entry> Creating a new resource
The Google Data Protocol PUT /myFeed/1/1/ <?xml version=&quot;1.0&quot;?> <entry xmlns=&quot; http://www.w3.org/2005/Atom &quot;> <id> http://www.example.com/id/1 </id> <link rel=&quot;edit&quot; href=&quot; http://example.com/myFeed/1/1/ &quot;/> <updated>2006-01-23T16:28:05-08:00</updated> <author> <name>Elizabeth Bennet</name>  <email> [email_address] </email>  </author> <title type=&quot;text&quot;>Entry 1</title> <content type=&quot;text&quot;>This is my first entry.</content> </entry> Updating an entry
The Google Data Protocol 200 OK <?xml version=&quot;1.0&quot;?> <entry xmlns=&quot; http://www.w3.org/2005/Atom &quot;> <id> http://www.example.com/id/1 </id> <link rel=&quot;edit&quot; href=&quot; http://example.com/myFeed/1/2/ &quot;/> <updated>2006-01-23T16:28:05-08:00</updated> <author> <name>Elizabeth Bennet</name>  <email> [email_address] </email>  </author> <title type=&quot;text&quot;>Entry 1</title> <content type=&quot;text&quot;>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=&quot;1.0&quot;?> <feed xmlns=&quot; http://www.w3.org/2005/Atom &quot;> <title>Foo</title> <updated>2006-01-23T16:26:03-08:00</updated> <id> http://www.example.com/myFeed </id> <link href=&quot;/myFeed&quot; rel=&quot;self&quot;/> <entry> <id> http://www.example.com/id/1 </id> <link rel=&quot;edit&quot; href=&quot; http://example.com/myFeed/1/1/ &quot;/> <updated>2006-01-23T16:26:03-08:00</updated> <title type=&quot;text&quot;>Entry 1</title> <content type=&quot;text&quot;>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
Client Libraries PHP .NET Java JavaScript Objective-C Python + Community Contributed
Demo Google Data Sample Applications
My Secret Motivation For Giving This Talk Google Data APIs ♥ App Engine
Demo Google Data APIs + App Engine
Conclusion Google Data APIs App Engine Scalable Architecture (AtomPub) APIs
Questions? Pamela Fox [email_address] @pamelafox More Info http://code.google.com ↶

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

  • 1.
    Living In TheCloud Hosting Data & Apps Using The Google Infrastructure
  • 2.
    Introductions Pamela Fox USC/Google http://www.wordle.net/gallery/wrdl/710650/fkedupmonkey_tags
  • 3.
  • 4.
    Tonight’s Agenda GoogleData APIs App Engine
  • 5.
  • 6.
  • 7.
    Viral Spread +User Edits = Scaling Nightmare Mo’ Users, Mo’ Problems
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
    What Is AppEngine? Lets you run your web application on top of Google’s infrastructure. Servers Network Datastore Backups Pagers “ We wear pagers so you don’t have to.” — Guido van Rossum Scalable }
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
    Data Store db.GqlQuery(&quot;SELECT* FROM Shout &quot; &quot;WHERE who >= 'b ' AND who < ' c ' &quot; &quot;ORDER BY when DESC&quot;).fetch(100) query = Shout.all() query.order('-date') query.filter('who >=', 'b') query.filter('who <', ‘c') shouts = query.fetch(100)
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
    Users demand ownershipof their content. Other sites want to access that content. Damn Needy Users
  • 26.
  • 27.
    How Do YouMake Things Accessible? 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 A pplication P rogramming I nterface ( )
  • 28.
    APIs RPC ||REST * SOAP
  • 29.
    Remote Procedure CallsfooInstance->addNumbers(2, 3); <?xml version=&quot;1.0&quot;?><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++
  • 30.
    REST [Fielding 2000]Re presentational S tate T ransfer ( )
  • 31.
    REST Fundamentals ofREST: Application state and functionality is abstracted into discrete resources .
  • 32.
    REST Fundamentals ofREST: Resources are accessible via URLs . /blog/posts/1234
  • 33.
    REST Fundamentals ofREST: Resources share a uniform interface for transferring state . HTTP:// } GET POST PUT DELETE
  • 34.
    RSS/ATOM Feed {Entries Example RSS feed.
  • 35.
    ATOMPub Feed {Entries GET POST PUT DELETE
  • 36.
    Google data APIsProtocol Feed Query { Entries GET POST PUT DELETE
  • 37.
    The Google DataProtocol REST Google Data Protocol RSS 2.0 Architecture Syndication Updates AtomPub Atom
  • 38.
    The Google DataProtocol RSS 2.0 Atom(Pub) Google Data Syndication Format ✓ ✓ ✓ Queries ✓ Updates ✓ ✓ Optimistic Concurrency ✓ Authentication ✓
  • 39.
    The Google DataProtocol Over 15 APIs, 1 Protocol Many Uses
  • 40.
  • 41.
    The Google DataProtocol GET /myFeed 200 OK <?xml version=&quot;1.0&quot;?> <feed xmlns=&quot; http://www.w3.org/2005/Atom &quot;> <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=&quot;/myFeed&quot; rel=&quot;self&quot;/> </feed> Requesting a feed or resource
  • 42.
    The Google DataProtocol POST /myFeed <?xml version=&quot;1.0&quot;?> <entry xmlns=&quot; http://www.w3.org/2005/Atom &quot;> <author> <name>Elizabeth Bennet</name> <email> [email_address] </email> </author> <title type=&quot;text&quot;>Entry 1</title> <content type=&quot;text&quot;>This is my entry</content> </entry> Creating a new resource
  • 43.
    The Google DataProtocol 201 CREATED <?xml version=&quot;1.0&quot;?> <entry xmlns=&quot; http://www.w3.org/2005/Atom &quot;> <id> http://www.example.com/id/1 </id> <link rel=&quot;edit&quot; href=&quot; http://example.com/myFeed/1/1/ &quot;/> <updated>2006-01-23T16:26:03-08:00</updated> <author> <name>Elizabeth Bennet</name> <email> [email_address] </email> </author> <title type=&quot;text&quot;>Entry 1</title> <content type=&quot;text&quot;>This is my entry</content> </entry> Creating a new resource
  • 44.
    The Google DataProtocol PUT /myFeed/1/1/ <?xml version=&quot;1.0&quot;?> <entry xmlns=&quot; http://www.w3.org/2005/Atom &quot;> <id> http://www.example.com/id/1 </id> <link rel=&quot;edit&quot; href=&quot; http://example.com/myFeed/1/1/ &quot;/> <updated>2006-01-23T16:28:05-08:00</updated> <author> <name>Elizabeth Bennet</name> <email> [email_address] </email> </author> <title type=&quot;text&quot;>Entry 1</title> <content type=&quot;text&quot;>This is my first entry.</content> </entry> Updating an entry
  • 45.
    The Google DataProtocol 200 OK <?xml version=&quot;1.0&quot;?> <entry xmlns=&quot; http://www.w3.org/2005/Atom &quot;> <id> http://www.example.com/id/1 </id> <link rel=&quot;edit&quot; href=&quot; http://example.com/myFeed/1/2/ &quot;/> <updated>2006-01-23T16:28:05-08:00</updated> <author> <name>Elizabeth Bennet</name> <email> [email_address] </email> </author> <title type=&quot;text&quot;>Entry 1</title> <content type=&quot;text&quot;>This is my first entry.</content> </entry> Updating an entry
  • 46.
    The Google DataProtocol DELETE /myFeed/1/2/ 200 OK Updating an entry
  • 47.
  • 48.
    The Google DataProtocol GET /myFeed?q=This 200 OK <?xml version=&quot;1.0&quot;?> <feed xmlns=&quot; http://www.w3.org/2005/Atom &quot;> <title>Foo</title> <updated>2006-01-23T16:26:03-08:00</updated> <id> http://www.example.com/myFeed </id> <link href=&quot;/myFeed&quot; rel=&quot;self&quot;/> <entry> <id> http://www.example.com/id/1 </id> <link rel=&quot;edit&quot; href=&quot; http://example.com/myFeed/1/1/ &quot;/> <updated>2006-01-23T16:26:03-08:00</updated> <title type=&quot;text&quot;>Entry 1</title> <content type=&quot;text&quot;>This is my entry</content> </entry> </feed> Searching for a resource
  • 49.
  • 50.
    JSON and RSSOther formats are also supported: ?alt=json ?alt=json-in-script ?alt=kml ?alt=rss
  • 51.
    Client Libraries PHP.NET Java JavaScript Objective-C Python + Community Contributed
  • 52.
    Demo Google DataSample Applications
  • 53.
    My Secret MotivationFor Giving This Talk Google Data APIs ♥ App Engine
  • 54.
    Demo Google DataAPIs + App Engine
  • 55.
    Conclusion Google DataAPIs App Engine Scalable Architecture (AtomPub) APIs
  • 56.
    Questions? Pamela Fox[email_address] @pamelafox More Info http://code.google.com ↶