SlideShare a Scribd company logo
1 of 16
Download to read offline
Deploying Web Services
with 

AWS Lambda
Stefan Deusch
Software Delivery at vroozi.com
&
Owner of sunsprinkle.com
February 15, 2017
Agenda
• Lambda Essentials
• Creation of AWS Lambda code
• Limitations of AWS Lambda
• Demo
• Event Driven Architecture
• Questions & Answers
What is Lambda?
Fully Managed Computing Platform
• run code without owning or leasing servers in AWS
• event-driven, stateless, immutable
• pay for what you use
Completely Outsources Administration
• availability / fault tolerance
• elasticity
• server and OS maintenance
• monitoring, logging
Lambda Essentials
• You allocate:

- memory

- execution timeout
• Lambda allocates:

- CPU

- disk I/O

- network I/O
• Supported Languages

- Node.js

- Python (2.7)

- Java (8) 

- C#
Hello World
console.log('Loading function’);
exports.handler = (event, context, callback) => {
console.log('Received event:’, JSON.stringify(event));
console.log('name =', event.name);
var name = '';
if ('name' in event) {
name = event['name'];
} else {
name = 'World';
}
var greetings = 'Hello ' + name + '!';
console.log(greetings);
callback(null, greetings);
};
Deploying a AWS Lambda function from the CLI
> aws lambda create-function 
--function-name helloWorld 
--zip-file filed:///index.zip 
--handle index.handler 
--role arn:aws:iam::669172621759:role/lambda_write_dynamodb 
--runtime nodejs4.3 
--description ‘say hello’
Event Sources for Lambda
Event Model


- Push (event sources invokes Lambda, S3, SNS,
Cognito, Echo, etc.)


- Pull (Lambda polls event source) DynamoDB,
Kinesis)

- event source is mapped
Limitations of Lambda
• Throttle limits

- 100 concurrent function executions total
• Resource limits

- 1024 processes / threads 

- 1024 file descriptors 

- 512 MB ephemeral /tmp space

- maximum execution time: 300 sec

- request/response payload: 6 MB

- 1.5 GB RAM
• Functional limits

- cold start time 

- CPU allocation (proportional to memory allocation)
Security
• IAM (execution) role 

permissions you grant to this role determine what
AWS Lambda function can do
• Lambda (resource) policy 

Permission granted to Lambda determine which
service or event can invoke your function 

Demo AWS Lambda 

File Sharing App Flow
Event Driven Architecture
• event-driven means no centralized workflow
• application does not enforce sequence of events
• decoupling of server from receiver
• micro services architecture - distributed
transactions are hard (CAP)
• reactive programming - countless possibilities
AWS Lambda Pricing
• by memory and execution time



$0.00001667 per GB-second used



https://s3.amazonaws.com/lambda-tools/pricing-
calculator.html

• but also pay for S3, EC2, DynamoDB
Deployment Frameworks
• AWS CloudFormation (YML, JSON)
• Chalice (Python)
• serverless.com
• Apex.run
• Claudia.js
Thank You
Q & A
References
• AWS Lambda in Action, Danilo Poccia, Manning
• LinuxAcademy - Lambda Deep Dive

More Related Content

What's hot

Containerization - The DevOps Revolution
Containerization - The DevOps RevolutionContainerization - The DevOps Revolution
Containerization - The DevOps Revolution
Yulian Slobodyan
 

What's hot (20)

Docker Container automatisiert nach AWS deployen - Continuous Lifecycle 2016
Docker Container automatisiert nach AWS deployen  - Continuous Lifecycle 2016Docker Container automatisiert nach AWS deployen  - Continuous Lifecycle 2016
Docker Container automatisiert nach AWS deployen - Continuous Lifecycle 2016
 
Amazon Web Services (cloud: is it good for anything?)
Amazon Web Services (cloud: is it good for anything?)Amazon Web Services (cloud: is it good for anything?)
Amazon Web Services (cloud: is it good for anything?)
 
Future of Cloud Starts with Serverless
Future of Cloud Starts with ServerlessFuture of Cloud Starts with Serverless
Future of Cloud Starts with Serverless
 
AWS Quick Intro
AWS Quick IntroAWS Quick Intro
AWS Quick Intro
 
AWS EC2
AWS EC2AWS EC2
AWS EC2
 
Hosting Drupal on Amazon EC2
Hosting Drupal on Amazon EC2Hosting Drupal on Amazon EC2
Hosting Drupal on Amazon EC2
 
Containerization - The DevOps Revolution
Containerization - The DevOps RevolutionContainerization - The DevOps Revolution
Containerization - The DevOps Revolution
 
Amazon EC2 Container Service: Deep Dive
Amazon EC2 Container Service: Deep DiveAmazon EC2 Container Service: Deep Dive
Amazon EC2 Container Service: Deep Dive
 
Data Scotland 2019: You can run SQL Server on AWS
Data Scotland 2019: You can run SQL Server on AWSData Scotland 2019: You can run SQL Server on AWS
Data Scotland 2019: You can run SQL Server on AWS
 
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
 
Kubernetes on AWS gone wild
Kubernetes on AWS gone wildKubernetes on AWS gone wild
Kubernetes on AWS gone wild
 
Droplr Serverless Revolution - How we killed 50 servers in a year
Droplr Serverless Revolution - How we killed 50 servers in a yearDroplr Serverless Revolution - How we killed 50 servers in a year
Droplr Serverless Revolution - How we killed 50 servers in a year
 
Pillai Pradeep - Global Rendering Customer Cases :: AWS Rendering Seminar -
Pillai Pradeep - Global Rendering Customer Cases :: AWS Rendering Seminar - Pillai Pradeep - Global Rendering Customer Cases :: AWS Rendering Seminar -
Pillai Pradeep - Global Rendering Customer Cases :: AWS Rendering Seminar -
 
Micrsoservices unleashed with containers and ECS
Micrsoservices unleashed with containers and ECSMicrsoservices unleashed with containers and ECS
Micrsoservices unleashed with containers and ECS
 
AWSome day 2018 - database in cloud
AWSome day 2018 -  database in cloudAWSome day 2018 -  database in cloud
AWSome day 2018 - database in cloud
 
NEW LAUNCH! Advanced Task Scheduling with Amazon ECS and Blox
NEW LAUNCH! Advanced Task Scheduling with Amazon ECS and BloxNEW LAUNCH! Advanced Task Scheduling with Amazon ECS and Blox
NEW LAUNCH! Advanced Task Scheduling with Amazon ECS and Blox
 
Cloud brew cloudcamp
Cloud brew cloudcampCloud brew cloudcamp
Cloud brew cloudcamp
 
Design, Deploy, and Optimize SQL Server on AWS - AWS Online Tech Talks
Design, Deploy, and Optimize SQL Server on AWS - AWS Online Tech TalksDesign, Deploy, and Optimize SQL Server on AWS - AWS Online Tech Talks
Design, Deploy, and Optimize SQL Server on AWS - AWS Online Tech Talks
 
Travel hackathon
Travel hackathonTravel hackathon
Travel hackathon
 
AWS KSS
AWS  KSSAWS  KSS
AWS KSS
 

Similar to SoCal NodeJS Meetup 20170215_aws_lambda

What's New in AWS Serverless and Containers
What's New in AWS Serverless and ContainersWhat's New in AWS Serverless and Containers
What's New in AWS Serverless and Containers
Amazon Web Services
 

Similar to SoCal NodeJS Meetup 20170215_aws_lambda (20)

Flying Server-less on the Cloud with AWS Lambda
Flying Server-less on the Cloud with AWS LambdaFlying Server-less on the Cloud with AWS Lambda
Flying Server-less on the Cloud with AWS Lambda
 
Deep Dive on AWS Lambda
Deep Dive on AWS LambdaDeep Dive on AWS Lambda
Deep Dive on AWS Lambda
 
Deep Dive on AWS Lambda - January 2017 AWS Online Tech Talks
Deep Dive on AWS Lambda - January 2017 AWS Online Tech TalksDeep Dive on AWS Lambda - January 2017 AWS Online Tech Talks
Deep Dive on AWS Lambda - January 2017 AWS Online Tech Talks
 
Serverless Architecture Patterns
Serverless Architecture PatternsServerless Architecture Patterns
Serverless Architecture Patterns
 
serverless_architecture_patterns_london_loft.pdf
serverless_architecture_patterns_london_loft.pdfserverless_architecture_patterns_london_loft.pdf
serverless_architecture_patterns_london_loft.pdf
 
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
 
What's New with AWS Lambda
What's New with AWS LambdaWhat's New with AWS Lambda
What's New with AWS Lambda
 
From Serverless to InterCloud
From Serverless to InterCloudFrom Serverless to InterCloud
From Serverless to InterCloud
 
NEW LAUNCH! Developing Serverless C# Applications
NEW LAUNCH! Developing Serverless C# ApplicationsNEW LAUNCH! Developing Serverless C# Applications
NEW LAUNCH! Developing Serverless C# Applications
 
What's New in AWS Serverless and Containers
What's New in AWS Serverless and ContainersWhat's New in AWS Serverless and Containers
What's New in AWS Serverless and Containers
 
AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)
AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)
AWS re:Invent 2016: Accenture Cloud Platform Serverless Journey (ARC202)
 
