SlideShare a Scribd company logo
1 of 47
Lessons Learned After a Year of AWS Lambda
● AWS Lambda Overview
● Performance characteristics
● Lambda Integration
● Debugging AWS Lambda
Agenda:
AWS Lambda Overview
AWS Lambda
● Created in 2014, launched at
re:Invent
● Kicked off "serverless" (caveat)
● Function-as-a-Service
○Deploy code, not applications
AWS Lambda Details
● Supports Node.JS, Python, C#, and
Java
● Can call to server functionality
● Code deployment options
○ Uploading as a ZIP file (S3 or HTTP)
○ In-browser editor
Calling AWS Lambda Functions
● Event-based triggers
○ On-Demand via HTTP
● Event Sources
○ AWS Services (S3, DynamoDB, others)
○ API Gateway
○ AWS SDK
Creating a Lambda Function
(in pictures)
Demo
Demo
Demo
Demo
Demo
Demo
Performance Characteristics
● Scraped logs of 2.6 million function
calls
● Pulled from CloudWatch on AWS
○ Function execution only
● Data on computing resources
consumed only
Examining Lambda Performance
● Graphs built on a sample of full data set
(26,000 vs 2.6 million)
○ Sample is not random
● No relation to size of Lambda function
● Confounding factors may be present
● Significant outliers
First, Caveats
Memory vs Execution Time
Memory vs Execution Time
● Does not incorporate HTTP Request
● Not a very strong correlation (r=-0.03)
● Three distinct groupings
● Tip: More memory allocated = faster
processor
Runtime Histogram
Runtime Histogram
● Many functions run in < 100 ms
● Ignores code characteristics
● Ignores significant outliers on both ends
● Bimodal due to function characteristics
Improving the Analysis
● Capture full cycle times if possible
● Correlate runtimes with size of function
● Algorithmic complexity analysis
● Randomize sample selection
Lambda Integration
Four problems to solve:
● Problem 1 - Lambda Ownership
● Problem 2 - Deduplication
● Problem 3 - Triggering Lambda Functions
● Problem 4 - User Security
Lambda Integration
Problem 1 - Lambda Ownership
Option 1: User ownership
● Users host Lambda functions in their AWS
account
● Backand uses provided credentials to call
Lambda
● Maximizes freedom at the expense of ease of
use (also, security)
Problem 1 - Lambda Ownership
Option 2: Backand ownership
● Backand hosts Lambda functions in internal
AWS account
● No need for user's AWS credentials
● Maximizes ease of use at expense of user
freedom
Solution selected: Backand owns code
● Lambda function names need to be unique
● Name length limits:
○ 140 characters for full ARN
○ 64 character subset for function name
Solution Selected: prepend guaranteed unique data
● Backand app names have a uniqueness constraint
● Could also use GUID, but this reduces name length
to 32 characters
Problem 2 - Deduplication
● Most triggers AWS-based
○ S3, DynamoDB, Cloudwatch
○ None work for our use case
● API Gateway
○ Positive: Allows HTTP trigger
○ Negative: Complex configuration
○ Negative: Return value requirements
Solution selected: AWS SDK
Problem 3 - Triggering Lambda
● Default: configure IAM profile and users
○ Need to give every dev access to AWS
○ Does not integrate with org security
○ Needs to be managed in multiple places
● Clients want flexibility and security
○ Need Single Sign-On
○ Need custom third-party security tools
○ Need ease of management
Solution selected: Lambda Launcher
Problem 4 - User Security
Debugging AWS Lambda
Debugging Lambda Functions
● Cloudwatch Integration
○ Provides call record, and console.log()
● Custom parameter input
○ Modal dialog presented before each run
● … and that's it
Emulating Lambda Locally
Three things to mimic:
● Trigger Event
● Machine Environment
● Invocation
Emulating trigger event
● Each trigger sends different data
● Dump data from a sample call
(console.log())
● Keep in mind any transformations (API
Gateway)
Lambda Machine Environment
● Based on Amazon Machine Instance
● Dynamically provisioned (hot vs cold)
● Temporary storage (/tmp, 500 MB)
○ NOT guaranteed to persist
● Cannot accurately model machine
Invoking Lambda
● External Function Call (entry point)
● Custom parameters in "event" object
● Execution context details in "context"
● Callbacks (if supported) in "callback"
Debugging Lambda Locally
● Execution environment hard to
emulate
● Need to mimic input format from
action
● Need to mimic output format
● Need a test harness
Creating a Test Harness (Node.js)
● Function Prototype
● Including Handler
● Mimicking Lambda Invocation
○ Parameters in event object
○ Handlers in the context object
Creating a Test Harness
● Calling a Lambda function
Test Harness Notes
● Callback mechanism
○ Need to adapt for each language
● Using callbacks in context parameter
○ Not supported, overloads context object
● Not a perfect substitute
○ Calls the function, but not from the same
environment
What do we get?
● Per-line output via console.log
● Immediate feedback from command
● Breakpoints and other local debugging
tools
● Unit and Integration tests
● CI/CD compatible (with CLI)
Deploying Your Code
● Zip-file from S3, or manual upload
○ Gotcha: zip only the source
code, not the parent folder!
● Test upload
● Publish new API
● Complex, non-intuitive
Using Backand's CLI Tool
● Backand On-Demand Node.JS
Lambda Functions
● Backand CLI abstracts away
deployment
● npm install -g backand
● Requires registering with Backand
Lambda through a CLI
● Initialize a function
○ backand function init
● Copy your Node.JS code into created
directory and iterate
● Deploy
○ backand function deploy
Calling Your Lambda
● Authentication
○ can be anonymous
○ api.backand.com/1/token
● cURL
curl -H "<auth header>" "https://api.backand.com/1/function/general/<name>"
● JavaScript (with Backand SDK)
backand.function.get(...)
What is Backand?
● Serverless app platform
● Manages your app's database
● Manages your app's security and
authentication
● Provides custom server-side code execution
● Provides hosting options
● Provides logging, analytics, and more
Backand Features
● Automated REST API
● Bring your own Database
● Custom JavaScript Actions
● Server-Side Code Execution
● Batch and Bulk Processing
● Scheduled Tasks
● Automated messages
● Real-time Communications
● User and Role-based
Security
● Social Media Authentication
● GUI Schema Editor
● Custom Queries
● REST API Playground
● Sample Code Generation
● Hosting
● Detailed Analytics
● Logging
● Multi-Platform SDK
● Single Sign On Support
● Live online demo every other Wednesday
● Webinar - Invoking Lambda through Alexa
Thursday, June 22nd, 11 AM Pacific
Learn more at https://www.backand.com
Want to know more?
THANK YOU
https://github.com/backand
matt@backand.com
@matt_billock
`

More Related Content

What's hot

Aws Lambda in Swift - NSLondon - 3rd December 2020
Aws Lambda in Swift - NSLondon - 3rd December 2020Aws Lambda in Swift - NSLondon - 3rd December 2020
Aws Lambda in Swift - NSLondon - 3rd December 2020Andrea Scuderi
 
Testing Spark and Scala
Testing Spark and ScalaTesting Spark and Scala
Testing Spark and Scaladatamantra
 
AWS Step Function with API Gateway Integration - Metin Kale, Chicago
AWS Step Function with API Gateway Integration - Metin Kale, ChicagoAWS Step Function with API Gateway Integration - Metin Kale, Chicago
AWS Step Function with API Gateway Integration - Metin Kale, ChicagoAWS Chicago
 
Fast Deployments to Multiple Golang Lambda Functions
Fast Deployments to Multiple Golang Lambda FunctionsFast Deployments to Multiple Golang Lambda Functions
Fast Deployments to Multiple Golang Lambda FunctionsKp Krishnamoorthy
 
Logging in Scala
Logging in ScalaLogging in Scala
Logging in ScalaJohn Nestor
 
Understanding Implicits in Scala
Understanding Implicits in ScalaUnderstanding Implicits in Scala
Understanding Implicits in Scaladatamantra
 
2020.02.15 DelEx - CI/CD in AWS Cloud
2020.02.15 DelEx - CI/CD in AWS Cloud2020.02.15 DelEx - CI/CD in AWS Cloud
2020.02.15 DelEx - CI/CD in AWS CloudPeter Salnikov
 
Dynamic input tables lwc vs aura vs. visualforce
Dynamic input tables  lwc vs aura vs. visualforceDynamic input tables  lwc vs aura vs. visualforce
Dynamic input tables lwc vs aura vs. visualforceMike Tetlow
 
Reactive programming using rx java & akka actors - pdx-scala - june 2014
Reactive programming   using rx java & akka actors - pdx-scala - june 2014Reactive programming   using rx java & akka actors - pdx-scala - june 2014
Reactive programming using rx java & akka actors - pdx-scala - june 2014Thomas Lockney
 
Functional programming in Scala
Functional programming in ScalaFunctional programming in Scala
Functional programming in Scaladatamantra
 
Aws Developer Associate Overview
Aws Developer Associate OverviewAws Developer Associate Overview
Aws Developer Associate OverviewAbhi Jain
 
The Fn Project by Jesse Butler
 The Fn Project by Jesse Butler The Fn Project by Jesse Butler
The Fn Project by Jesse ButlerOracle Developers
 
Serverless Boston @ Oracle Meetup
Serverless Boston @ Oracle MeetupServerless Boston @ Oracle Meetup
Serverless Boston @ Oracle MeetupWayne Scarano
 
OSDC 2018 - Distributed monitoring
OSDC 2018 - Distributed monitoringOSDC 2018 - Distributed monitoring
OSDC 2018 - Distributed monitoringGianluca Arbezzano
 
Python Streaming Pipelines with Beam on Flink
Python Streaming Pipelines with Beam on FlinkPython Streaming Pipelines with Beam on Flink
Python Streaming Pipelines with Beam on FlinkAljoscha Krettek
 
Go lambda-presentation
Go lambda-presentationGo lambda-presentation
Go lambda-presentationSteven White
 
Productionalizing Spark ML
Productionalizing Spark MLProductionalizing Spark ML
Productionalizing Spark MLdatamantra
 
Flink Forward Berlin 2017: Dominik Bruhn - Deploying Flink Jobs as Docker Con...
Flink Forward Berlin 2017: Dominik Bruhn - Deploying Flink Jobs as Docker Con...Flink Forward Berlin 2017: Dominik Bruhn - Deploying Flink Jobs as Docker Con...
Flink Forward Berlin 2017: Dominik Bruhn - Deploying Flink Jobs as Docker Con...Flink Forward
 

What's hot (20)

Aws Lambda in Swift - NSLondon - 3rd December 2020
Aws Lambda in Swift - NSLondon - 3rd December 2020Aws Lambda in Swift - NSLondon - 3rd December 2020
Aws Lambda in Swift - NSLondon - 3rd December 2020
 
Turbo charging v8 engine
Turbo charging v8 engineTurbo charging v8 engine
Turbo charging v8 engine
 
Testing Spark and Scala
Testing Spark and ScalaTesting Spark and Scala
Testing Spark and Scala
 
AWS Step Function with API Gateway Integration - Metin Kale, Chicago
AWS Step Function with API Gateway Integration - Metin Kale, ChicagoAWS Step Function with API Gateway Integration - Metin Kale, Chicago
AWS Step Function with API Gateway Integration - Metin Kale, Chicago
 
Fast Deployments to Multiple Golang Lambda Functions
Fast Deployments to Multiple Golang Lambda FunctionsFast Deployments to Multiple Golang Lambda Functions
Fast Deployments to Multiple Golang Lambda Functions
 
Logging in Scala
Logging in ScalaLogging in Scala
Logging in Scala
 
Understanding Implicits in Scala
Understanding Implicits in ScalaUnderstanding Implicits in Scala
Understanding Implicits in Scala
 
2020.02.15 DelEx - CI/CD in AWS Cloud
2020.02.15 DelEx - CI/CD in AWS Cloud2020.02.15 DelEx - CI/CD in AWS Cloud
2020.02.15 DelEx - CI/CD in AWS Cloud
 
Dynamic input tables lwc vs aura vs. visualforce
Dynamic input tables  lwc vs aura vs. visualforceDynamic input tables  lwc vs aura vs. visualforce
Dynamic input tables lwc vs aura vs. visualforce
 
Reactive programming using rx java & akka actors - pdx-scala - june 2014
Reactive programming   using rx java & akka actors - pdx-scala - june 2014Reactive programming   using rx java & akka actors - pdx-scala - june 2014
Reactive programming using rx java & akka actors - pdx-scala - june 2014
 
Functional programming in Scala
Functional programming in ScalaFunctional programming in Scala
Functional programming in Scala
 
Aws Developer Associate Overview
Aws Developer Associate OverviewAws Developer Associate Overview
Aws Developer Associate Overview
 
The Fn Project by Jesse Butler
 The Fn Project by Jesse Butler The Fn Project by Jesse Butler
The Fn Project by Jesse Butler
 
Serverless Boston @ Oracle Meetup
Serverless Boston @ Oracle MeetupServerless Boston @ Oracle Meetup
Serverless Boston @ Oracle Meetup
 
OSDC 2018 - Distributed monitoring
OSDC 2018 - Distributed monitoringOSDC 2018 - Distributed monitoring
OSDC 2018 - Distributed monitoring
 
Serverless
ServerlessServerless
Serverless
 
Python Streaming Pipelines with Beam on Flink
Python Streaming Pipelines with Beam on FlinkPython Streaming Pipelines with Beam on Flink
Python Streaming Pipelines with Beam on Flink
 
Go lambda-presentation
Go lambda-presentationGo lambda-presentation
Go lambda-presentation
 
Productionalizing Spark ML
Productionalizing Spark MLProductionalizing Spark ML
Productionalizing Spark ML
 
Flink Forward Berlin 2017: Dominik Bruhn - Deploying Flink Jobs as Docker Con...
Flink Forward Berlin 2017: Dominik Bruhn - Deploying Flink Jobs as Docker Con...Flink Forward Berlin 2017: Dominik Bruhn - Deploying Flink Jobs as Docker Con...
Flink Forward Berlin 2017: Dominik Bruhn - Deploying Flink Jobs as Docker Con...
 

Similar to Lessons learned after a year of lambda - AWS Community Day SF 2017

AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...Luciano Mammino
 
Writing and deploying serverless python applications
Writing and deploying serverless python applicationsWriting and deploying serverless python applications
Writing and deploying serverless python applicationsCesar Cardenas Desales
 
State of serverless
State of serverlessState of serverless
State of serverlessAnurag Saran
 
PyConIT 2018 Writing and deploying serverless python applications
PyConIT 2018 Writing and deploying serverless python applicationsPyConIT 2018 Writing and deploying serverless python applications
PyConIT 2018 Writing and deploying serverless python applicationsCesar Cardenas Desales
 
PyConIE 2017 Writing and deploying serverless python applications
PyConIE 2017 Writing and deploying serverless python applicationsPyConIE 2017 Writing and deploying serverless python applications
PyConIE 2017 Writing and deploying serverless python applicationsCesar Cardenas Desales
 
Lambda and serverless - DevOps North East Jan 2017
Lambda and serverless - DevOps North East Jan 2017Lambda and serverless - DevOps North East Jan 2017
Lambda and serverless - DevOps North East Jan 2017Mike Shutlar
 
Amazon Web Services lection 5
Amazon Web Services lection 5  Amazon Web Services lection 5
Amazon Web Services lection 5 Binary Studio
 
AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...
AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...
AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...Amazon Web Services
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudAmazon Web Services
 
AWS Lambda and the Serverless Cloud
AWS Lambda and the Serverless CloudAWS Lambda and the Serverless Cloud
AWS Lambda and the Serverless CloudAmazon Web Services
 
Serverless Computing with AWS
Serverless Computing with AWSServerless Computing with AWS
Serverless Computing with AWSTransferWiseSG
 
NEW LAUNCH! Developing Serverless C# Applications
NEW LAUNCH! Developing Serverless C# ApplicationsNEW LAUNCH! Developing Serverless C# Applications
NEW LAUNCH! Developing Serverless C# ApplicationsAmazon Web Services
 
Skillenza Build with Serverless Challenge - Advanced Serverless Concepts
Skillenza Build with Serverless Challenge -  Advanced Serverless ConceptsSkillenza Build with Serverless Challenge -  Advanced Serverless Concepts
Skillenza Build with Serverless Challenge - Advanced Serverless ConceptsDhaval Nagar
 
Laskar: High-Velocity GraphQL & Lambda-based Software Development Model
Laskar: High-Velocity GraphQL & Lambda-based Software Development ModelLaskar: High-Velocity GraphQL & Lambda-based Software Development Model
Laskar: High-Velocity GraphQL & Lambda-based Software Development ModelGarindra Prahandono
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudAmazon Web Services
 
aws lambda & api gateway
aws lambda & api gatewayaws lambda & api gateway
aws lambda & api gatewayfumihiko hata
 

Similar to Lessons learned after a year of lambda - AWS Community Day SF 2017 (20)

AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...
 
Writing and deploying serverless python applications
Writing and deploying serverless python applicationsWriting and deploying serverless python applications
Writing and deploying serverless python applications
 
State of serverless
State of serverlessState of serverless
State of serverless
 
PyConIT 2018 Writing and deploying serverless python applications
PyConIT 2018 Writing and deploying serverless python applicationsPyConIT 2018 Writing and deploying serverless python applications
PyConIT 2018 Writing and deploying serverless python applications
 
PyConIE 2017 Writing and deploying serverless python applications
PyConIE 2017 Writing and deploying serverless python applicationsPyConIE 2017 Writing and deploying serverless python applications
PyConIE 2017 Writing and deploying serverless python applications
 
Lambda and serverless - DevOps North East Jan 2017
Lambda and serverless - DevOps North East Jan 2017Lambda and serverless - DevOps North East Jan 2017
Lambda and serverless - DevOps North East Jan 2017
 
Running R on AWS Lambda by Ana-Maria Niculescu
Running R on AWS Lambda by Ana-Maria NiculescuRunning R on AWS Lambda by Ana-Maria Niculescu
Running R on AWS Lambda by Ana-Maria Niculescu
 
AWS Lambda Features and Uses
AWS Lambda Features and UsesAWS Lambda Features and Uses
AWS Lambda Features and Uses
 
Amazon Web Services lection 5
Amazon Web Services lection 5  Amazon Web Services lection 5
Amazon Web Services lection 5
 
AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...
AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...
AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
AWS Lambda in C#
AWS Lambda in C#AWS Lambda in C#
AWS Lambda in C#
 
AWS Lambda and the Serverless Cloud
AWS Lambda and the Serverless CloudAWS Lambda and the Serverless Cloud
AWS Lambda and the Serverless Cloud
 
Serverless Computing with AWS
Serverless Computing with AWSServerless Computing with AWS
Serverless Computing with AWS
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
NEW LAUNCH! Developing Serverless C# Applications
NEW LAUNCH! Developing Serverless C# ApplicationsNEW LAUNCH! Developing Serverless C# Applications
NEW LAUNCH! Developing Serverless C# Applications
 
Skillenza Build with Serverless Challenge - Advanced Serverless Concepts
Skillenza Build with Serverless Challenge -  Advanced Serverless ConceptsSkillenza Build with Serverless Challenge -  Advanced Serverless Concepts
Skillenza Build with Serverless Challenge - Advanced Serverless Concepts
 
Laskar: High-Velocity GraphQL & Lambda-based Software Development Model
Laskar: High-Velocity GraphQL & Lambda-based Software Development ModelLaskar: High-Velocity GraphQL & Lambda-based Software Development Model
Laskar: High-Velocity GraphQL & Lambda-based Software Development Model
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
aws lambda & api gateway
aws lambda & api gatewayaws lambda & api gateway
aws lambda & api gateway
 

Recently uploaded

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Lessons learned after a year of lambda - AWS Community Day SF 2017

  • 1. Lessons Learned After a Year of AWS Lambda
  • 2. ● AWS Lambda Overview ● Performance characteristics ● Lambda Integration ● Debugging AWS Lambda Agenda:
  • 4. AWS Lambda ● Created in 2014, launched at re:Invent ● Kicked off "serverless" (caveat) ● Function-as-a-Service ○Deploy code, not applications
  • 5. AWS Lambda Details ● Supports Node.JS, Python, C#, and Java ● Can call to server functionality ● Code deployment options ○ Uploading as a ZIP file (S3 or HTTP) ○ In-browser editor
  • 6. Calling AWS Lambda Functions ● Event-based triggers ○ On-Demand via HTTP ● Event Sources ○ AWS Services (S3, DynamoDB, others) ○ API Gateway ○ AWS SDK
  • 7. Creating a Lambda Function (in pictures)
  • 10. Demo
  • 11. Demo
  • 12. Demo
  • 13. Demo
  • 15. ● Scraped logs of 2.6 million function calls ● Pulled from CloudWatch on AWS ○ Function execution only ● Data on computing resources consumed only Examining Lambda Performance
  • 16. ● Graphs built on a sample of full data set (26,000 vs 2.6 million) ○ Sample is not random ● No relation to size of Lambda function ● Confounding factors may be present ● Significant outliers First, Caveats
  • 18. Memory vs Execution Time ● Does not incorporate HTTP Request ● Not a very strong correlation (r=-0.03) ● Three distinct groupings ● Tip: More memory allocated = faster processor
  • 20. Runtime Histogram ● Many functions run in < 100 ms ● Ignores code characteristics ● Ignores significant outliers on both ends ● Bimodal due to function characteristics
  • 21. Improving the Analysis ● Capture full cycle times if possible ● Correlate runtimes with size of function ● Algorithmic complexity analysis ● Randomize sample selection
  • 23. Four problems to solve: ● Problem 1 - Lambda Ownership ● Problem 2 - Deduplication ● Problem 3 - Triggering Lambda Functions ● Problem 4 - User Security Lambda Integration
  • 24. Problem 1 - Lambda Ownership Option 1: User ownership ● Users host Lambda functions in their AWS account ● Backand uses provided credentials to call Lambda ● Maximizes freedom at the expense of ease of use (also, security)
  • 25. Problem 1 - Lambda Ownership Option 2: Backand ownership ● Backand hosts Lambda functions in internal AWS account ● No need for user's AWS credentials ● Maximizes ease of use at expense of user freedom Solution selected: Backand owns code
  • 26. ● Lambda function names need to be unique ● Name length limits: ○ 140 characters for full ARN ○ 64 character subset for function name Solution Selected: prepend guaranteed unique data ● Backand app names have a uniqueness constraint ● Could also use GUID, but this reduces name length to 32 characters Problem 2 - Deduplication
  • 27. ● Most triggers AWS-based ○ S3, DynamoDB, Cloudwatch ○ None work for our use case ● API Gateway ○ Positive: Allows HTTP trigger ○ Negative: Complex configuration ○ Negative: Return value requirements Solution selected: AWS SDK Problem 3 - Triggering Lambda
  • 28. ● Default: configure IAM profile and users ○ Need to give every dev access to AWS ○ Does not integrate with org security ○ Needs to be managed in multiple places ● Clients want flexibility and security ○ Need Single Sign-On ○ Need custom third-party security tools ○ Need ease of management Solution selected: Lambda Launcher Problem 4 - User Security
  • 30. Debugging Lambda Functions ● Cloudwatch Integration ○ Provides call record, and console.log() ● Custom parameter input ○ Modal dialog presented before each run ● … and that's it
  • 31. Emulating Lambda Locally Three things to mimic: ● Trigger Event ● Machine Environment ● Invocation
  • 32. Emulating trigger event ● Each trigger sends different data ● Dump data from a sample call (console.log()) ● Keep in mind any transformations (API Gateway)
  • 33. Lambda Machine Environment ● Based on Amazon Machine Instance ● Dynamically provisioned (hot vs cold) ● Temporary storage (/tmp, 500 MB) ○ NOT guaranteed to persist ● Cannot accurately model machine
  • 34. Invoking Lambda ● External Function Call (entry point) ● Custom parameters in "event" object ● Execution context details in "context" ● Callbacks (if supported) in "callback"
  • 35. Debugging Lambda Locally ● Execution environment hard to emulate ● Need to mimic input format from action ● Need to mimic output format ● Need a test harness
  • 36. Creating a Test Harness (Node.js) ● Function Prototype ● Including Handler ● Mimicking Lambda Invocation ○ Parameters in event object ○ Handlers in the context object
  • 37. Creating a Test Harness ● Calling a Lambda function
  • 38. Test Harness Notes ● Callback mechanism ○ Need to adapt for each language ● Using callbacks in context parameter ○ Not supported, overloads context object ● Not a perfect substitute ○ Calls the function, but not from the same environment
  • 39. What do we get? ● Per-line output via console.log ● Immediate feedback from command ● Breakpoints and other local debugging tools ● Unit and Integration tests ● CI/CD compatible (with CLI)
  • 40. Deploying Your Code ● Zip-file from S3, or manual upload ○ Gotcha: zip only the source code, not the parent folder! ● Test upload ● Publish new API ● Complex, non-intuitive
  • 41. Using Backand's CLI Tool ● Backand On-Demand Node.JS Lambda Functions ● Backand CLI abstracts away deployment ● npm install -g backand ● Requires registering with Backand
  • 42. Lambda through a CLI ● Initialize a function ○ backand function init ● Copy your Node.JS code into created directory and iterate ● Deploy ○ backand function deploy
  • 43. Calling Your Lambda ● Authentication ○ can be anonymous ○ api.backand.com/1/token ● cURL curl -H "<auth header>" "https://api.backand.com/1/function/general/<name>" ● JavaScript (with Backand SDK) backand.function.get(...)
  • 44. What is Backand? ● Serverless app platform ● Manages your app's database ● Manages your app's security and authentication ● Provides custom server-side code execution ● Provides hosting options ● Provides logging, analytics, and more
  • 45. Backand Features ● Automated REST API ● Bring your own Database ● Custom JavaScript Actions ● Server-Side Code Execution ● Batch and Bulk Processing ● Scheduled Tasks ● Automated messages ● Real-time Communications ● User and Role-based Security ● Social Media Authentication ● GUI Schema Editor ● Custom Queries ● REST API Playground ● Sample Code Generation ● Hosting ● Detailed Analytics ● Logging ● Multi-Platform SDK ● Single Sign On Support
  • 46. ● Live online demo every other Wednesday ● Webinar - Invoking Lambda through Alexa Thursday, June 22nd, 11 AM Pacific Learn more at https://www.backand.com Want to know more?