google app engine at a glance

17
Google App Engine at a glance Stefan Christoph

Upload: stefan-christoph

Post on 16-May-2015

1.918 views

Category:

Technology


2 download

DESCRIPTION

Short intro to Google App Engine 4 Java

TRANSCRIPT

Page 1: Google App Engine At A Glance

Google App Engine at a glanceStefan Christoph

Page 2: Google App Engine At A Glance

Introduction

• PaaS

• Running own Apps in Google infrastructure

• Supports different runtime environments

– Java ( JRE 6 with limitations, standard APIs like

JDO, JPA, JavaMail)

– Python ( 2.5.2, standard library)

• App runs in sandbox

• Automatic scaling and load balancing

Page 3: Google App Engine At A Glance

Architecture - Overview

InternetInternet

Loadbalancer

Frontend

Static File Server Static File Server…

Frontend

Application Server Application Server…

http://<version>.<appid>.appspot.com/some/path

static filesstatic files resource files

resource filesprogram files

program files

Page 4: Google App Engine At A Glance

Google Infrastructure

Architecture - Application Server

Google App Engine

Application sandbox /Runtime Environment

Application

Internal Services

Lo

ggin

g

Da

tasto

re

Blo

bsto

re

Ima

ge

Ta

sks

Me

mca

che

Au

the

ntic

atio

n

External Services

URLFetcher

Mail

XMPP

Bigtable

Inte

rnet

Inte

rnet

memcache

Page 5: Google App Engine At A Glance

Services / Capabilities

• Sandbox

• Runtime Environment / Servlet Container– Java Interpreter

– Read only filesystem

– Memory

• Data Store

• Services– User authentication

– URL Fetch

– Mail

– XMPP

– Memcache

– Image Manipulation

– Scheduled tasks / Task Queues

– Blobstore

– Logging

Page 6: Google App Engine At A Glance

Limitations

• Programming Model– Application runs in sandbox and can not

• Write to filesystem

• Make arbitary network connections

• Use multiple threads/processes

• Perform long-lasting processing

• Permissions

• Know about other instances/applications

– Sandbox restrictions are implemented as JVM

• Quotas (Requests, In/Out bandwidth, CPU time, API calls)– Billable Quotas

• Set by the application owner to keep in budget

– Fixed Quotas• Set by GAE to ensure integrity of the system

Page 7: Google App Engine At A Glance

Development Environment

• Tools

– Development Server

– Application lifecycle management

– Eclipse plugins / Firefox plugin (GWT)

– Local unit testing / debugging

Page 8: Google App Engine At A Glance

Deployment Environment

• Application is deployed as war which contains:

– Static files

– Resource Files

– Program Files

– Deployment Descriptor

• Rich Admin web console

• Deployment is integrated in IDE

• Deploy multiple version of the application at the same time

Page 9: Google App Engine At A Glance

Framework

GWT-RPC

<<interface>>

ServiceDefTarget

<<interface>>

RemoteServiceRemoteServiceServlet

Our stuff

<<interface>>OurServiceAsync

<<interface>>OurService

OurServiceImpl

extends

implements

extends

related

GWT framework (autogenerated)

ProxyService

implements

implements

Client Server

Page 10: Google App Engine At A Glance

App Engine Datastore

• Non-relational Data-store

• Stores data as entities

• APIs:– JDO / JPA

– Low Level API

Entity

key

Application ID

Kind

ID / Name

“data”

Property *

name Value *

• Distribution, replication, load balancing behind the scene

• Based on Bigtable / GFS

Page 11: Google App Engine At A Glance

Using Email/XMPP

• Create Servlet for handling incoming messages

• Ensure proper url configuration ins deployment descriptor

• Configure as inbound service

• XMPP

– implementation supports no Group Chat

[email protected] / [email protected]

Page 12: Google App Engine At A Glance

Logging

• Java.util.logging.Logger

• View in Administration Console

• Download logfiles

• Standard output / standard error are written

to the logs

Page 13: Google App Engine At A Glance

Local Unit Testing

• LocalTestServiceHelper provides

– local test environment including GAE services

• Datastore

• XMPP/Mail

• User Management

– Capability to use JUnit framework

Page 14: Google App Engine At A Glance

Memcache Service

• Distributed in memory cache

• Configurable expiration time but

• Unreliable might be vanished at any time

• Supported Interfaces :

– JACHE (JSR 107: JCACHE – Java Temporary

Caching API)

– The Low-Level Memcache API (documentation)

Page 15: Google App Engine At A Glance

User Management – Google Accounts

• Optional feature

• Utilize Google Authentication system in your

own application -> focus on business logic

• Access to Google account data -> email, id

• Access constraints based on roles

– Declarative in deployment descriptor (URL

based)

– programmatically

Page 16: Google App Engine At A Glance

Managing Applications

• Administration Console

@http://appengine.google.com/a/yourdomai

n.com

– Application Dashboard

– Multiple application versions

– Analyzing log files (including admin)

– Analyzing resource usage

Page 17: Google App Engine At A Glance

Further Readings

• Google App Engine documentation

• GWT documentation

• “Beginning Java Google App” – Kyle Roche,

Jeff Douglas

• “Programming Google App Engine” – Dan

Sanderson