Building a business on Google App Engine

A technology-focused case study on how to build a real-world website using a bunch of tech with "Google" in the title »
Andrew Jessup

AppEngine
Objectify
GWT
Sitebricks
Why I'm here
Building your thing on Google AppEngine
(in the real world)
@startthesignal
ajessup@gmail
Google Analytics
Google Analytics API
+ Google Apps Script
KPI Dashboard
you're
the quest to find the best of everything
Anything in the /war folder is accessible
JSP support 'out-of-the-box'
Routing?
Error handing
Templating
MVC?
REST support?
Using Sitebricks...
1. Compile the JAR & add to your project
2. Set all your routes to belong to SiteBricks
3. Use Guice to initate sitebricks
4. Write your controller
(just a POJO with annotations)
4. Write your template
(MUST be valid X(HT)ML!)
to get stuff on the screen
for some extra shine...
to read from the data store
Sitebricks really shines for RESTful APIs...
Google AppEngine
https://appengine.google.com/

Objectify
http://code.google.com/p/objectify-appengine/

SiteBricks
http://code.google.com/p/google-sitebricks/

Appengine-Mapreduce
http://code.google.com/p/appengine-mapreduce/

AppScript for GA->Docs
http://www.automateanalytics.com/2010/04/google-analytics-data-to-google-docs.html
"Google app engine is complete, instantly scaleable runtime environment for web applications. No infrastructure required."
- me, just now
The good...
True push-button deployment
"Infinately scalable"
Truly pay-for-use
Cool things for free...
Mail API
XMPP API
File Uploading API
Image manipulation API
Google & OpenID users API
...and the bad
No request may take longer than 30 sec
Lack of good tools for data manipulation
Bulk data management is tricky
Memcache
Task queues
Blobstore
Datastore
OAuth
Complete sandbox development environment
Google Bulk Uploading Tool
OnPostive AppWrench
GaeBar
in python, is fiddly, expensive
neat, not supported
haven't tried
appengine-mapreduce
Just "Map" right now...
Not a 'true' mapreduce platform
Uses a Hadoop-like API
Datastore Entities
Transformed Entities
Simple example
For every
List entity
owned by a
User entity
create a
SitemapUrl entity
A framework for bulk operations on you datastore entities
May not put more than 1MB at a time
(except via blobstore)
Jobs can be started/monitored from web UI
or from an application callback
Cofiguration for jobs defined in mapreduce.xml
Client code
Server code
Shared code
Client and server JUnit tests
UI, event handling, state management
Web framework
DAOs
Bulk data transforms
Authentication
Models and DTOs
All of this is deployed to app engine
Not web accessible (config, libs, classes etc.)
Same web.xml as for Tomcat, JBoss etc.
Client AND server source code
(gwtc)
(javac)
(javac & gwtc)
AppEngine for Java
A datastore
A servlet container
Object based ("schemaless")
Not relational, but is heirachical
Automatically partitioned and replicated
Can choose between optimisitic and pessimistic concurrency
Java 6 JVM & Java Servlet Standard
Dedicated domain
Requests can take no longer than 30 seconds
Cannot write to the filesystem, only datastore or blobstore
Cannot spawn sub-processes or threads
URL fetch
Logging API
Entity editor
Cannot open sockets
A blob-store
1mb limit on entity size
For large unstructured data (files)
Low level API
Web based entity editor
very basic
Uses a generic PersistanceManager and "Entity" object
Supports queries, transactions (within an entity group), bulk storage
JDO API (AppEngine default)
Generic or specialised PM's
Type-safe ORM
"Owned" relationships
Based on (most of) the JDO spec
Also supports transactions, bulk queries.
Entities may have numeric IDs  or named keys.
Create and save an entity
Query for an entity
Not type-safe
Automatically CDN'd & load balanced
...is nice, standards based, and well documented.

But...
JDO/DataNucleus is heavy!
     (which adds about 2-3s to cold start time)

Not GWT-safe

It's needlessly complicated... especially queries.
Cold start problem
(*if the majority of requests to your app
are not web pages, this will hurt on AppEngine...)
Objectify is a conceptually simillar lightweight ORM designed specifically for AppEngine
Lightweight, adds only ms to cold starts

GWT-serialisable (without DTOs)

Simple usage and syntax
Queries in objectify...
Also...
Memcache support
Easy transactions
Easy data migration
Other lightweight AppEngine ORM's include Twig and SimpleDS
Am I talking too fast? Get the slides from 
http://www.dontstopthesignal.com/
is:
(a) Java compiled into JavaScript

(b) The dumbest idea of all time

(c) The greatest idea of all time
Managing client-side state with lots of interactions is complicated
Compilation is more than minification
UI-binder is solid fried gold
...even more so when targeting like a billion browsers
and code splitting helps defer loading
Example: The Results List
Track everything!
+
The good:

Simple & light
Great for REST
Modular
mVC
The bad:

Immature
Poor templating support
XML templates only
Server side code:
Client (GWT) code:
s
GWT serialisation
A common language between the client and the server

Loading comments...

Please log in to add your comment.

Report abuse

More presentations by Andrew Jessup

  • Noosbox

    Andrew Jessup on