SlideShare a Scribd company logo
Serverless computing with AWS Lambda
Matt McClean
AWS Solutions Architect
1
What to expect from this session
•  Evolution of Cloud Compute toward Serverless
•  What is AWS Lambda?
•  Building a serverless data processing architecture
•  Real-time data processing architecture patterns
•  Tips and tricks for using AWS Lambda
•  Live demo of Apigee + AWS Lambda app
Evolution of Cloud Compute towards
Serverless
3
©2016 Apigee. All Rights Reserved.
Evolution of Compute – Public Cloud
Infrastructure
Instances
Application code
Evolution of Compute – Containers
Infrastructure
Instances
Application code
Containers
Evolution of Compute – Serverless
Application code
What is AWS Lambda?
7
©2016 Apigee. All Rights Reserved.
AWS Lambda
Serverless, event-driven compute service
Lambda = microservice without servers
AWS Lambda – Benefits
EVENT-DRIVEN SCALE
SERVERLESS
 SUBSECOND BILLING
AWS Lambda – Capabilities
BRING YOUR OWN CODE SIMPLE RESOURCE MODEL
FLEXIBLE INVOCATION PATHS GRANULAR PERMISSIONS CONTROL
AWS Lambda – How it Works
AUTHORING STATELESS
DEPLOYMENT MONITORING & LOGGING
AWS Lambda – Partner Ecosystem
Building a Serverless Data Processing
Architecture
13
©2016 Apigee. All Rights Reserved.
SOURCE of
data
Fleet of servers poll for
changes
Listening to source Pushes to queue Pull off queue
Fleet of servers act as workers
to process the data
Auto-scale
worker nodes
to adjust with
load
S3 objects
Amazon Kinesis records
DynamoDB tables
SNS messages
IoT devices
…
Cross-AZ
replication for
high
availability
Load balancer
to distribute
traffic
Data Processing Architecture with Servers
Application code
SOURCE of
data
Attach a Lambda function
And that’s it!
Lambda does
Listening/polling
Queuing
Auto scaling
Redundancy
Load balancing
Data Processing Architecture Without Servers
Application code
Real-Time Data Processing Architecture
Patterns
16
©2016 Apigee. All Rights Reserved.
Sample Real-Time File Processing Workflow Using
Amazon S3 & AWS Lambda
Amazon S3 AWS Lambda
Amazon S3
New file
uploaded
Amazon
DynamoDB
Example – Video Clip Transcode
// Transcode video files uploaded to an S3 bucket
var async = require('async');
var fs = require('fs');
var exec = require('child_process').exec;
var aws = require('aws-sdk');
var s3 = new aws.S3();
// Lambda entry point
exports.handler = function(event, context) {
var inputVideo = '/tmp/myVideo.avi';
var outputVideo = '/tmp/myVideo.mp4';
var inputBucket = event.Records[0].s3.bucket.name;
var inputKey = event.Records[0].s3.object.key;
var outputBucket = inputBucket + '-out';
var outputKey = inputKey.substr(0,inputKey.length-4) + '.mp4';
// Runs the array of functions in series, each passing their results to the next
async.waterfall([
Set up variables
Serialize steps
Example – Video Clip Transcode
// Download the object from S3 into a buffer
function download(next) {
s3.getObject({Bucket: inputBucket, Key: inputKey}, next); },
// Write the buffer to a file
function write(response, next) {
fs.writeFile(inputVideo, response.Body, next); },
// Spawn a process to transcode
function transcode(next) {
exec("./ffmpeg -i " + inputVideo + " -vcodec mpeg4 -b:v 1200k “
+ outputVideo, next); },
// Read the file to a buffer
function read(next) {
fs.readFile(outputVideo, next); },
// Upload the buffer to an object in S3
function upload(objectBuffer, next) {
s3.putObject({Bucket: outputBucket, Key: outputKey, Body: objectBuffer},
context.done); },
], context.fail);
};
Get file from S3
Write to disk
ffmpeg transcode
Read from disk
Upload to S3
Sample Real-Time Stream Processing Workflow Using Amazon
Kinesis & AWS Lambda
Amazon Kinesis AWS Lambda
Amazon Redshift
Amazon SNS
New records
available
Sample Real-Time DB Triggers Workflow Using Amazon
DynamoDB & AWS Lambda
New data
available
Amazon DynamoDB AWS Lambda
Amazon
DynamoDB
Amazon Redshift
Sample Real-Time Message Handling Workflow Using
Amazon SNS & AWS Lambda
New message
published
Amazon SNS AWS Lambda
Amazon SNS
Amazon Kinesis
Sample CRUD Backend Workflow Using Amazon API
Gateway & AWS Lambda
New API
called
Amazon API Gateway AWS Lambda
Amazon S3
Amazon
DynamoDB
More Triggers for AWS Lambda
AWS
CloudFormation
Custom Resources
Amazon SES
Actions
Amazon Cognito
Sync Triggers
… and the list will
continue to grow!
AWS IoT ActionsAWS Lambda
Scheduled Events
Amazon Echo
Skills
Amazon SWF Tasks
Tips and Tricks for using AWS Lambda
25
©2016 Apigee. All Rights Reserved.
Using Lambda to Audit CloudTrail Activity
AWS
Lambda
Amazon S3Amazon CloudTrail
Amazon SNS
AWS IAM
Using Lambda for Automated Infrastructure Management
AWS
Lambda
Amazon
SNS
Amazon
CloudWatch Alarm
ec2
runInstance
ecs
startTask
beanstalk
updateApp
kinesis
splitShard
Any API call
https://aws.amazon.com/blogs/compute/scaling-amazon-ecs-services-automatically-using-amazon-cloudwatch-and-aws-lambda/ 
Amazon
CloudWatch Event
Using Lambda to Forward AWS Events to Slack
AWS
Lambda
Amazon
SNS
Amazon
CloudWatch Events
Auto Scaling
Slack
https://aws.amazon.com/blogs/aws/new-slack-integration-blueprints-for-aws-lambda/
Using Lambda to Deploy Lambda Functions
https://aws.amazon.com/blogs/compute/dynamic-github-actions-with-aws-lambda/ 
AWS
Lambda
Amazon
SNS
GitHub Repo
lambda
createFn ()
Using Lambda in your software delivery pipeline
AWS
Lambda
AWS
CodeCommit
AWS
CodePipeline
https://aws.amazon.com/about-aws/whats-new/2016/01/aws-codepipeline-
adds-support-for-triggering-aws-lambda-functions/
A Few Other Tips and Tricks for Extending AWS Lambda
Functionality
Ø  Use /tmp space as cache
Ø  Run arbitrary binaries
Ø  Use Grunt and Jenkins plugins for deploying
Ø  Build event-driven Amazon ECS
Ø  Try out Serverless Framework
Reference Architecture
32
API Management covers the entire API Lifecycle
33
Design
Develop
Secure
Publish
Monitor
Analyze
Monetize
Scale
AWS API 
Gateway
Demo
34
Visit
http://aws.amazon.com/lambda, the
AWS Compute blog, or the
Lambda forum to learn more and to
get started using Lambda.
More info
Thank you

