App Engine overview (Android meetup 06-10)

43
Using App Engine to power your native Android applications Jason Cooper Developer Programs Engineer [email protected]

Transcript of App Engine overview (Android meetup 06-10)

Page 1: App Engine overview (Android meetup 06-10)

Using App Engine to power your native Android applications

Jason CooperDeveloper Programs Engineer

[email protected]

Page 2: App Engine overview (Android meetup 06-10)

What is App Engine?

Page 3: App Engine overview (Android meetup 06-10)

Spectrum of cloud-based services

Infrastructure as a ServiceIaaS

Page 4: App Engine overview (Android meetup 06-10)

Spectrum of cloud-based services

Infrastructure as a ServiceIaaS

Software as a ServiceSaaS

Page 5: App Engine overview (Android meetup 06-10)

Spectrum of cloud-based services

Infrastructure as a ServiceIaaS

Platform as a ServicePaaS

Software as a ServiceSaaS

Page 6: App Engine overview (Android meetup 06-10)

Spectrum of cloud-based services

Infrastructure as a ServiceIaaS

Platform as a ServicePaaS

Software as a ServiceSaaS

Page 7: App Engine overview (Android meetup 06-10)

Sandbox restrictions

Applications cannot currently:open a socket or access another host directlyspawn a sub-process or threadmake other system callswrite to the filesystem

Python applications cannot include C extensions or other code that must be compiled.

Java applications cannot use unapproved JRE classes.

Page 8: App Engine overview (Android meetup 06-10)

APIs and services

Page 9: App Engine overview (Android meetup 06-10)

Ensuring portability

Page 10: App Engine overview (Android meetup 06-10)

Components

Runtimes

LocalSDK

AdminConsole

ScalableInfrastructure

Linux, GFS, Bigtable, custom hardware

Python, JVM

Page 11: App Engine overview (Android meetup 06-10)

Components

LocalSDK

AdminConsole

Page 12: App Engine overview (Android meetup 06-10)

Google Plugin for Eclipse

Page 13: App Engine overview (Android meetup 06-10)

Admin Console

http://appengine.google.com

Page 14: App Engine overview (Android meetup 06-10)

System Status

http://code.google.com/status/appengine

Page 15: App Engine overview (Android meetup 06-10)

Why App Engine?

Page 16: App Engine overview (Android meetup 06-10)

Setting up a (scalable) app is hard!

Page 17: App Engine overview (Android meetup 06-10)

Setting up a (scalable) app is hard!

Initial setupserversnetworkingload balancerssoftware licenses

Maintenancepatchesupgrades

Forecastingtrafficutilization

TIME!MONEY!

Page 18: App Engine overview (Android meetup 06-10)
Page 19: App Engine overview (Android meetup 06-10)

"Run your apps on Google's scalable infrastructure"

Page 20: App Engine overview (Android meetup 06-10)

Easy to use, scale, and manage

Page 21: App Engine overview (Android meetup 06-10)

Scale dynamically and automatically

User

App Engine

Frontend

App’sRuntime

Page 22: App Engine overview (Android meetup 06-10)

Scale dynamically and automatically

User

App Engine

Frontend

App’sRuntime

Page 23: App Engine overview (Android meetup 06-10)

Scale dynamically and automatically

User

App Engine

Frontend

App’sRuntime

User

User

User

User

Page 24: App Engine overview (Android meetup 06-10)

Scale dynamically and automatically

App’sRuntime

App’sRuntime

User

App Engine

Frontend

App’sRuntime

User

User

User

User

Page 25: App Engine overview (Android meetup 06-10)

App Engine Front End

App Engine Front End

App Engine Front End

AppServer AppServer AppServer

Load Balancer

Scale dynamically and automatically

Incoming requests

Page 26: App Engine overview (Android meetup 06-10)

Free quota

Every App Engine application receives the following at no cost:

6.5 CPU hours per day1.0 GB incoming bandwidth per day1.0 GB outgoing bandwidth per day1.0 GB storage (data + indexes)2,000 emails sent per day

Page 27: App Engine overview (Android meetup 06-10)

Purchase resources as needed

Page 28: App Engine overview (Android meetup 06-10)

Demo!

Page 29: App Engine overview (Android meetup 06-10)

Datastore deep dive

Page 30: App Engine overview (Android meetup 06-10)

Bigtable

Page 31: App Engine overview (Android meetup 06-10)

Datastore design

DistributedBigtable + entity groupsACID transactionsOptimistic concurrencyEntities + indexesProtobuf encoded entities

Page 32: App Engine overview (Android meetup 06-10)

Datastore properties

Core value typesstringintegerfloating pointdatetimeboolean

Composite value typesusers.Userdb.Email...

Lists (multi-valued)Text and binary blobsReferences (keys)

Page 33: App Engine overview (Android meetup 06-10)

Datastore - what's familiar?

IndexesACID transactionsGQL (SQL-like syntax):

db.GqlQuery(''' SELECT * FROM Story WHERE title = 'App Engine Launch' AND rating >= 10 ORDER BY rating, created DESC''')

Page 34: App Engine overview (Android meetup 06-10)

Datastore - what's different?

No inner, outer, or natural joinsDense index scansPer-entity metadataSoft schema (no DDL!)Queries as object syntax:

q = Story.all()q.filter("title =", 'App Engine Launch')q.filter("rating >=", 10)q.order("-rating")q.order("-created")

Page 35: App Engine overview (Android meetup 06-10)

Bigtable queries

1. Scan rows2. Pre-generate index tables3. Each index row "points" to entity

Page 36: App Engine overview (Android meetup 06-10)

Bigtable queries (contd.)

Page 37: App Engine overview (Android meetup 06-10)

Bigtable queries (contd.)

Page 38: App Engine overview (Android meetup 06-10)

Bigtable queries (contd.)

Page 39: App Engine overview (Android meetup 06-10)

Bigtable queries (contd.)

Page 40: App Engine overview (Android meetup 06-10)

Bigtable queries (contd.)

Page 41: App Engine overview (Android meetup 06-10)

Bigtable queries (contd.)

Page 42: App Engine overview (Android meetup 06-10)

Querying geospatial data

Latitudes and longitudes can't be queried separately in ranges. More and more solutions use geohashes or geocells to do geospatial queries. Examples:

GeoModelhttp://code.google.com/p/geomodel/http://code.google.com/p/javageomodelSupports both bounding-box and proximity queries

mutinyhttp://code.google.com/p/mutiny/ Sample: http://mutiny.appspot.com

geodatastorehttp://code.google.com/p/geodatastore/

Page 43: App Engine overview (Android meetup 06-10)

Thanks!

Jason CooperDeveloper Programs Engineer

[email protected]