So you're a startup ...

  • You have a great idea
  • You want to get to a Minimum Viable Product (MVP) quickly
  • You'd like to spend your resources wisely
    • Money - your MVP need not cost the earth
    • Human - focus on creating not operating
    • Time - spend time doing rather than configuring

Some of your technology options

Assuming you want to build a web application

Non-Cloud options

  • Shared hosting
  • Server co-location

Cloud options

  • IaaS - you have to
    • install and maintain the operating system
    • install and maintain the software stack
    • write the software
  • PaaS - you have to write the software

Google Cloud Platform

  • Google App Engine - Host your applications
  • Google Compute Engine - Host your Virtual Machines
  • Google Cloud Storage - Host your files
  • Google Cloud SQL - Host your databases
  • Google BigQuery - Analyze data
  • Google Cloud Datastore - No-SQL database in the cloud
  • Details at cloud.google.com

What is Google App Engine?

  • PaaS (Platform as a Service)
  • A web application platform
    • Create applications in Java, Python, Go or PHP
    • Store data in the cloud
  • A set of APIs and services including
    • Data Storage
    • Task Queues
    • Users
  • Easy to
    • Build and Deploy
    • Manage
    • Scale
  • Details at developers.google.com/appengine

A Google App Engine application

You get

  • A domain - yourappname.appspot.com (can use your own too)
  • SSL included

Your application can be written in

  • Java
  • Python
  • Go (*)
  • PHP (*)

Your application will execute in a sandbox

  • More secure
  • More scalable
  • More distributable
(*) Experimental

The sandbox

The sandbox aims to make it better for everyone

  • Applications don't interfere with each other
  • Applications don't rely on machine-specific resources (e.g. filesystem)

Restrictons vary per language, but generally

  • No filesystem access (use Datastore to persist data)
  • No opening sockets (use URLFetch to make HTTP/HTTPS requests)
  • Complete a web request in < 60 seconds (return fast, use Tasks)
  • No system calls
(*) Experimental

How App Engine scales

  • Most basic approach
  • Instances scale automatically as needed
  • You pay for more instances (after your free quota)

How App Engine scales

  • Multiple versions of your application
  • For SSL(*), use v1-dot-myapp.appspot.com instead

(*) Yes - you get SSL included!

How App Engine scales

  • Multiple versions of your application
  • You break your application into multiple modules

The life of an App Engine request

Summary

  • Google App Engine is PaaS - you just write the application
  • You have a choice of programming languages
  • It's easy to get started simply
  • App Engine automatically scales to meet the request demand
  • You can split your application into modules for more scalability

A solid platform

Now let's look more into the details

Developing with Google App Engine

You focus on building awesome web applications, App Engine does the rest

Always remember: developers.google.com/appengine

Four easy steps

  • Step 1: Get the Google App Engine SDK
  • Step 2: Write code
  • Step 3: Test locally
  • Step 4: Deploy to App Engine

If you're using Python or PHP, we have a Git push-to-deploy integration to help

Storing data

  • Datastore
    • Schema-less, NoSQL database
    • Key-value approach
    • Max of 1MB per entity
  • Blobstore
    • Store large amounts of data (e.g. images)
  • Google Cloud SQL(*)
    • MySQL database in the cloud
    • Uses the familiar MySql client library approach
  • Google Cloud Storage(*)
    • Cloud-based file-system
    • ACLs
    • Resume functionality
(*) these have no free quota

Features of Datastore

  • Scalable
    • constant performance regardless of the amount of data you have
  • Highly available
    • distributed and replicated across data centers
  • Eventual consistency
    • Relational Databases are always consistent
    • Datastore consistency
      • strong for entity groups (entities with same parent) (with 1 write/sec limit)
      • eventual for others

Thinking about data differently

  • Design for eventual consistency
  • Denormalise your data
    • storage is cheap
    • store a copy of the entity rather than a reference to the entity
    • this helps decrease joins
  • Entity groups write limit?
    • Use sharded counters
    • Instead of one entity parent, have many
    • write to entity groups at random - parallelize = speed
  • Random keys are best (they're easier to distribute)
  • If you can, use idempotent transactions
    • the same transaction will have the same result if applied many times
    • makes retries easier

Google App Engine Services

Support differs per language

Free quota and then start paying

  • URL Fetch
    • Make an HTTP/S request
    • Use normal lanuage-specific approach, e.g. java.net.URL.openStream
  • Task Queues
    • Defer longer tasks
    • Task has 10 minutes to complete
  • Memcache
    • Store key/value pairs in memory for quicker access
    • 1MB data limit per entry

Google App Engine Services

  • Users
    • Authenticate users
    • Use their Google account (incl. Google Apps accounts) or OpenID(*)
  • Logs
    • Request logs - contains data about each HTTP/S request
    • Application logs - contains messages you log from your application
  • Mail
    • Send mail from your application
    • Receive and process mail with your application
  • Google Cloud Endpoints
    • You make an API
    • App Engine SDK creates libraries for Android, iOS, Javascript
(*)The authentication choice is made when you setup the application and cannot be changed later. OpenID support is experimental.

Summary

  • You have a number of database options
  • Datastore scales massively
  • There are loads of really useful services
  • There is free quota and you pay when you exceed that

A solid platform

with great features and capabilities

Google App Engine Management Console

  • Visit appengine.google.com
  • Perform many admin functions
    • Manage applications and instances
    • View Logs
    • View Data (Datastore, Blobstore)
    • Manage versions
    • Manage Task Queues
    • View detailed quota-usage information

App Engine performance tuning

  • Instance cost vs. Latency
    • As requests increase, App Engine adds instances as needed to control latency
    • It takes time to start an instance
    • This could increase latency
    • You can control the number of idle instances (min, max) but that would cost money

Google infrastructure

Because this is built on Google's infrastructure, these benefits are included

  • Edge caching
  • Pagespeed
  • DoS protection
  • Image serving infra
  • Fast to other APIs

Reasons to use App Engine for your startup

  • It's built on Google's infrastructure (so it's awesome!)
  • You get a lot included
    • Infrastructure - you focus on your app
    • Scalability - from tiny to huge
    • Choice - language, data storage, performance
    • A lot of really useful services included
    • A free quota for usage, and only pay once you exceed that
  • It's free to start
  • SLA covering infrastructure, datastore and search of 99.95% in a month

Useful links

<Thank You!>