More Related Content

What's hot (20)

PDF
AWS Serverless Introduction (Lambda)
Ashish Kushwaha
 
PPTX
AWS Lambda
Andrew Dixon
 
PPTX
AWS Monitoring & Logging
Jason Poley
 
PDF
Introduction to Serverless
Nikolaus Graf
 
PPTX
Basics AWS Presentation
Shyam Kumar
 
ODP
Introduction to AWS IAM
Knoldus Inc.
 
PDF
Amazon CloudWatch Tutorial | AWS Certification | Cloud Monitoring Tools | AWS...
Edureka!
 
PDF
서버리스 앱 배포 자동화 (김필중, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
Amazon Web Services Korea
 
PPTX
AWS API Gateway
Muhammed YALÇIN
 
PDF
CodeBuild CodePipeline CodeDeploy CodeCommit in AWS | Edureka
Edureka!
 
PPTX
Aws ppt
RamyaG50
 
PPTX
AWS VPC Fundamental
Piyush Agrawal
 
PDF
AWS EC2
Mahesh Raj
 
PDF
AWS 상의 컨테이너 서비스 소개 ECS, EKS - 이종립 / Principle Enterprise Evangelist @베스핀글로벌
BESPIN GLOBAL
 
PPTX
Introduction to Amazon Web Services (AWS)
Garvit Anand
 
PPT
Auto Scaling on AWS
AustinWebArch
 
PDF
AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)
Amazon Web Services Korea
 