Serverless Architecture Patterns
Serverless Architecture PatternsServerless Architecture Patterns
Serverless Architecture Patterns
 
How Serverless Changes DevOps
How Serverless Changes DevOpsHow Serverless Changes DevOps
How Serverless Changes DevOps
 
Local Testing and Deployment Best Practices for Serverless Applications - AWS...
Local Testing and Deployment Best Practices for Serverless Applications - AWS...Local Testing and Deployment Best Practices for Serverless Applications - AWS...
Local Testing and Deployment Best Practices for Serverless Applications - AWS...
 
Local Testing and Deployment Best Practices for Serverless Applications - AWS...
Local Testing and Deployment Best Practices for Serverless Applications - AWS...Local Testing and Deployment Best Practices for Serverless Applications - AWS...
Local Testing and Deployment Best Practices for Serverless Applications - AWS...
 
Going serverless with aws
Going serverless with awsGoing serverless with aws
Going serverless with aws
 
Webinar: Serverless Architectures with AWS Lambda and MongoDB Atlas
Webinar: Serverless Architectures with AWS Lambda and MongoDB AtlasWebinar: Serverless Architectures with AWS Lambda and MongoDB Atlas
Webinar: Serverless Architectures with AWS Lambda and MongoDB Atlas
 
DevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless ArchitectureDevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless Architecture
 
