Yan Cui
http://theburningmonk.com
@theburningmonk
Developer Advocate @
Independent Consultant
AWS user since 2009
since 2018
yan@lumigo.io
Uri Parush
@uri82042753
System Architect @
uri@lumigo.io
“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
in other words, it’s a lot like taking a cab
Ownership
Fuel
Navigate
To get there!
Focus on
getting there!
API Gateway IOT Core SNS SQS S3
HW Ownership
OS
Runtime & Scale
Code
Focus on
business logic!
Physical
Servers
Virtual
Machines
Containers Serverless
auto-scaled by
demand
twitter.com/ben11kehoe/status/1187027628152115200
www.youtube.com/watch?v=C0pA5eZkmFk
aws.amazon.com/solutions/case-studies/bustle
scales to zero
scales to zero
don’t pay for idle
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
aws.amazon.com/solutions/case-studies/finra-data-validation
Shared Responsibility Model
Shared Responsibility Model
www.buzzsprout.com/877747/3133243
us-east-1a
us-east-1b
us-east-1c
multi-AZ by default
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
youtube.com/watch?v=evsz__BDprs
It used to take me
longer to configure
infrastructure for my
application!
AppSync
DynamoDB
Lambda
Scalable
Robust
Performant
Cost efficient
Agility
what used to takes teams of engineers to achieve over months
can now be done by individuals over a matter of weeks
Yan Cui
I’m not a great programmer; I just
build my app on services that great
programmers built.
pages.awscloud.com/Gated_IDC_Generating_Value_Through_IT_Agility.html
pages.awscloud.com/Gated_IDC_Generating_Value_Through_IT_Agility.html
Thinking about
serverless costs
the right way
Model Training
Low-latency Prediction
Serving via Batching
yes, some workloads will be more expensive to run on serverless
yes, some workloads will be more expensive to run on serverless
from the infrastructure cost perspective
what businesses
care about
what businesses
care about
what we can
easily measure
what businesses
care about
what we can
easily measure
what most of our
budget is spent on
AWS bill per month
serverless
containers
$500
$100
Staffing cost per month
$10000
$0
AWS bill per month
serverless
containers
$500
$100
Don’t be “penny-wise, pound foolish”
Always think of cost in terms of Total Cost of Ownership
Simon Wardley
https://blog.gardeviance.org/2016/11/why-fuss-about-serverless.html
Simon Wardley
https://blog.gardeviance.org/2016/11/why-fuss-about-serverless.html
the new business models around worth based development and
the collision of finance and development will literally knock your
socks off. Which is why the moniker "FinDev". Beyond the initial
investment in coding, I can create an almost variable cost business
model and redirect investment to maximise returns in ways that
most of you have never experienced. I know, I’ve been there.
Simon Wardley
https://blog.gardeviance.org/2016/11/why-fuss-about-serverless.html
and redirect investment to maximise returns
in ways that most of you have never experienced.
“what’s the ROI for a feature X?”
how much time does it take to build?
how many engineer does it take to build?
how much does it cost to run it?
$5/hr
$5/hr
1 TPS
1000 TPS
$0.00138888888 per transaction
$0.00000138888 per transaction
actual cost per transaction
depends on usage, which
is outside your control
TPS
Cost/Transaction
add server add server add server
add server
$5/hr
? TPS
runs multiple
services/features
how do you attribute the
cost for each feature?
understanding the operational cost for individual
features are very difficult
unless you know exactly how much each
transaction would cost you
AppSync
DynamoDB
API Gateway Lambda DynamoDB
$0.0000035 $0.0000004083 $0.00000125
cost per transaction: $0.0000051583
more CPU
more network
more CPU
more network
more expensive
Donald Knuth
We should forget about small efficiencies, say
about 97% of the time: premature optimization
is the root of all evil.
We should forget about small efficiencies, say
about 97% of the time: premature optimization
is the root of all evil.
Yet we should not pass up our opportunities in
that critical 3%.
Donald Knuth
input output
engineering time
lower operational cost to
run the feature
input output
engineering time
lower operational cost to
run the feature
this is pretty $$$
cost of the conversation:
~$50 per dev per hour x 8 = $400
potential saving:
$10/month
cost of the conversation:
~$50 per dev per hour x 8 = $400
potential saving:
$10/month
break-even time for conversation:
$400 ÷ $10/month = 40 months!!!
Donald Knuth
We should forget about small efficiencies, say
about 97% of the time: premature optimization
is the root of all evil.
Yet we should not pass up our opportunities in
that critical 3%.
optimization is as much an engineering decision
as it is a financial decision
choose wisely.
lumigo-cli powertune-lambda -r us-east-1 -n cpu-bound-example -s balanced
lumigo-cli powertune-lambda -r us-east-1 -n cpu-bound-example -s balanced
more CPU = shorter execution time
shorter execution time = cheaper
Node is single-threaded…
IO-bound functions don’t see drastic
improvements with more memory
In 2019, the tourism industry in the UK generated 9% of its GDP
and employed 2.6 million jobs
consumers have less
disposible income
B2C businesses have
less revenue
consumers have less
disposible income
B2C businesses have
less revenue
B2B businesses have
less revenue
consumers have less
disposible income
B2C businesses have
less revenue
B2B businesses have
less revenue
job losses/furloughed
consumers have less
disposible income
B2C businesses have
less revenue
B2B businesses have
less revenue
job losses/furloughed
Businesses have to become more efficient or die
“get more done with less”
pages.awscloud.com/Gated_IDC_Generating_Value_Through_IT_Agility.html
“be more competitive”
Simon Wardley
https://blog.gardeviance.org/2016/11/why-fuss-about-serverless.html
the new business models around worth based development
and the collision of finance and development will literally
knock your socks off. Which is why the moniker "FinDev".
Beyond the initial investment in coding, I can create an
almost variable cost business model…
API Gateway Lambda DynamoDB
$0.0000035 $0.0000004083 $0.00000125
cost per transaction: $0.0000051583
subscription-based services
£
subscription fee
percentile
£
subscription fee
percentile
what the customer
has cost you
£
subscription fee
percentile
80%
profit!
loss…
what the customer
has cost you
transactional/metered/pay-per-use
£
time
your premium
what you charge
your customer
what the customer
has cost you
A pure pay-per-use play is difficult to pull off
Not everything in your stack is pay-per-use
AppSync
DynamoDB
Factor fixed-cost components into your margin
Mix subscription with pay-per-use
time
your profit
what you charge
your customer
what the customer
has cost you
subscription fee
£
£
time
your profit
what you charge
your customer
what the customer
has cost you
subscription fee
competitor’s
subscription fee
Enterprises want predictable pricing
Offer enterprise pricing options
what businesses
care about
what we can
easily measure
what most of our
budget is spent on
Always think of cost in terms of Total Cost of Ownership
pages.awscloud.com/Gated_IDC_Generating_Value_Through_IT_Agility.html
more CPU
more network
optimization is as much an engineering decision
as it is a financial decision
We should forget about small efficiencies, say
about 97% of the time: premature optimization
is the root of all evil.
Yet we should not pass up our opportunities in
that critical 3%.
Donald Knuth
£
time
your premium
what you charge
your customer
what the customer
has cost you

How serverless changes the cost paradigm