PDF
Aws concepts-power-point-slides
Sushil Thapa
 
PDF
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon Web Services Korea
 
PPTX
Introduction to DevOps on AWS
Shiva Narayanaswamy
 
AWS Serverless Introduction (Lambda)
Ashish Kushwaha
 
AWS Lambda
Andrew Dixon
 
AWS Monitoring & Logging
Jason Poley
 
Introduction to Serverless
Nikolaus Graf
 
Basics AWS Presentation
Shyam Kumar
 
Introduction to AWS IAM
Knoldus Inc.
 
Amazon CloudWatch Tutorial | AWS Certification | Cloud Monitoring Tools | AWS...
Edureka!
 
서버리스 앱 배포 자동화 (김필중, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
Amazon Web Services Korea
 
AWS API Gateway
Muhammed YALÇIN
 
CodeBuild CodePipeline CodeDeploy CodeCommit in AWS | Edureka
Edureka!
 
Aws ppt
RamyaG50
 
AWS VPC Fundamental
Piyush Agrawal
 
AWS EC2
Mahesh Raj
 
AWS 상의 컨테이너 서비스 소개 ECS, EKS - 이종립 / Principle Enterprise Evangelist @베스핀글로벌
BESPIN GLOBAL
 
Introduction to Amazon Web Services (AWS)
Garvit Anand
 
Auto Scaling on AWS
AustinWebArch
 
AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)
Amazon Web Services Korea
 
Aws concepts-power-point-slides
Sushil Thapa
 
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon Web Services Korea
 
Introduction to DevOps on AWS
Shiva Narayanaswamy
 

Viewers also liked (20)

PDF
Bringing API Management to AWS Powered Backends
Apigee | Google Cloud
 
PPTX
Microservices Done Right: Key Ingredients for Microservices Success
Apigee | Google Cloud
 
PPTX
API Management and Kubernetes
Apigee | Google Cloud
 
PDF
Adapt or Die: Keynote with Greg Brail
Apigee | Google Cloud
 
PPTX
What's Better than Microservices? Serverless Microservices.
Apigee | Google Cloud
 
PDF
Adapt or Die: Opening Keynote with Chet Kapoor
Apigee | Google Cloud
 
PPTX
Adapt or Die Sydney - API Security
Apigee | Google Cloud
 
PDF
Serverless architecture with AWS Lambda (June 2016)
Julien SIMON
 
PDF
Lay of the land and the road ahead
Apigee | Google Cloud
 
PDF
슬로우캠퍼스 - 안드로이드 개발자들이여 Firebase로 날아보자 :)
마이캠퍼스
 
PPTX
Building APIs with Apigee Edge and Microsoft Azure
Apigee | Google Cloud
 
PPTX
Cloud Deployments Done Right: Why APIs are Key
Apigee | Google Cloud
 
PDF
gRPC: The Story of Microservices at Square
Apigee | Google Cloud
 
PPTX
Adapt or Die: A Microservices Story at Google
Apigee | Google Cloud
 
PDF
Docker + Kubernetes를 이용한 빌드 서버 가상화 사례
NAVER LABS
 
PDF
AWS re:Invent 특집(2) – 서버리스(Serverless) 마이크로서비스를 위한 일곱 가지 모범 사례 (윤석찬)
Amazon Web Services Korea
 
PDF
AWS re:Invent 특집(4) – 개발자를 위한 신규 서비스 총정리(윤석찬)
Amazon Web Services Korea
 
PPTX
Adapt or Die: Serverless Microservices
Apigee | Google Cloud
 
PPTX
London Adapt or Die: Five Things Enterprises Should Know About Serverless
Apigee | Google Cloud
 
PPTX
London Adapt or Die: Securing your APIs the Right Way!
Apigee | Google Cloud
 
Bringing API Management to AWS Powered Backends
Apigee | Google Cloud
 
