SlideShare a Scribd company logo
Debunking
Serverless Myths
Yan Cui @theburningmonk
Yan Cui
http://theburningmonk.com
@theburningmonk
Principal Engineer @
Independent Consultant
Debunking serverless myths
Debunking serverless myths
available in Austria, Switzerland, Germany,
Japan, Canada, Italy and US
on 30+ platforms
~1,000,000 concurrent viewers
follow @dazneng for
updates about the
engineering team
We’re hiring! Visit
engineering.dazn.com
to learn more.
WE’RE HIRING!
AWS user since 2009
AWS user since 2009
https://productionreadyserverless.com
What do you mean
by ‘serverless’?
“Serverless”
Debunking serverless myths
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
Debunking serverless myths
What about containers?
Debunking serverless myths
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
Debunking serverless myths
Debunking serverless myths
Debunking serverless myths
Debunking serverless myths
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 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!”
AWS announced 67 price reductions in the
last 5 years, and 0 price hikes
Debunking serverless myths
Model Training
Low-latency Prediction
Serving via Batching
Debunking serverless myths
developer
but I build CRUD web APIs, why should I
care if Lambda is a bad fit for machine
learning and serving realtime predictions?
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%…”
if you wear your shoes on your hands,
should you really be surprised your feet is cold?
(hint: it’s not because the shoes are not warm!)
Debunking serverless myths
Debunking serverless myths
Debunking serverless myths
Debunking serverless myths
Debunking serverless myths
Debunking serverless myths
recruitment is one of the most important things
you can do as an employee
it’s also a significant investment
https://bit.ly/2FTXk4q
Debunking serverless myths
Debunking serverless myths
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
Debunking serverless myths
6 developers, 6 months
95% saving against EC2
15x no. of production releases per month
Debunking serverless myths
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
Debunking serverless myths
Debunking serverless myths
Debunking serverless myths
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
Debunking serverless myths
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
Debunking serverless myths
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
Debunking serverless myths
LOCK-IN
not realise that lock-in
risk rewards productivity,
and true lock-in is data
MYTH #4
LOCK-IN
Lock-in risk
Reward
“VENDOR LOCK-IN IS THE ROOT OF ALL EVIL”
use our private cloud instead,
it’s totally not a lock-in because containers!
Debunking serverless myths
Debunking serverless myths
Debunking serverless myths
open-source !== freedom
here’s a Ferrari,
have at it
but I don’t know
how to drive!
I’ll take a taxi
instead…
here’s a Ferrari,
have at it
but I don’t know
how to drive!
I’ll take a taxi
instead…
here’s a million
lines of open
source code,
have at it
but I don’t know
how to run it!
I’ll use a managed
service instead…
even open-source solutions require
expertise to operate, and expertise
are both rare and expensive
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
Debunking serverless myths
extracting maximum value from your cloud provider
minimising undifferentiated heavy-lifting
faster time-to-market
reward
vendor lock-in is a problem that is
all bark but no bite
Debunking serverless myths
own less technology,
focus on creating Business Values
Debunking serverless myths
“DATABASE LOCK-IN IS THE ROOT OF ALL EVIL”
ORM
a load of unnecessary
complexity that didn’t end up
making DB migrations any
easier, and forced you to the
least common denominator of
feature sets and stop you from
taking advantage of your DB in
the first place…
nooooooooooo, wish I hadn’t used an ORM!!
Debunking serverless myths
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.
is vendor lock-in a risk?
YES
is the return worth the risk?
ABSOLUTELY!
there are no silver bullets
Debunking serverless myths
understand the trade-offs
control comes with its own baggages
but sometimes the benefits
outweigh the baggages
Debunking serverless myths
Debunking serverless myths
Debunking serverless myths

More Related Content

Debunking serverless myths