want to be able to scale. • We need high availability. • We need to take care of security upgrades. We just don't want to do these things. That's PaaS.
a virtual machine and I'll code my way out. • Platform as a Service: Give me a bag of services and I'll code my way out. – A lot of best practices included. – Also, a lot of constraints.
availability. • Sessions should be sticky. • If a server is down, another should assume the session. • Multiple zones! • Keep these servers upgraded, because, security.
be fault tolerant. • Sessions should be sticky • If a server is down, another should assume the session. • Multiple zones! • Upgrade technology WHY U NO WORK
but when the first request is received. – The user that triggered this request will be waiting. • Web requests have 60 seconds before timing out. – Good enough for Python and Go but not so much to start a Java application.
at least one idle instance. – It doesn't always work, though :( • Limit the number of libraries and do not search in the classpath. • Prefer lightweight D.I. frameworks like Guice or Dagger to Spring.
your queries are independent of your current database provider. • Avoid dependence with your ORM library. • Transparent relationships between domain objects.
your queries are independent of your current database provider. • Avoid dependence with your ORM library. • Transparent relationships between domain objects. NOT REALLY
or Slim3 – Disclaimer: I am the developer of SimpleDS, so I'm obviously biased. • Python: NDB – Developed by Guido van Rossum at Google. • Native Datastore – Sometimes you just need to go hardcore.
Writes require transactions and disk access. • Max. 5 writes per sec for a single entity group. • Use batch operations, sharding and write-behind cache for better performance. • Reads in App Engine are cheap. • No transactions. Data can be read from local cache (fast!). • No limit to the number of concurrent reads.
with Jeff Barr, Amazon's chief web services evangelist. He let drop an interesting tidbit. Amazon has both SOAP and REST interfaces to their web services, and 85% of their usage is of the REST interface.
Jackson to get maximum flexibility. • Use Google Cloud Endpoints for fast JSON API prototyping. @Api(name = "helloworld", version = "v1") public class Greetings { @ApiMethod(name="greetings.get", httpMethod="get") public HelloGreeting getGreeting(@Named("id") Integer id) { return entityManager.get(id); } }
are handled as web requests. – Arguments are passed as POST parameters. Queue queue = QueueFactory.getDefaultQueue(); queue.add( withUrl("/worker") .param("key", key) );
of 60 sec) – Still, any query will timeout after 30 sec. • Think of tasks like spawning threads that outlive the current request. – With automatic retries and exponential backoff. – Threads are allowed, but they would get killed when the current request ends. Still, that's a lot of URLs to handle.
user ASAP, postpone anything that is not critical. – Sending e-mails, cascading changes, creating search index entries... – Automatic retries and exponential backoff FTW! • Remember that all tasks must be idempotent.
the Datastore • Optimize your application startup • Don't try to apply SQL standards • Batch your Datastore operations • Denormalize where possible • Postpone non-critical tasks • It's a compromise: harder to develop, but easier to manage
Cloud Platform Community on Google+ • Also: @nachocoloma Where I mostly tweet about HTML5 and JavaScript http://gplus.to/icoloma Where I post about the Google Cloud Platform and other longer-than-140c stuff