Microservices Done Right: Key Ingredients for Microservices Success
Apigee | Google Cloud
 
API Management and Kubernetes
Apigee | Google Cloud
 
Adapt or Die: Keynote with Greg Brail
Apigee | Google Cloud
 
What's Better than Microservices? Serverless Microservices.
Apigee | Google Cloud
 
Adapt or Die: Opening Keynote with Chet Kapoor
Apigee | Google Cloud
 
Adapt or Die Sydney - API Security
Apigee | Google Cloud
 
Serverless architecture with AWS Lambda (June 2016)
Julien SIMON
 
Lay of the land and the road ahead
Apigee | Google Cloud
 
슬로우캠퍼스 - 안드로이드 개발자들이여 Firebase로 날아보자 :)
마이캠퍼스
 
Building APIs with Apigee Edge and Microsoft Azure
Apigee | Google Cloud
 
Cloud Deployments Done Right: Why APIs are Key
Apigee | Google Cloud
 
gRPC: The Story of Microservices at Square
Apigee | Google Cloud
 
Adapt or Die: A Microservices Story at Google
Apigee | Google Cloud
 
Docker + Kubernetes를 이용한 빌드 서버 가상화 사례
NAVER LABS
 
AWS re:Invent 특집(2) – 서버리스(Serverless) 마이크로서비스를 위한 일곱 가지 모범 사례 (윤석찬)
Amazon Web Services Korea
 
AWS re:Invent 특집(4) – 개발자를 위한 신규 서비스 총정리(윤석찬)
Amazon Web Services Korea
 
Adapt or Die: Serverless Microservices
Apigee | Google Cloud
 
London Adapt or Die: Five Things Enterprises Should Know About Serverless
Apigee | Google Cloud
 
London Adapt or Die: Securing your APIs the Right Way!
Apigee | Google Cloud
 
Ad

Similar to Serverless computing with AWS Lambda (20)

PPTX
Getting started with Serverless on AWS
Adrian Hornsby
 
PDF
AWSomeDay Zurich 2018 - How to go serverless
Roman Plessl
 
PPTX
Going Serverless at AWS Startup Day Bangalore
Madhusudan Shekar
 
PDF
DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud
Ian Massingham
 
PDF
Getting Started with AWS Lambda & Serverless Cloud
Ian Massingham
 
PDF
Serverless use cases with AWS Lambda
Boaz Ziniman
 
PPTX
Primeros pasos en desarrollo serverless
javier ramirez
 
PPTX
Auto Retweets Using AWS Lambda
CodeOps Technologies LLP
 
PPTX
Scheduled Retweets Using AWS Lambda
Srushith Repakula
 
PDF
Aws lambda webinar -buraku
burakunuvar
 
PDF
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Steve Androulakis
 
PDF
Building serverless backends - Tech talk 5 May 2017
ARDC
 
PDF
Serverless use cases with AWS Lambda - More Serverless Event
Boaz Ziniman
 
PDF
Modern Applications Development on AWS
Boaz Ziniman
 
PDF
Infinite Scaling using Lambda and Aws - Atlogys Tech Talk
Atlogys Technical Consulting
 
PDF
Getting started with AWS Lambda and the Serverless Cloud
Ian Massingham
 
PDF
Introduction to Serverless Computing - OOP Munich
Boaz Ziniman
 
PDF
Serverless architectures-with-aws-lambda
saifam
 
PDF
Getting Started with Serverless Architectures
Rohini Gaonkar
 
PPTX
Getting Started with Serverless Architectures
AWS Summits
 
Getting started with Serverless on AWS
Adrian Hornsby
 
AWSomeDay Zurich 2018 - How to go serverless
Roman Plessl
 
Going Serverless at AWS Startup Day Bangalore
Madhusudan Shekar
 
DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud
Ian Massingham
 
Getting Started with AWS Lambda & Serverless Cloud
Ian Massingham
 
Serverless use cases with AWS Lambda
Boaz Ziniman
 
Primeros pasos en desarrollo serverless
javier ramirez
 
Auto Retweets Using AWS Lambda
CodeOps Technologies LLP
 
Scheduled Retweets Using AWS Lambda
Srushith Repakula
 
