Serverless Architecture
Ladislav Prskavec
PragueJS, 30.6.2016 1
Serverless is a hot topic in
the software architecture
world.
1
Mike Roberts
PragueJS, 30.6.2016 2
What is Serverless?
PragueJS, 30.6.2016 3
Backend as a Service
and
Function as a Service
PragueJS, 30.6.2016 4
Backend as a Service (BaaS)
4 Firebase - DB + Auth
4 Hoodie - Offline first, PouchDB
4 Algolia - Search
4 Auth0 - SSO, Token Based Auth
4 Kinvey - Mobile Backend as Service
4 Syncano - Assemble your backend
PragueJS, 30.6.2016 5
Function as a Service (FaaS)
4 Amazon Lambda & API Gateway (Nov'14)
4 IBM Bluemix Openwhisk (Feb'16)
4 Google Cloud Functions (Feb'16)
4 Azure Functions (Mar'16)
4 Webtask.io (Mar'15)
PragueJS, 30.6.2016 6
Amazon Lambda
PragueJS, 30.6.2016 7
Amazon Lambda - Inputs
4 Event Source
4 API Gateway
4 S3
4 Kinesis
4 DynamoDB
4 AWS Config
4 Amazon Cognito
4 AWS CloudFormation
4 ...
PragueJS, 30.6.2016 8
Amazon Lambda - Processing
4 Compute Service
4 Languages (NodeJS 0.10 and 4.3, Java, Python)
4 Security Model (IAM, VPC)
4 Cascading
4 Run code at any scale
4 Charged on execution scale
PragueJS, 30.6.2016 9
Amazon Lambda - Outputs
4 Event
4 Storage
4 Messaging
PragueJS, 30.6.2016 10
Cost effective
Scenario - 16k req/day @ 200ms avg = 3200 s/day
$2.97/day - 2 EC2 instances (upfront)
$0.05/day - Lambda (1GB)
PragueJS, 30.6.2016 11
Frameworks
4 Apex
4 Serverless
4 Zappa
4 Sparta
PragueJS, 30.6.2016 12
Apex - http://apex.run
4 in golang support nodejs, golang, python, java
4 optional terraform support
4 multiple deployment targets for different
environments
4 idempotent deployments
4 author @tjholowaychuk
PragueJS, 30.6.2016 13
Serverless - http://www.serverless.com
4 in NodeJS support Javascript only
4 Beta, still many changes, roadmap to 1.0
4 CloudFormation
4 Many Plugins
PragueJS, 30.6.2016 14
Zappa - https://zappa.gun.io
4 in Python support Python
4 https://github.com/Miserlou/lambda-packages
4 https://github.com/Miserlou/django-zappa
PragueJS, 30.6.2016 15
Sparta - http://gosparta.io
4 in Golang support Golang
4 CloudFormation
PragueJS, 30.6.2016 16
Security
4 https://github.com/vandium-io/vandium-node
4 Powerful input validation, Forces values into correct types
4 JSON Web Token (JWT) verification and validation
4 Cross Site Request Forgery (XSRF) detection when using JWT
4 SQL Injection (SQLi) detection and protection
4 Environment variable mapping,
4 Free resources post handler execution
4 Handles uncaught exceptions
4 Promise support
PragueJS, 30.6.2016 17
Testing
4 https://github.com/lambci/docker-lambda/
4 Docker images and test runners that replicate the
live AWS Lambda environment
4 NodeJS 0.10/4.3
4 Python
PragueJS, 30.6.2016 18
Architectures examples
PragueJS, 30.6.2016 19
PragueJS, 30.6.2016 20
PragueJS, 30.6.2016 21
PragueJS, 30.6.2016 22
PragueJS, 30.6.2016 23
PragueJS, 30.6.2016 24
PragueJS, 30.6.2016 25
PragueJS, 30.6.2016 26
PragueJS, 30.6.2016 27
Q & A
PragueJS, 30.6.2016 28
Resources
4 https://aws.amazon.com/lambda/
4 https://github.com/anaibol/awesome-serverless
4 https://cloudcraft.co
4 https://github.com/lambci/docker-lambda/
4 http://www.allthingsdistributed.com/2016/05/aws-lambda-serverless-
reference-architectures.html
4 https://www.thoughtworks.com/radar/techniques/serverless-architecture
4 https://serifandsemaphore.io/azure-cloud-functions-vs-aws-lambda-
caf8a90605dd#.dbk2yntw1
PragueJS, 30.6.2016 29

Serverless Architecture