SlideShare a Scribd company logo
in production
an experience report
an experience report
what you should know before you go to production
ServerlessServerless
http://theburningmonk.com
@theburningmonk
http://theburningmonk.com
@theburningmonk
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
apr, 2016
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
10PM
traffic
10PM
traffic
70-100x
low utilisation to leave room for spikes
EC2 scaling is slow, so scale earlier
lots of $$$ for unused resources
up to 30 mins for deployment
deployment required downtime
- Dan North
“lead time to someone saying
thank you is the only reputation
metric that matters.”
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
“what would good
look like for us?”
be small
be fast
have zero downtime
have no lock-step
DEPLOYMENTS SHOULD...
FEATURES SHOULD...
be deployable independently
be loosely-coupled
WE WANT TO...
minimise cost for unused resources
minimise ops effort
reduce tech mess
deliver visible improvements faster
nov, 2016
170 Lambda functions in prod
1.2 GB deployment packages in prod
95% cost saving vs EC2
15x no. of prod releases per month
time
is a good fit
1st function in prod!
time
is a good fit
?
time
is a good fit
1st function in prod!
ALERTING
CI / CD
TESTING
LOGGING
MONITORING
Practices ToolsPrinciples
what is good? how to make it good? with what?
Principles outlast Tools
170 functions
? ?
time
is a good fit
1st function in prod!
SECURITY
DISTRIBUTED TRACING
CONFIG MANAGEMENT
evolving the PLATFORM
rebuilt search
Legacy Monolith Amazon Kinesis Amazon Lambda
Amazon CloudSearch
Legacy Monolith Amazon Kinesis Amazon Lambda
Amazon CloudSearchAmazon API Gateway Amazon Lambda
new analytics pipeline
Legacy Monolith Amazon Kinesis Amazon Lambda
Google BigQuery
Legacy Monolith Amazon Kinesis Amazon Lambda
Google BigQuery
1 developer, 2 days
design production
(his 1st serverless project)
Legacy Monolith Amazon Kinesis Amazon Lambda
Google BigQuery
“nothing ever got done
this fast at Skype!”
- Chris Twamley
- Dan North
“lead time to someone saying
thank you is the only reputation
metric that matters.”
Rebuilt
with Lambda
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Rebuilt
with Lambda
BigQuery
BigQuery
grapheneDB
BigQuery
grapheneDB
BigQuery
grapheneDB
BigQuery
getting PRODUCTION READY
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
http://serverless.com
https://github.com/awslabs/serverless-application-model
http://apex.run
https://apex.github.io/up
https://github.com/claudiajs/claudia
https://github.com/Miserlou/Zappa
http://gosparta.io
TESTING
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
1.Unit
do our objects do the right thing?
are they easy to work with?
Level of Testing
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
1.Unit
2.Integration
does our code work against code we
can’t change?
Level of Testing
handler
handler
test by invoking
the handler
Level of Testing
1.Unit
2.Integration
3.Acceptance
does the whole system work?
unit
integration
acceptance
feedback
confidence
Level of Testing
“…We find that tests that mock external
libraries often need to be complex to get
the code into the right state for the
functionality we need to exercise.
The mess in such tests is telling us that
the design isn’t right but, instead of fixing
the problem by improving the code, we
have to carry the extra complexity in
both code and test…”
Don’t Mock Types You Can’t Change
“…The second risk is that we have to be
sure that the behaviour we stub or mock
matches what the external library will
actually do…
Even if we get it right once, we have to
make sure that the tests remain valid
when we upgrade the libraries…”
Don’t Mock Types You Can’t Change
Don’t Mock Types You Can’t Change
Services
Paul Johnston
http://bit.ly/2t5viwK
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Unit Tests
Unit Tests
Mock/Stub
what unit tests will not tell you…
is Lambda proxy
configured correctly?
is the API resources
configured correctly?
is IAM policy set
up correctly?
is the request mapping
set up correctly?
is the table created?
are we assuming the
correct schema?
is our request correct?
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
risk
integrate
external services
observation
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Paul Johnston
“…Wherever possible, an acceptance
test should exercise the system
end-to-end without directly calling its
internal code.
An end-to-end test interacts with the
system only from the outside: through
its interface…”
Testing End-to-End
Legacy Monolith Amazon Kinesis Amazon Lambda
Amazon CloudSearchAmazon API Gateway Amazon Lambda
Legacy Monolith Amazon Kinesis Amazon Lambda
Amazon CloudSearchAmazon API Gateway Amazon Lambda
Test Input
Legacy Monolith Amazon Kinesis Amazon Lambda
Amazon CloudSearchAmazon API Gateway Amazon Lambda
Validate
Test Input
Integration
my code
End-to-End
my code
HOW
observation
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
CI + CD PIPELINE
Yan
“…We prefer to have the end-to-end tests
exercise both the system and the
process by which it’s built and
deployed…
This sounds like a lot of effort (it is), but
has to be done anyway repeatedly during
the software’s lifetime…”
Testing End-to-End
Yan
Jenkins build config deploys and
tests
unit + integration tests
deploy
acceptance tests
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
http://alistair.cockburn.us/Hexagonal+architecture
build.sh allows repeatable builds on both local & CI
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Auto Auto Manual
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
LOGGING
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
2016-07-12T12:24:37.571Z 994f18f9-482b-11e6-8668-53e4eab441ae
GOT is off air, what do I do now?
2016-07-12T12:24:37.571Z 994f18f9-482b-11e6-8668-53e4eab441ae
GOT is off air, what do I do now?
UTC Timestamp API Gateway Request Id
your log message
Yan
CloudWatch Logs
CloudWatch Logs AWS Lambda ELK stack
…
CloudWatch Events
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
DISTRIBUTED TRACING
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
a user
where could the
problem be?
correlation IDs*
* eg. request-id, user-id, yubl-id, etc.
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
kinesis client
http client
sns client
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
MONITORING + ALERTING
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
• invocation Count
• error Count
• latency
• throttling
• granular to the minute
• support custom metrics
• same metrics as CW
• better dashboard
• support custom
metrics
https://www.datadoghq.com/blog/monitoring-lambda-functions-datadog/
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
my code
my code
internet internet
press button something happens
my code
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
100ms
http://bit.ly/2EXPfbA
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
console.log(“hydrating yubls from db…”);
console.log(“fetching user info from user-api”);
console.log(“MONITORING|1489795335|27.4|latency|user-api-latency”);
console.log(“MONITORING|1489795335|8|count|yubls-served”);
metric
s
logs
timestamp metric value metric name
metric type
CloudWatch Logs AWS Lambda
ELK stack
logs
metrics
CloudWatch
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
CONFIG MANAGEMENT
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Environment variables make it
hard to share configurations
across functions.
me
me
Environment variables make it
hard to implement fine-grained
access to sensitive info.
config service
goes here
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
SSM
Parameter
Store
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
SSM Parameter Store
HTTPS
role-based access
encrypted in-flight
SSM Parameter Store
encrypt
role-based access
SSM Parameter Store
encrypted at-rest
HTTPS
SSM Parameter Store
encrypted in-flight
role-based access
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
Serverless in production, an experience report (Going Serverless, 28 Feb 2018)
That’s it, folks!
Thank you all :-D
API Gateway and Kinesis
Authentication & authorisation (IAM, Cognito)
Testing
Running & Debugging functions locally
Log aggregation
Monitoring & Alerting
X-Ray
Correlation IDs
CI/CD
Performance and Cost optimisation
Error Handling
Configuration management
VPC
Security
Leading practices (API Gateway, Kinesis, Lambda)
Canary deployments
http://bit.ly/production-ready-serverless
@theburningmonk
theburningmonk.com
github.com/theburningmonk

