hands on app engine

14
Hands on App Engine GCPUG.TW / Simon Su

Upload: simon-su

Post on 21-Jan-2017

1.119 views

Category:

Technology


1 download

TRANSCRIPT

Hands on App EngineGCPUG.TW / Simon Su

What is App Engine?An integrated software

architecture and full managed by

google~

CloudDatastore

CloudSQL

CloudStorage

Runtime

Cloud Endpoints Task Queues

GAE Scaling

App Engine ArchitectureClosest Google

Data Center

Edge Cache

Google Frontend

App Engine Data Center

App Master(App Engine Management Layer)

Static Servers

App Engine

Frontend

App Servers

Application Instances

Application Instances

Application Instances

Google’s FiberISP

MemcacheGAE

User

Datastore

Task Queues

GAE

Scheduled TasksGAE

Search APIGAE

Logs APIGAE

Cloud ConsoleManage your AppEngine

Resources

Install SDKPython Launcher

https://cloud.google.com/appengine/downloads

Hello World!Create your first project

Run use CLI locallyUsing “gcloud preview app”

# cd $your-project

# gcloud preview app run ./app.yaml

DatastoreUnlimited store with transaction

support and high replicate

class Employee(db.Model): name = db.StringProperty(required=True) hire_date = db.DateProperty()

e = Employee(name="Antonio Salieri")e.hire_date = datetime.datetime.now().date()e_key = e.put()

scalable and reliable storage

query

transactions

Bigtable

Megastore

Datastore

Memcache from google.appengine.api import memcache...

value = memcache.get(key)

if value is None:value = get_value_from_db(key) if not memcache.add(key, value): logging.error('Memcache add failed.')...

Improve Application Performance

Reduce Application Cost

Task QueueTask Queue

Web Requests Worker

/process_form?status=processed&form_data=...

Ancillary Services

External APIs

Task Queue

queue:

- name: push-queue-1

rate: 1/s

- name: pull-queue-1

mode: pull

queue = taskqueue.Queue("Qname")

task = taskqueue.Task(...)

queue.add(task)

Managed VMUsing Standard VM

Deploy to Production

$ gcloud preview app deploy \

./app.yaml \

--set-default \

--version demo

Managed VMCustom Runtime