Google AppEngine Workshop

Preview:

DESCRIPTION

 

Citation preview

Google AppEngine Workshop

A crash course

Google AppEngine

Not Google Apps

Why Google AppEngine?

Scalable

Scales very very very easilyautomagically

Infrastructure as a Service

Rent-a-car

Platform as a Service

Taxi

Google AppEngine is PaaS

Images demo

Who’s on AppEngine

Optimizely.com, BestBuy.com,

Languages

Python, Java, Go (Experimental)

Objective

Gain a basic knowledge of Google AppEngine

Output

Your own app

Questions

Setup

Create an app on http://appengine.google.comDefault options; High Replication Datastore

Hello World!

Services

Datastore, URLFetch, Users, Email, Memcache (if we have time)

Project URL Shortener

Create Page

index.html

Datastore

Really really fast storage

Storing Data

Create a Model

Class Record(db.Model):name = db.StringProperty()data = db.TextProperty()

Queries

query = Link.all()query.filter(‘url_hash’,’cKj4d’)results = query.fetch(20)

15mins

Shorten some URL’s

URLFetch

Interact with other websites

URLFetch

response = urlfetch.fetch(url=url)status = response.status_codecontent= response.content

Verify those URL’s

Fetch ‘em first!

Users API

Google Accounts

Users API

app.yamllogin: required

Users API

user = users.get_current_user()user.nickname()user.email()user.user_id()

Users API

db.UserProperty()

Users API

user_id is unique at all times

Create History List for Users

Let users see list of their previously shortened url’s

Email

Email

mail.send_mail(sender=admin@app.com, to=user@example.com,subject=”hi”,body=”hello!”)

Shorten a link

And tweet/facebook/plus it

Click and flood!

Memcache

Need for speed(saves you money too!)

Memcache

Need for speed(saves you money too!)

Memcache

memcache.set(key,data)result = memcache.get(key)

Speed ‘em up!

That’s it!

It’s your time to shine now…