Aws lambda webinar -buraku
burakunuvar
 
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Steve Androulakis
 
Building serverless backends - Tech talk 5 May 2017
ARDC
 
Serverless use cases with AWS Lambda - More Serverless Event
Boaz Ziniman
 
Modern Applications Development on AWS
Boaz Ziniman
 
Infinite Scaling using Lambda and Aws - Atlogys Tech Talk
Atlogys Technical Consulting
 
Getting started with AWS Lambda and the Serverless Cloud
Ian Massingham
 
Introduction to Serverless Computing - OOP Munich
Boaz Ziniman
 
Serverless architectures-with-aws-lambda
saifam
 
Getting Started with Serverless Architectures
Rohini Gaonkar
 
Getting Started with Serverless Architectures
AWS Summits
 
Ad

More from Apigee | Google Cloud (20)

PDF
How Secure Are Your APIs?
Apigee | Google Cloud
 
PDF
Magazine Luiza at a glance (1)
Apigee | Google Cloud
 
PPTX
Monetization: Unlock More Value from Your APIs
Apigee | Google Cloud
 
PDF
Apigee Demo: API Platform Overview
Apigee | Google Cloud
 
PDF
Ticketmaster at a glance
Apigee | Google Cloud
 
PDF
AccuWeather: Recasting API Experiences in a Developer-First World
Apigee | Google Cloud
 
PDF
Which Application Modernization Pattern Is Right For You?
Apigee | Google Cloud
 
PPTX
Apigee Product Roadmap Part 2
Apigee | Google Cloud
 
PPTX
The Four Transformative Forces of the API Management Market
Apigee | Google Cloud
 
PDF
Walgreens at a glance
Apigee | Google Cloud
 
PDF
Apigee Edge: Intro to Microgateway
Apigee | Google Cloud
 
PDF
Managing the Complexity of Microservices Deployments
Apigee | Google Cloud
 
PDF
Pitney Bowes at a glance
Apigee | Google Cloud
 
PDF
Adapt or Die: Keynote with Anant Jhingran
Apigee | Google Cloud
 
PDF
London Adapt or Die: Opening Keynot
Apigee | Google Cloud
 
PDF
London Adapt or Die: Lunch keynote
Apigee | Google Cloud
 
PDF
London Adapt or Die: Closing Keynote — Adapt Now!
Apigee | Google Cloud
 
PPTX
London adapt or-die opening keynote chet kapoor
Apigee | Google Cloud
 
PPTX
London Adapt or Die: Opening Keynote with Chet Kapoor
Apigee | Google Cloud
 
PPTX
London Adapt or Die: Kubernetes, Containers and Cloud - The MoD Story
Apigee | Google Cloud
 
How Secure Are Your APIs?
Apigee | Google Cloud
 
Magazine Luiza at a glance (1)
Apigee | Google Cloud
 
Monetization: Unlock More Value from Your APIs
Apigee | Google Cloud
 
Apigee Demo: API Platform Overview
Apigee | Google Cloud
 
Ticketmaster at a glance
Apigee | Google Cloud
 
AccuWeather: Recasting API Experiences in a Developer-First World
Apigee | Google Cloud
 
Which Application Modernization Pattern Is Right For You?
Apigee | Google Cloud
 
Apigee Product Roadmap Part 2
Apigee | Google Cloud
 
The Four Transformative Forces of the API Management Market
Apigee | Google Cloud
 
Walgreens at a glance
Apigee | Google Cloud
 
Apigee Edge: Intro to Microgateway
Apigee | Google Cloud
 
Managing the Complexity of Microservices Deployments
Apigee | Google Cloud
 
Pitney Bowes at a glance
Apigee | Google Cloud
 
Adapt or Die: Keynote with Anant Jhingran
Apigee | Google Cloud
 
London Adapt or Die: Opening Keynot
Apigee | Google Cloud
 
London Adapt or Die: Lunch keynote
Apigee | Google Cloud
 
London Adapt or Die: Closing Keynote — Adapt Now!
Apigee | Google Cloud
 
London adapt or-die opening keynote chet kapoor
Apigee | Google Cloud
 
London Adapt or Die: Opening Keynote with Chet Kapoor
Apigee | Google Cloud
 