More Related Content

PDF
Serverless in production, an experience report (microservices london)
PDF
Build reactive systems on lambda
PDF
Serverless in production, an experience report (codemotion milan)
PDF
Serverless in production, an experience report (London js community)
PDF
Serverless in production, an experience report (BuildStuff)
PDF
Serverless in production, an experience report (CoDe-Conf)
PPTX
A. De Biase/C. Quatrini/M. Barsocchi - API Release Process: how to make peopl...
PDF
Security in serverless world
Serverless in production, an experience report (microservices london)
Build reactive systems on lambda
Serverless in production, an experience report (codemotion milan)
Serverless in production, an experience report (London js community)
Serverless in production, an experience report (BuildStuff)
Serverless in production, an experience report (CoDe-Conf)
A. De Biase/C. Quatrini/M. Barsocchi - API Release Process: how to make peopl...
Security in serverless world

What's hot (20)

PDF
Serverless in production, an experience report (NDC London 2018)
PDF
How Gear4Music Went from 0-1000+ API Tests
PDF
Serverless in production, an experience report (FullStack 2018)
PDF
Testing Microservices
PDF
Serverless in Production, an experience report (AWS UG South Wales)
PDF
Delivery pipelines at Symphony Talent - Present and Future
PPTX
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
PDF
How to build observability into a serverless application
PPTX
PDF
Continuous Testing
PDF
Using Go in DevOps
PDF
How to build a social network on serverless
PDF
PDF
Troubleshooting serverless applications
PDF
Continuous delivery of your legacy application
PDF
100% Puppet Cloud Deployment of Legacy Software
PPTX
Release the Monkeys ! Testing in the Wild at Netflix
PPTX
Agility Requires Safety
PDF
Game of Codes: the Battle for CI
ODP
Microservices Manchester: Testing Microservices: Pain or Opportunity? By Davi...
Serverless in production, an experience report (NDC London 2018)
How Gear4Music Went from 0-1000+ API Tests
Serverless in production, an experience report (FullStack 2018)
Testing Microservices
Serverless in Production, an experience report (AWS UG South Wales)
Delivery pipelines at Symphony Talent - Present and Future
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
How to build observability into a serverless application
Continuous Testing
Using Go in DevOps
How to build a social network on serverless
Troubleshooting serverless applications
Continuous delivery of your legacy application
100% Puppet Cloud Deployment of Legacy Software
Release the Monkeys ! Testing in the Wild at Netflix
Agility Requires Safety
Game of Codes: the Battle for CI
Microservices Manchester: Testing Microservices: Pain or Opportunity? By Davi...
Ad

