Google Technology User Group #4 An Introduction to the Google App Engine by George Holler 17 November 2010

Download Report

Transcript Google Technology User Group #4 An Introduction to the Google App Engine by George Holler 17 November 2010

Google Technology User Group #4
An Introduction to the Google App Engine
by George Holler
17 November 2010
The Google App Engine
Platform
For building web apps in the cloud
Scalable
Automatic scaling and load balancing
Cost
Pay for what is used, with limits you set
Code
In Python or Java
SDK
Local development environment
APIs
Google APIs for web programming
Architecture
Sandbox – What you can do
Write Servlets (including filters)
Use GWT
Schedule and enqueue tasks
Store data (Google Datastore)
Log messages (java.util.logging)
Make HTTP requests
Can read static files from file system
Sandbox – What you can't do
Can't spawn new threads
Can't write to file system
Can only use white listed Java classes and methods
Can't make arbitrary network connections
Can't use JNI or other native code
Can't take more than 30 seconds in a request.
APIs...
Datastore API
Interface to save and retrieve data
Memcache API
High performance in-memory key-value cache
Mail API
Send and receive emails
URL Fetch API
Access web resources
Users API
Interface with Google Accounts
Images API
Interface to manipulate images (jpg, png)
Blobstore API
Interface for saving large binary data
XMPP API
Interface for Instant Messaging
Task Queue API
Interface to enqueue tasks for app (exp)
Namespaces API
Multitenancy
OAuth API
Third party authentication (exp)
Mapper API
For MapReduce (exp)
Java API mapping
Google Datastore
A schemaless object datastore
Has a query engine
Supports atomic transactions
Not a SQL database
No Joins
Limited queries with GQL
Google Datastore
Stores and retrieves data object called entities, which hold properties.
Two entities of the same kind are not obligated to have the same properties, or
use the same value types for the same properties.
GQL is a SQL-like way of querying db
All queries that operate on more than one field must have an index
Limits on GQL, e.g. cannot use inequality filters on more than one entity property
per query, cannot find all the entities where a field is not a certain value.
Google Datastore APIs
JDO - included, uses DataNucleus enhancer
JPA – included, uses DataNucleus enhancer
Low-level API - included
Twig - Uses low-level API - http://code.google.com/p/twig-persist/
Objectify - Uses low-level API - http://code.google.com/p/objectify-appengine/
SimpleDS - Uses low-level API - http://code.google.com/p/simpleds/
Google App Engine Dashboard
Logs (per app version)
Manage App Versions
View Datastore statistics
Datastore Viewer
Blobstore Viewer
View indexes
Manage task queues
View quota info
Manage billing and view billing history
Check running instances
Add/remove admin users for this app
Google App Engine Dashboard
System Status
App Engine Hard Limits
Apps per developer
10
Time per request
30 sec
Blobstore size (Total file size per app)
2GB
HTTP request size
10 MB
HTTP response size
10 MB
Datastore item size
1 MB
Number of files (app and static files)
3000
Size of any static or app file
10 MB
Application code size
150 MB
Number of values in an index for an entity
5000
Number of entities returned in a query at a time 1000
Number of entities in a batch put or delete
500
App Engine Tools
Local Development Server
Use appcfg for command line application deployment
Google plugin for Eclipse - http://code.google.com/eclipse/
AppStats – enable in your app and measure performance
Local Unit Testing - Write tests that use local service implementations.
Maven plugin for deploying - http://code.google.com/p/maven-gae-plugin/
Local development server can generate indexes based on running code’s queries
Remote API – Enable in your app to be able to use Python tools
Resources
GAE Dashboard: http://appengine.google.com
GAE Docs:
http://code.google.com/appengine/docs/
System Status:
http://code.google.com/status/appengine
My Blog:
http://georgeholler.wordpress.com
My Email: georgeholler @ gmail.com
ood Bye!