London Adapt or Die: Kubernetes, Containers and Cloud - The MoD Story
Apigee | Google Cloud
 

Recently uploaded (20)

PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Software Development Company Keene Systems, Inc (1).pdf
Custom Software Development Company | Keene Systems, Inc.
 
PPTX
Role_of_Artificial_Intelligence_in_Livestock_Extension_Services.pptx
DrRajdeepMadavi
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PPTX
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
PPTX
Talbott's brief History of Computers for CollabDays Hamburg 2025
Talbott Crowell
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PPTX
Manual Testing for Accessibility Enhancement
Julia Undeutsch
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
Next Generation AI: Anticipatory Intelligence, Forecasting Inflection Points ...
dleka294658677
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Software Development Company Keene Systems, Inc (1).pdf
Custom Software Development Company | Keene Systems, Inc.
 
Role_of_Artificial_Intelligence_in_Livestock_Extension_Services.pptx
DrRajdeepMadavi
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
Talbott's brief History of Computers for CollabDays Hamburg 2025
Talbott Crowell
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Digital Circuits, important subject in CS
contactparinay1
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Manual Testing for Accessibility Enhancement
Julia Undeutsch
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
Next Generation AI: Anticipatory Intelligence, Forecasting Inflection Points ...
dleka294658677
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 