Similar to Serverless in production, an experience report (Going Serverless, 28 Feb 2018) (20)

PDF
Yan Cui - Serverless in production, an experience report - Codemotion Milan 2017
PDF
AWS Lambda from the trenches (Serverless London)
PDF
Serverless in production, an experience report (NDC London, 31 Jan 2018)
PDF
Serverless in Production, an experience report (cloudXchange)
PDF
Serverless in production, an experience report (LNUG)
PDF
Serverless in production (O'Reilly Software Architecture)
PDF
Serverless in production, an experience report
PDF
AWS Lambda from the Trenches
PDF
AWS Lambda from the trenches
PDF
Serverless in production, an experience report (JeffConf)
PDF
The future of paas is serverless
PDF
Serverless in production, an experience report (linuxing in london)
PDF
Serverless in production, an experience report (IWOMM)
PDF
Serverless in production, an experience report (Going Serverless)
PDF
Serverless in production, an experience report (London DevOps)
PDF
APIdays Barcelona 2019 - How to build a social network on Serverless with Yan...
PDF
DevOps with Serverless
PDF
Continuous delivery @wcap 5-09-2013
PDF
How to build a social network on serverless
PPTX
Automating the Quality
Yan Cui - Serverless in production, an experience report - Codemotion Milan 2017
AWS Lambda from the trenches (Serverless London)
Serverless in production, an experience report (NDC London, 31 Jan 2018)
Serverless in Production, an experience report (cloudXchange)
Serverless in production, an experience report (LNUG)
Serverless in production (O'Reilly Software Architecture)
Serverless in production, an experience report
AWS Lambda from the Trenches
AWS Lambda from the trenches
Serverless in production, an experience report (JeffConf)
The future of paas is serverless
Serverless in production, an experience report (linuxing in london)
Serverless in production, an experience report (IWOMM)
Serverless in production, an experience report (Going Serverless)
Serverless in production, an experience report (London DevOps)
APIdays Barcelona 2019 - How to build a social network on Serverless with Yan...
DevOps with Serverless
Continuous delivery @wcap 5-09-2013
How to build a social network on serverless
Automating the Quality
Ad

Recently uploaded (20)

PDF
Nekopoi APK 2025 free lastest update
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Introduction to Artificial Intelligence
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
L1 - Introduction to python Backend.pptx
PDF
System and Network Administration Chapter 2
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
AI in Product Development-omnex systems
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Nekopoi APK 2025 free lastest update
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Introduction to Artificial Intelligence
How Creative Agencies Leverage Project Management Software.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
How to Migrate SBCGlobal Email to Yahoo Easily
Odoo Companies in India – Driving Business Transformation.pdf
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
How to Choose the Right IT Partner for Your Business in Malaysia
Understanding Forklifts - TECH EHS Solution
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Which alternative to Crystal Reports is best for small or large businesses.pdf
Softaken Excel to vCard Converter Software.pdf
L1 - Introduction to python Backend.pptx
System and Network Administration Chapter 2
VVF-Customer-Presentation2025-Ver1.9.pptx
AI in Product Development-omnex systems
PTS Company Brochure 2025 (1).pdf.......
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025

Serverless in production, an experience report (Going Serverless, 28 Feb 2018)