Serverless


Resources


The Next Best Thing After PHP!


PHP Is The Best

Wikipedia


18 000 000 000


  • Wikipedia (18 BILLION page views per month)
  • Wordpress

Runs 1/3 of the entire Internet


  • Wikipedia (18 BILLION page views per month)
  • Wordpress (Runs 33% of the entire Internet)
  • Facebook

MAU > 2 BILLION


  • Wikipedia (18 BILLION page views per month)
  • Wordpress (Runs 33% of the entire Internet)
  • Facebook (MAU > 2 BILLION)
  • Skype, Pipedrive, Slack etc


Why Is PHP The Best?

Common Gateway Interface

Feature rich, but terrible, standard library

Frameworks, not libraries

No package manager (PEAR, Composer)

Single request model

State is easy / Concurrency is easy

Optional type system


While PHP as a language sucks, the PHP environment has some unique properties that have made it a very successful choice.


Enter serverless


Serverless traits

  • Requires no management of server hosts or server processes

  • Auto-scales and auto-provisions, based on load

  • Offers costs based on precise usage

  • Has performance capabilities defined in terms other than host size / count

  • Has implicit High Availability


Faas

Baas


Backend-as-a-Service

  • AWS SQS (2004)

  • AWS S3 (2006)

  • Parse Platform (2011, 2017 Facebook)

  • Firebase DB (2012, Google 2014)

  • Auth0 (2013)


Function-as-a-Service


Run backend code without managing your own server systems or your own long-lived server applications


  • AWS Lambda
  • Google Cloud Functions
  • Azure Functions
  • Cloudflare Workers
  • Apache OpenWhisk
  • Kubeless
  • Fn Project

But why?


Good code

  • Single Responsibility Principle

  • KISS and YAGNI

  • Minimal dependencies

  • Efficient

  • Maintainable

  • The right tool for job




Backend-as-a-service

  • Single Responsibility Principle
  • KISS and YAGNI

Function-as-a-service

  • Minimal dependencies
  • Efficient
  • Maintainable
  • The right tool for job

Serverless architecture

  • Simple state
  • Easy and cheap concurrency
  • Optional type safety

But, but… microservices!!1


Microservices

  • Hard to define
  • Hard to orchestrate
  • Inefficent utilization
  • Need cluster management
    • Fargate
    • Kubeless

Tools and stuff


serverless.com/framework

  • Vendor agnostic
  • Language agnostic
  • Functions
  • Events
  • Resources
  • Services
  • Plugins
  • Node.js 😞

fnproject.io

  • Serverless platform on Docker
  • Vendor agnostic
  • Language agnostic
  • Golang 😏

zappa.io

  • Serverless Python Web Services
    • Flask/Django
    • Any wsgi app
  • AWS Lambda and API Gateway
    • Async task execution
    • AWS events

claudiajs.com

  • Serverless JavaScript, the easy way
  • AWS Lambda and API Gateway
  • Node.js apps

gosparta.io

  • Serverless go microservices for AWS
  • AWS Lambda and API Gateway
    • AWS Events
  • Golang

AWS Chalice

  • Python Microframework
  • AWS Lambda and API Gateway
    • IAM integration
    • AWS events (+Domovoi)

AWS SAM

  • Framework for building serverless apps
  • Built and supported by AWS
  • Language agnostic

Terraform

  • Cloud agnostic
  • Language agnostic
  • Existing modules

Good to know

  • Production Ready™

  • Limited function execution times

  • Documentation sucks


kerma.codes/slides/serverless

resources