Debunking
Serverless Myths
Yan Cui @theburningmonk
Yan Cui
http://theburningmonk.com
@theburningmonk
AWS user for 10 years
http://bit.ly/yubl-serverless
Yan Cui
http://theburningmonk.com
@theburningmonk
Developer Advocate @
Yan Cui
http://theburningmonk.com
@theburningmonk
Independent Consultant
What do you mean
by ‘serverless’?
“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
(and scales faster!)
Cheaper
(don’t pay for idle servers)
Resilience
(built-in redundancy and multi-AZ)
Secure
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
What about containers?
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)
serverless technologies are still maturing
DEBUNKING SERVERLESS MYTHS
DEBUNKING SERVERLESS MYTHS
COLD STARTS
COLD STARTS
overplays or underplays
the role of cold starts on
serverless performance
MYTH #1
DEBUNKING SERVERLESS MYTHS
COLD STARTS
COLD STARTS
overplays or underplays
the role of cold starts on
serverless performance
MYTH #1
COSTSCOSTS
misunderstands thereal cost savings fromadopting serverless
MYTH #2
DEBUNKING SERVERLESS MYTHS
COLD STARTS
COLD STARTS
overplays or underplays
the role of cold starts on
serverless performance
MYTH #1
COSTSCOSTS
misunderstands thereal cost savings fromadopting serverless
MYTH #2
CONTROL
not realise that control of
infra requires expensive
skillsets to manage
MYTH #3
CONTROL
DEBUNKING SERVERLESS MYTHS
COLD STARTS
COLD STARTS
overplays or underplays
the role of cold starts on
serverless performance
MYTH #1
COSTSCOSTS
misunderstands thereal cost savings fromadopting serverless
MYTH #2
CONTROL
not realise that control of
infra requires expensive
skillsets to manage
MYTH #3
CONTROL
LOCK-INnot realise that lock-in
risk rewards productivity,
and true lock-in is dataMYTH #4
LOCK-IN
COLD STARTSCOLD STARTS
overplays or underplays
the role of cold starts on
serverless performance
MYTH #1
LOCK-IN
not realise that lock-in
risk rewards productivity,
and true lock-in is data
MYTH #4
LOCK-INCONTROL
not realise that control of
infra requires expensive
skillsets to manage
MYTH #3
CONTROLCOSTSCOSTS
misunderstands the
real cost savings from
adopting serverless
MYTH #2
INITIALISE
CONTAINER
INITIALISE
RUNTIME
INITIALISE
HANDLER
YOUR CODE
EXECUTES
INITIALISE
CONTAINER
INITIALISE
RUNTIME
INITIALISE
HANDLER
YOUR CODE
EXECUTES
COLD START
“cold starts only happen to the first request”
function invocationconcurrent execution
i.e. a container
function invocationconcurrent execution
i.e. a container
class instance method call
Lambda scales the number of concurrent
executions based on traffic
existing “containers” are reused where possible
time
invocation
time
invocation
invocation
time
invocation
invocation
time
invocation
invocation
invocation
invocation
time
invocation
invocation
invocation
invocation
invocation
invocation
time
invocation
invocation
invocation
invocation
invocation
invocation
time
invocation
invocation
invocation
invocation
invocation
invocation
invocation
time
invocation
invocation
invocation
invocation
invocation
invocation
invocation invocation
time
invocation
invocation
invocation
invocation
invocation
invocation
invocation invocation
time
invocation
invocation
invocation
invocation
invocation
invocation
invocation invocation
FREQUENCY DURATION
FREQUENCY DURATION
dictated by user traffic,
out of your control
FREQUENCY DURATION
optimize this!
“Lambda is not a suitable solution for me
because of cold starts”
“what is your latency requirement?”
cold starts that don’t add to user-facing
latency is generally not worth worrying about
Node.js functions, no VPC, 1GB, averages
~500ms cold start with production workload
Node.js functions, no VPC, 1GB, averages
~500ms cold start with production workload
(good enough for most web applications)
sporadic spikes latency existed before Lambda
GC pauses…
overloaded servers…
slow downstream, databases, etc.
networking issues…
cold starts is generally not an issue if you have
a steady traffic pattern
time
req/s
time
req/s
El Classico
time
req/s
lunch dinner
minimise the duration of cold starts so
they fall within acceptable latency range
use higher memory setting if function
performs CPU intensive work
use Node.js, Python or Golang
trim dependencies
keep functions single-purposed
avoid VPCs (for now) unless you need
to access VPC-protected resources
COSTSCOSTS
misunderstands the
real cost savings from
adopting serverless
MYTH #2
LOCK-IN
not realise that lock-in
risk rewards productivity,
and true lock-in is data
MYTH #4
LOCK-INCONTROL
not realise that control of
infra requires expensive
skillsets to manage
MYTH #3
CONTROL
“good luck when Amazon decides to
raise the price of Lambda!”
mind the market force…
AWS announced 67 price reductions in the
last 5 years, and 0 price hikes
Model Training
Low-latency Prediction
Serving via Batching
https://einaregilsson.com/serverless-15-percent-slower-and-eight-times-more-expensive/
the platforms need to do better at educating users
on how to choose between different services
https://aws.amazon.com/solutions/case-studies/financial-engines/
https://www.doc.ic.ac.uk/~rbc/papers/fse-serverless-17.pdf
“This paper presents two
case industrial studies of
early adopters, showing
how migrating an
application to the
Lambda deployment
architecture reduced
hosting costs – by
between 66% and 95%…”
what we can easily measure
what most of your
budget is spent on
what businesses
care about
what we can easily measure
what most of your
budget is spent on
leverage: do more with less
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
request
blue-green deployment
req/s
auto-scaling
us-east-1a
us-east-1b
us-east-1c
multi-AZ
Serverless might cost you just as much, or
even more, but you get so much more done
6 developers, 6 months
95% saving against EC2
15x no. of production releases per month
CONTROL
not realise that control of
infra requires expensive
skillsets to manage
MYTH #3
CONTROL
LOCK-IN
not realise that lock-in
risk rewards productivity,
and true lock-in is data
MYTH #4
LOCK-IN
Control
Responsibility
Controlling your own infrastructure
comes with Responsibilities
to take on these responsibilities you
need to have the relevant skillsets in the
organization
Controlling your own infrastructure
comes with Responsibilities
to take on these responsibilities you
need to have the relevant skillsets in the
organization
Controlling your own infrastructure
comes with Responsibilities
ENGINEERS
to take on these responsibilities you
need to have the relevant skillsets in the
organization
Controlling your own infrastructure
comes with Responsibilities
ENGINEERS ADMIN
to take on these responsibilities you
need to have the relevant skillsets in the
organization
Controlling your own infrastructure
comes with Responsibilities
ENGINEERS ADMIN RECRUITMENT
to take on these responsibilities you
need to have the relevant skillsets in the
organization
Controlling your own infrastructure
comes with Responsibilities
ENGINEERS ADMIN RECRUITMENT MARKET
what are you paying for?
guard against the temptation to
look for control for control sake
AWS Lambda, Azure Functions, Google
Cloud Functions
Your custom, container-based, general
purpose compute platform
LOCK-IN
not realise that lock-in
risk rewards productivity,
and true lock-in is data
MYTH #4
LOCK-IN
Lock-in risk
Reward
it’s not a lock-in, it’s a form of coupling
that has a switching cost
“vendor lock-in”
switching cost
“vendor lock-in”
switching cost
“let’s avoid lock-in”
prevention cost
The true danger with lock-in, especially with serverless, is the potential
for data lock-in. Data has gravity. It accumulates. Data is economically
disincentivized to leave, by way of platform pricing. This is the single
biggest threat to vendor choice.
Newton’s 41st law: data has gravity
Newton’s 42nd law: data migration is gonna suck
https://martinfowler.com/articles/oss-lockin.html
“VENDOR LOCK-IN IS THE ROOT OF ALL EVIL”
to take on these responsibilities you
need to have the relevant skills sets in
the organization
Controlling your own infrastructure
comes with Responsibilities
ENGINEERS ADMIN RECRUITMENT MARKET
if you already have the expertise, can
their time be better used to generate
more business value instead?
risk is just one side of the coin
extracting maximum value from your cloud provider
minimising undifferentiated heavy-lifting
faster time-to-market
reward
own less technology,
focus on creating Business Values
is vendor lock-in a risk?
YES
is the return worth the risk?
ABSOLUTELY!
there are no silver bullets
understand the trade-offs
control comes with its own baggages
but sometimes the benefits
outweigh the baggages
https://theburningmonk.com/hire-me
AdviseTraining Delivery
“Fundamentally, Yan has improved our team by increasing our
ability to derive value from AWS and Lambda in particular.”
Nick Blair
Tech Lead
@theburningmonk
theburningmonk.com
github.com/theburningmonk

Debunking serverless myths