Serverless computing with AWS Lambda

  • 1. Serverless computing with AWS Lambda Matt McClean AWS Solutions Architect 1
  • 2. What to expect from this session •  Evolution of Cloud Compute toward Serverless •  What is AWS Lambda? •  Building a serverless data processing architecture •  Real-time data processing architecture patterns •  Tips and tricks for using AWS Lambda •  Live demo of Apigee + AWS Lambda app
  • 3. Evolution of Cloud Compute towards Serverless 3 ©2016 Apigee. All Rights Reserved.
  • 4. Evolution of Compute – Public Cloud Infrastructure Instances Application code
  • 5. Evolution of Compute – Containers Infrastructure Instances Application code Containers
  • 6. Evolution of Compute – Serverless Application code
  • 7. What is AWS Lambda? 7 ©2016 Apigee. All Rights Reserved.
  • 8. AWS Lambda Serverless, event-driven compute service Lambda = microservice without servers
  • 9. AWS Lambda – Benefits EVENT-DRIVEN SCALE SERVERLESS SUBSECOND BILLING
  • 10. AWS Lambda – Capabilities BRING YOUR OWN CODE SIMPLE RESOURCE MODEL FLEXIBLE INVOCATION PATHS GRANULAR PERMISSIONS CONTROL
  • 11. AWS Lambda – How it Works AUTHORING STATELESS DEPLOYMENT MONITORING & LOGGING
  • 12. AWS Lambda – Partner Ecosystem
  • 13. Building a Serverless Data Processing Architecture 13 ©2016 Apigee. All Rights Reserved.
  • 14. SOURCE of data Fleet of servers poll for changes Listening to source Pushes to queue Pull off queue Fleet of servers act as workers to process the data Auto-scale worker nodes to adjust with load S3 objects Amazon Kinesis records DynamoDB tables SNS messages IoT devices … Cross-AZ replication for high availability Load balancer to distribute traffic Data Processing Architecture with Servers Application code
  • 15. SOURCE of data Attach a Lambda function And that’s it! Lambda does Listening/polling Queuing Auto scaling Redundancy Load balancing Data Processing Architecture Without Servers Application code
  • 16. Real-Time Data Processing Architecture Patterns 16 ©2016 Apigee. All Rights Reserved.
  • 17. Sample Real-Time File Processing Workflow Using Amazon S3 & AWS Lambda Amazon S3 AWS Lambda Amazon S3 New file uploaded Amazon DynamoDB
  • 18. Example – Video Clip Transcode // Transcode video files uploaded to an S3 bucket var async = require('async'); var fs = require('fs'); var exec = require('child_process').exec; var aws = require('aws-sdk'); var s3 = new aws.S3(); // Lambda entry point exports.handler = function(event, context) { var inputVideo = '/tmp/myVideo.avi'; var outputVideo = '/tmp/myVideo.mp4'; var inputBucket = event.Records[0].s3.bucket.name; var inputKey = event.Records[0].s3.object.key; var outputBucket = inputBucket + '-out'; var outputKey = inputKey.substr(0,inputKey.length-4) + '.mp4'; // Runs the array of functions in series, each passing their results to the next async.waterfall([ Set up variables Serialize steps
  • 19. Example – Video Clip Transcode // Download the object from S3 into a buffer function download(next) { s3.getObject({Bucket: inputBucket, Key: inputKey}, next); }, // Write the buffer to a file function write(response, next) { fs.writeFile(inputVideo, response.Body, next); }, // Spawn a process to transcode function transcode(next) { exec("./ffmpeg -i " + inputVideo + " -vcodec mpeg4 -b:v 1200k “ + outputVideo, next); }, // Read the file to a buffer function read(next) { fs.readFile(outputVideo, next); }, // Upload the buffer to an object in S3 function upload(objectBuffer, next) { s3.putObject({Bucket: outputBucket, Key: outputKey, Body: objectBuffer}, context.done); }, ], context.fail); }; Get file from S3 Write to disk ffmpeg transcode Read from disk Upload to S3
  • 20. Sample Real-Time Stream Processing Workflow Using Amazon Kinesis & AWS Lambda Amazon Kinesis AWS Lambda Amazon Redshift Amazon SNS New records available
  • 21. Sample Real-Time DB Triggers Workflow Using Amazon DynamoDB & AWS Lambda New data available Amazon DynamoDB AWS Lambda Amazon DynamoDB Amazon Redshift
  • 22. Sample Real-Time Message Handling Workflow Using Amazon SNS & AWS Lambda New message published Amazon SNS AWS Lambda Amazon SNS Amazon Kinesis
  • 23. Sample CRUD Backend Workflow Using Amazon API Gateway & AWS Lambda New API called Amazon API Gateway AWS Lambda Amazon S3 Amazon DynamoDB
  • 24. More Triggers for AWS Lambda AWS CloudFormation Custom Resources Amazon SES Actions Amazon Cognito Sync Triggers … and the list will continue to grow! AWS IoT ActionsAWS Lambda Scheduled Events Amazon Echo Skills Amazon SWF Tasks
  • 25. Tips and Tricks for using AWS Lambda 25 ©2016 Apigee. All Rights Reserved.
  • 26. Using Lambda to Audit CloudTrail Activity AWS Lambda Amazon S3Amazon CloudTrail Amazon SNS AWS IAM
  • 27. Using Lambda for Automated Infrastructure Management AWS Lambda Amazon SNS Amazon CloudWatch Alarm ec2 runInstance ecs startTask beanstalk updateApp kinesis splitShard Any API call https://aws.amazon.com/blogs/compute/scaling-amazon-ecs-services-automatically-using-amazon-cloudwatch-and-aws-lambda/ Amazon CloudWatch Event
  • 28. Using Lambda to Forward AWS Events to Slack AWS Lambda Amazon SNS Amazon CloudWatch Events Auto Scaling Slack https://aws.amazon.com/blogs/aws/new-slack-integration-blueprints-for-aws-lambda/
  • 29. Using Lambda to Deploy Lambda Functions https://aws.amazon.com/blogs/compute/dynamic-github-actions-with-aws-lambda/ AWS Lambda Amazon SNS GitHub Repo lambda createFn ()
  • 30. Using Lambda in your software delivery pipeline AWS Lambda AWS CodeCommit AWS CodePipeline https://aws.amazon.com/about-aws/whats-new/2016/01/aws-codepipeline- adds-support-for-triggering-aws-lambda-functions/
  • 31. A Few Other Tips and Tricks for Extending AWS Lambda Functionality Ø  Use /tmp space as cache Ø  Run arbitrary binaries Ø  Use Grunt and Jenkins plugins for deploying Ø  Build event-driven Amazon ECS Ø  Try out Serverless Framework
  • 33. API Management covers the entire API Lifecycle 33 Design Develop Secure Publish Monitor Analyze Monetize Scale AWS API Gateway
  • 35. Visit http://aws.amazon.com/lambda, the AWS Compute blog, or the Lambda forum to learn more and to get started using Lambda. More info