App Engine overview (Android meetup 06-10)

Post on 11-May-2015

1.665 views 3 download

Tags:

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

Using App Engine to power your native Android applications

Jason CooperDeveloper Programs Engineer

jasonacooper@google.com

What is App Engine?

Spectrum of cloud-based services

Infrastructure as a ServiceIaaS

Spectrum of cloud-based services

Infrastructure as a ServiceIaaS

Software as a ServiceSaaS

Spectrum of cloud-based services

Infrastructure as a ServiceIaaS

Platform as a ServicePaaS

Software as a ServiceSaaS

Spectrum of cloud-based services

Infrastructure as a ServiceIaaS

Platform as a ServicePaaS

Software as a ServiceSaaS

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.

APIs and services

Ensuring portability

Components

Runtimes

LocalSDK

AdminConsole

ScalableInfrastructure

Linux, GFS, Bigtable, custom hardware

Python, JVM

Components

LocalSDK

AdminConsole

Google Plugin for Eclipse

Admin Console

http://appengine.google.com

System Status

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

Why App Engine?

Setting up a (scalable) app is hard!

Setting up a (scalable) app is hard!

Initial setupserversnetworkingload balancerssoftware licenses

Maintenancepatchesupgrades

Forecastingtrafficutilization

TIME!MONEY!

"Run your apps on Google's scalable infrastructure"

Easy to use, scale, and manage

Scale dynamically and automatically

User

App Engine

Frontend

App’sRuntime

Scale dynamically and automatically

User

App Engine

Frontend

App’sRuntime

Scale dynamically and automatically

User

App Engine

Frontend

App’sRuntime

User

User

User

User

Scale dynamically and automatically

App’sRuntime

App’sRuntime

User

App Engine

Frontend

App’sRuntime

User

User

User

User

App Engine Front End

App Engine Front End

App Engine Front End

AppServer AppServer AppServer

Load Balancer

Scale dynamically and automatically

Incoming requests

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

Purchase resources as needed

Demo!

Datastore deep dive

Bigtable

Datastore design

DistributedBigtable + entity groupsACID transactionsOptimistic concurrencyEntities + indexesProtobuf encoded entities

Datastore properties

Core value typesstringintegerfloating pointdatetimeboolean

Composite value typesusers.Userdb.Email...

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

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''')

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")

Bigtable queries

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

Bigtable queries (contd.)

Bigtable queries (contd.)

Bigtable queries (contd.)

Bigtable queries (contd.)

Bigtable queries (contd.)

Bigtable queries (contd.)

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/

Thanks!

Jason CooperDeveloper Programs Engineer

jasonacooper@google.com