Wednesday, May 28, 2014

Building scalable PHP applications using Google’s App Engine - Notes

My Notes From: Building scalable PHP applications using Google’s App Engine
https://joind.in/10618
*Ian Barber
**Google Developer Relations

There's a command line tool for Google stuff.

Scale Up or **Down** based on usage.
Free to start
PaaS, IaaS

php-minisell.appspot.com

GeoLocation is included in the Request.
You don't get to see proper traffic because it isn't a proper server. It's an app.

Normal PHP gd/json/simplexml PHP 5.4.22
Read Only File System (Google Cloud Storage)

Google URL Fetching Service is automatically used for fetching.
Can't use cURL

Modules - His "Single Favorite Thing" about AppEngine
Scaling modules manually (fixed) or basic (max num) allow control

YAML configs.
Handlers are like Mod Rewrite - Redirect everything to index.php
Static Content you need access to, use static_dir config

app yaml
api yaml
dispatch yaml
queue yaml
cron yaml
dos yaml (DDOS)

**Storage
CloudSQL (MySQL 5.5/5.6)
Cloud Data Store (Schemaless, NoSQL) - FREE TIER!
CDS available via REST API

Reading -
Google_Client() is a bit overly verbose (support for PHP 5.2)
Authentication you may as well use Google_Client for that because it's a huge pain.
Data Store using the Google_Client means highly optimized connection.

Caching -
Memcache - One big pool. No charge for usage. You can pay for fewer evictions by paying for storage.
'Cache-Control' http header. (Classical Gas)

Writing -
Google_Service_Datastore_CommitRequest()
Faster if you type your properties (int/string/etc)
Mutation Upsert

Logging -
Developers Console already takes care of it.
syslog writes to the dev console logging

Polymer Ajax -> Just another Buzzword JS/Display Framework?

Sign In -
Oath - PHP Google Service

Deployment -
appcfg.py --oauth2 update api.yaml app.yaml
git push appengine master (configure for automatic deployment)

Is the Queue good?
Mostly not. One way queue.
You just submit the request and cross your fingers.

A bunch of "Messaging Stuff" in the pipeline.

Data center closest to the user will start new machines if neccessary.
Cloud Data Service runs similar for closes geography.
CloudSQL is a much more normal VM of a DB.

No comments:

Post a Comment