SlideShare a Scribd company logo
Yan Cui @theburningmonk
ourneJ Yto the
cloud
the how and why of serverless
Yan Cui
http://theburningmonk.com
@theburningmonk
Independent Consultant
Yan Cui
http://theburningmonk.com
@theburningmonk
https://productionreadyserverless.com http://bit.ly/complete-guide-to-aws-step-functions
Yan Cui
http://theburningmonk.com
@theburningmonk
AWS user since 2009
Journey to the cloud, the why and how of serverless
2006
big meetings to decide how to provision new servers
3-6 months (!!!!) turn around time
client tier
logic tier
data tier
SQL
monolithic, 3-tier architectures
requires downtime for deployment
requires downtime for deployment
(OK for businesses that aren’t 24/7)
install monitoring agents/daemons on server
Journey to the cloud, the why and how of serverless
big-bang releases
2010
on premise cloud
2012
2016
2019
EC2
EC2
EC2
EC2
months minutes
EC2
EC2
months minutes
EC2
EC2
minutes
compute becoming a commodity
Genesis Custom-built Product Commodity
http://bit.ly/wardley-maps
EC2
EC2
minutes
Journey to the cloud, the why and how of serverless
Journey to the cloud, the why and how of serverless
users are distributed
around the world
systems have to be
available 24/7
Journey to the cloud, the why and how of serverless
SCALABILITY
SCALABILITY
RESILIENCE
SCALABILITY
RESILIENCE
SECURITY
SCALABILITY
RESILIENCE
SECURITY
SPEED
Journey to the cloud, the why and how of serverless
Capex Opex
capital expenditure operational expenditure
Capex Opex
capital expenditure operational expenditure
levelled the playing field
competition
competition user demand &
expectations
Journey to the cloud, the why and how of serverless
faster delivery
faster feedback loop
we need…
Journey to the cloud, the why and how of serverless
big-bang releases small, frequent releases
Journey to the cloud, the why and how of serverless
co-evolution
waterfall agile
silos DevOps
practice
activity
of
and
scale
scale complexity
but our cognitive capacity hasn’t increased…
leverage: do more with less
EC2
EC2
EC2
EC2
we’re still managing
infrastructure
https://bit.ly/2Im61VK
“Unless you’re an infrastructure company,
infrastructure is basically overhead.”
Matt Klein
infrastructure
you
EC2EC2
EC2 RDSDynamoDB SQS
Journey to the cloud, the why and how of serverless
Monoliths Microservices
EC2
EC2
EC2 DynamoDB
EC2 RDS
EC2 SQS DynamoDB
EC2
EC2
EC2 DynamoDB
EC2 RDS
EC2 SQS DynamoDB
we’re managing
lots more
infrastructure!
we need a better abstraction for the “server”
we need an immutable infrastructure
70% utilization
monolith
10% utilization
x 10
microservices
70% utilization
monolith
10% utilization
x 10
microservices
Journey to the cloud, the why and how of serverless
EC2
EC2
EC2 DynamoDB
EC2 RDS
EC2 SQS DynamoDB
EC2 DynamoDB
EC2 RDS
EC2 SQS DynamoDB
DynamoDB
RDS
SQS DynamoDB
EC2 DynamoDB
EC2 RDS
EC2 SQS DynamoDB
DynamoDB
RDS
SQS DynamoDB
EC2 docker
us-east-1a us-east-1b
us-east-1a us-east-1b
0
Theory
“it works on
my machine!”
“production
ready!”days
0
Theory
“it works on
my machine!”
“production
ready!”days
no log collection
0
Theory
“it works on
my machine!”
“production
ready!”days
no log collection no monitoring
no alerting
0
Theory
“it works on
my machine!”
“production
ready!”days
no log collection no monitoring
no alerting
can’t scale
no load balancing
0
Theory
“it works on
my machine!”
“production
ready!”days
no log collection no monitoring
no alerting
can’t scale
no redundancy
no load balancing
0
Theory
“it works on
my machine!”
“production
ready!”days
no log collection no monitoring
no alerting
can’t scale
no redundancy
what security?
no load balancing
Journey to the cloud, the why and how of serverless
Journey to the cloud, the why and how of serverless
Journey to the cloud, the why and how of serverless
0
Theory
“it works on
my machine!”
“production
ready!”
0
Reality
“it works on
my machine!”
“production
ready!”
days
days
Journey to the cloud, the why and how of serverless
mooooo..
2015
SQL NoSQL
OOP Functional
On Premise Cloud
Waterfall Agile
Monoliths Microservices
2016
2016
Server-ful Serverless
https://gtnr.it/2KGyGCM
Journey to the cloud, the why and how of serverless
What do you mean
by ‘serverless’?
“Serverless”
Journey to the cloud, the why and how of serverless
Gojko Adzic
It is serverless the same way
WiFi is wireless.
http://bit.ly/2yQgwwb
Serverless means…
don’t pay for it if no-one uses it
don’t need to worry about scaling
don’t need to provision and manage servers
“Function-as-a-Service”
AWS Lambda
Azure Functions
Google Cloud Functions
Auth0 Webtask
Spotinst Functions Kubeless
IBM Cloud Functions
AWS Lambda
AWS Lambda
API Gateway IOT SNS Kinesis CloudWatch
IaaS
Function
Application
Runtime
Container
OS
Virtualization
Hardware
CaaS
Function
Application
Runtime
Container
OS
Virtualization
Hardware
PaaS
Function
Application
Runtime
Container
OS
Virtualization
Hardware
FaaS
Function
Application
Runtime
Container
OS
Virtualization
Hardware
User User (scalable unit) Provider
IaaS
Function
Application
Runtime
Container
OS
Virtualization
Hardware
CaaS
Function
Application
Runtime
Container
OS
Virtualization
Hardware
PaaS
Function
Application
Runtime
Container
OS
Virtualization
Hardware
FaaS
Function
Application
Runtime
Container
OS
Virtualization
Hardware
User User (scalable unit) Provider
Serverless
FaaS
other services…
Database
Storage
BI
Simon Wardley
Serverless will fundamentally change
how we build business around
technology and how you code.
Why serverless?
more Scalable
1,000 concurrent executions (soft limit)
500 increase per minute (hard-ish limit)
1,000 concurrent executions (soft limit)
500 increase per minute (hard-ish limit)
AUTO-APPROVED
RAISE TO 3000
1,000 concurrent executions (soft limit)
500 increase per minute (hard-ish limit)
containers are reused
100% SERVERLESS
IN PRODUCTION
80 MILLION
MONTHLY USERS
Resilience
(built-in redundancy and multi-AZ)
http://bit.ly/2Vzfexo
Secure
Shared Responsibility Model
Shared Responsibility Model
protection from OS attacks
Amazon automatically apply latest patches to host VMs
Journey to the cloud, the why and how of serverless
Journey to the cloud, the why and how of serverless
Cheaper
(don’t pay for idle servers)
Journey to the cloud, the why and how of serverless
what businesses
care about
what we can
easily measure
what most of your
budget is spent on
Deploy
serverless.yml
{}
Code
{}
Code
serverless.yml
serverless.yml
{}
Code
S3
{}
Code
serverless.yml
S3 CloudFormation
{}
Code
serverless.yml
S3 CloudFormation
request
blue-green deployment
request
blue-green deployment
request
blue-green deployment
request
blue-green deployment
req/s
auto-scaling
us-east-1a
us-east-1b
us-east-1c
multi-AZ
the DevOps forcethe DevOps force
is strong with serverlessis strong with serverless
idea production
choose language
+ framework
master language
+ framework
figure out
deployment
configure AMI
configure ELB
configure
autoscaling
capacity planning
over-provision for
launch
are we doing
microservices?
configure CI/CD
idea production
choose language
+ framework
master language
+ framework
figure out
deployment
configure AMI
configure ELB
configure
autoscaling
capacity planning
over-provision for
launch
are we doing
microservices?
configure CI/CD
idea production
greater Velocity from idea to product
minimise undifferentiated
heavy-lifting
less ops responsibility on
your shoulders
infrastructure
you
DynamoDBDynamoDB
RDS
SQS DynamoDB
DynamoDB
API Gateway Lambda
API Gateway Lambda RDS
Lambda DynamoDBSQS
abstractionlayer
abstractionlayer
paradigm
shift!!!!
paradigm shift
paradigm shift
opportunity
performance
time
serverless
containers
performance
time
serverless
containers
higher ceiling
speed
performance
time
serverless
containers
higher ceiling
strong baseline
performance
time
serverless
containers
dilemma
zone
paradigm shift
opportunity
challenges
broken existing toolchains
observability securityframework
best practices are still emerging
๏ tips for writing Lambda functions
๏ migration to serverless
๏ serverless ops
๏ design patterns
๏ performance optimization
๏ chaos engineering
๏ security
๏ general thoughts and techniques
http://bit.ly/theburningmonk-serverless
https://bit.ly/production-ready-serverless
is serverless production-ready?
Journey to the cloud, the why and how of serverless
Journey to the cloud, the why and how of serverless
there are no silver bullets
Journey to the cloud, the why and how of serverless
0
Containers
“it works on
my machine!”
“production
ready!”days
Serverless
0
“it works!”
“production
ready!”
days
0
Containers
“it works on
my machine!”
“production
ready!”days
Serverless
0
“it works!”
“production
ready!”
days
v2! v3! v4! v5! v6!
EC2 docker
us-east-1a us-east-1b
us-east-1a us-east-1b
Theory
Reality
Reality
scale-to-zero
serverful serverless
us-east-1a us-east-1b
us-east-1a us-east-1bscaled to zero!
Journey to the cloud, the why and how of serverless
What about containers?
Journey to the cloud, the why and how of serverless
important, but
invisible subsystem
https://read.acloud.guru/acg-faas-and-furious-b9574b6675c5
serverless is NOT the goal!
build products customers love to use
test ideas against the
market quickly
iterate on
s
deliver frequently,
deliver quickly
own less technology,
focus on creating Business Values
own less technology,
focus on creating Business Values
(serverless is just a good fit for this mindset)
scaling limits VPC long-running
cold starts performance
scaling limits VPC long-running
cold starts performance
scaling limits VPC long-running
cold starts performance
http://bit.ly/2X0ksCY
http://bit.ly/2X0ksCY
http://bit.ly/2X0ksCY
scaling limits VPC long-running
cold starts performance
FREQUENCY DURATION
FREQUENCY DURATION
dictated by user traffic,
out of your control
FREQUENCY DURATION
optimize this!
minimise the duration of cold starts so
they fall within acceptable latency range
use Node.js, Python or Golang
trim dependencies
full AWS-SDK
https://theburningmonk.com/2019/03/just-how-expensive-is-the-full-aws-sdk/
full AWS-SDK
https://theburningmonk.com/2019/03/just-how-expensive-is-the-full-aws-sdk/
dynamodb only
full AWS-SDK
https://theburningmonk.com/2019/03/just-how-expensive-is-the-full-aws-sdk/
dynamodb only
webpack!
https://theburningmonk.com/2019/03/just-how-expensive-is-the-full-aws-sdk/
~200ms
keep functions single-purposed
http://bit.ly/2I7GJeJ
scaling limits VPC long-running
cold starts performance
Journey to the cloud, the why and how of serverless
scaling limits VPC long-running
cold starts performance
Journey to the cloud, the why and how of serverless
+ pay-per-use?
Simon Wardley
Serverless will fundamentally change
how we build business around
technology and how you code.
Journey to the cloud, the why and how of serverless

More Related Content

Journey to the cloud, the why and how of serverless