Chalice microframework 101 (eng)
Chalice microframework 101 (eng)Chalice microframework 101 (eng)
Chalice microframework 101 (eng)
 
AWS Lambda Features and Uses
AWS Lambda Features and UsesAWS Lambda Features and Uses
AWS Lambda Features and Uses
 

Recently uploaded

一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
F
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
F
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Monica Sydney
 

Recently uploaded (20)

一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girls
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 

SoCal NodeJS Meetup 20170215_aws_lambda

  • 1. Deploying Web Services with 
 AWS Lambda Stefan Deusch Software Delivery at vroozi.com & Owner of sunsprinkle.com February 15, 2017
  • 2. Agenda • Lambda Essentials • Creation of AWS Lambda code • Limitations of AWS Lambda • Demo • Event Driven Architecture • Questions & Answers
  • 3. What is Lambda? Fully Managed Computing Platform • run code without owning or leasing servers in AWS • event-driven, stateless, immutable • pay for what you use Completely Outsources Administration • availability / fault tolerance • elasticity • server and OS maintenance • monitoring, logging
  • 4. Lambda Essentials • You allocate:
 - memory
 - execution timeout • Lambda allocates:
 - CPU
 - disk I/O
 - network I/O • Supported Languages
 - Node.js
 - Python (2.7)
 - Java (8) 
 - C#
  • 5. Hello World console.log('Loading function’); exports.handler = (event, context, callback) => { console.log('Received event:’, JSON.stringify(event)); console.log('name =', event.name); var name = ''; if ('name' in event) { name = event['name']; } else { name = 'World'; } var greetings = 'Hello ' + name + '!'; console.log(greetings); callback(null, greetings); };
  • 6. Deploying a AWS Lambda function from the CLI > aws lambda create-function --function-name helloWorld --zip-file filed:///index.zip --handle index.handler --role arn:aws:iam::669172621759:role/lambda_write_dynamodb --runtime nodejs4.3 --description ‘say hello’
  • 7. Event Sources for Lambda Event Model 
 - Push (event sources invokes Lambda, S3, SNS, Cognito, Echo, etc.) 
 - Pull (Lambda polls event source) DynamoDB, Kinesis)
 - event source is mapped
  • 8.
  • 9. Limitations of Lambda • Throttle limits
 - 100 concurrent function executions total • Resource limits
 - 1024 processes / threads 
 - 1024 file descriptors 
 - 512 MB ephemeral /tmp space
 - maximum execution time: 300 sec
 - request/response payload: 6 MB
 - 1.5 GB RAM • Functional limits
 - cold start time 
 - CPU allocation (proportional to memory allocation)
  • 10. Security • IAM (execution) role 
 permissions you grant to this role determine what AWS Lambda function can do • Lambda (resource) policy 
 Permission granted to Lambda determine which service or event can invoke your function 

  • 13. Event Driven Architecture • event-driven means no centralized workflow • application does not enforce sequence of events • decoupling of server from receiver • micro services architecture - distributed transactions are hard (CAP) • reactive programming - countless possibilities
  • 14. AWS Lambda Pricing • by memory and execution time
 
 $0.00001667 per GB-second used
 
 https://s3.amazonaws.com/lambda-tools/pricing- calculator.html
 • but also pay for S3, EC2, DynamoDB
  • 15. Deployment Frameworks • AWS CloudFormation (YML, JSON) • Chalice (Python) • serverless.com • Apex.run • Claudia.js
  • 16. Thank You Q & A References • AWS Lambda in Action, Danilo Poccia, Manning • LinuxAcademy - Lambda Deep Dive