SlideShare uma empresa Scribd logo
1 de 36
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Amazon Web Services
 

Mais procurados (20)

Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
AWS Lambda and the Serverless Cloud
AWS Lambda and the Serverless CloudAWS Lambda and the Serverless Cloud
AWS Lambda and the Serverless Cloud
 
AWS - Lambda Fundamentals
AWS - Lambda FundamentalsAWS - Lambda Fundamentals
AWS - Lambda Fundamentals
 
AWS API Gateway
AWS API GatewayAWS API Gateway
AWS API Gateway
 
Serverless Architectures.pdf
Serverless Architectures.pdfServerless Architectures.pdf
Serverless Architectures.pdf
 
AWS Lambda Features and Uses
AWS Lambda Features and UsesAWS Lambda Features and Uses
AWS Lambda Features and Uses
 
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
 
Introduction to AWS VPC, Guidelines, and Best Practices
Introduction to AWS VPC, Guidelines, and Best PracticesIntroduction to AWS VPC, Guidelines, and Best Practices
Introduction to AWS VPC, Guidelines, and Best Practices
 
AWS Technical Essentials Day
AWS Technical Essentials DayAWS Technical Essentials Day
AWS Technical Essentials Day
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
Getting Started on Amazon EKS
Getting Started on Amazon EKSGetting Started on Amazon EKS
Getting Started on Amazon EKS
 
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...
 
Introduce AWS Lambda for newbie and Non-IT
Introduce AWS Lambda for newbie and Non-ITIntroduce AWS Lambda for newbie and Non-IT
Introduce AWS Lambda for newbie and Non-IT
 
Serverless computing
Serverless computingServerless computing
Serverless computing
 
Getting Started with AWS Lambda and Serverless
Getting Started with AWS Lambda and ServerlessGetting Started with AWS Lambda and Serverless
Getting Started with AWS Lambda and Serverless
 
Serverless Architecture
Serverless ArchitectureServerless Architecture
Serverless Architecture
 
AWS Containers Day.pdf
AWS Containers Day.pdfAWS Containers Day.pdf
AWS Containers Day.pdf
 
AWS CodeCommit, CodeDeploy & CodePipeline
AWS CodeCommit, CodeDeploy & CodePipelineAWS CodeCommit, CodeDeploy & CodePipeline
AWS CodeCommit, CodeDeploy & CodePipeline
 
AWS 101: Introduction to AWS
AWS 101: Introduction to AWSAWS 101: Introduction to AWS
AWS 101: Introduction to AWS
 

Destaque

Destaque (20)

Bringing API Management to AWS Powered Backends
Bringing API Management to AWS Powered BackendsBringing API Management to AWS Powered Backends
Bringing API Management to AWS Powered Backends
 
Microservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices SuccessMicroservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices Success
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
AWS re:Invent 2016: The State of Serverless Computing (SVR311)
AWS re:Invent 2016: The State of Serverless Computing (SVR311)AWS re:Invent 2016: The State of Serverless Computing (SVR311)
AWS re:Invent 2016: The State of Serverless Computing (SVR311)
 
API Management and Kubernetes
API Management and KubernetesAPI Management and Kubernetes
API Management and Kubernetes
 
Adapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg BrailAdapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg Brail
 
What's Better than Microservices? Serverless Microservices.
What's Better than Microservices? Serverless Microservices.What's Better than Microservices? Serverless Microservices.
What's Better than Microservices? Serverless Microservices.
 
Adapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet KapoorAdapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet Kapoor
 
Adapt or Die Sydney - API Security
Adapt or Die Sydney - API SecurityAdapt or Die Sydney - API Security
Adapt or Die Sydney - API Security
 
How Serverless Computing Enables Microservices and Micropayment 
How Serverless Computing Enables Microservices and Micropayment  How Serverless Computing Enables Microservices and Micropayment 
How Serverless Computing Enables Microservices and Micropayment 
 
Serverless architecture with AWS Lambda (June 2016)
Serverless architecture with AWS Lambda (June 2016)Serverless architecture with AWS Lambda (June 2016)
Serverless architecture with AWS Lambda (June 2016)
 
Lay of the land and the road ahead
Lay of the land and the road aheadLay of the land and the road ahead
Lay of the land and the road ahead
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
슬로우캠퍼스 - 안드로이드 개발자들이여 Firebase로 날아보자 :)
슬로우캠퍼스 - 안드로이드 개발자들이여  Firebase로 날아보자 :)슬로우캠퍼스 - 안드로이드 개발자들이여  Firebase로 날아보자 :)
슬로우캠퍼스 - 안드로이드 개발자들이여 Firebase로 날아보자 :)
 
Building APIs with Apigee Edge and Microsoft Azure
Building APIs with Apigee Edge and Microsoft AzureBuilding APIs with Apigee Edge and Microsoft Azure
Building APIs with Apigee Edge and Microsoft Azure
 
Cloud Deployments Done Right: Why APIs are Key
Cloud Deployments Done Right: Why APIs are KeyCloud Deployments Done Right: Why APIs are Key
Cloud Deployments Done Right: Why APIs are Key
 
gRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at SquaregRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at Square
 
AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)
AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)
AWS Lambda와 API Gateway를 통한 Serverless Architecture 특집 (윤석찬)
 
Adapt or Die: A Microservices Story at Google
Adapt or Die: A Microservices Story at GoogleAdapt or Die: A Microservices Story at Google
Adapt or Die: A Microservices Story at Google
 
Docker + Kubernetes를 이용한 빌드 서버 가상화 사례
Docker + Kubernetes를 이용한 빌드 서버 가상화 사례Docker + Kubernetes를 이용한 빌드 서버 가상화 사례
Docker + Kubernetes를 이용한 빌드 서버 가상화 사례
 

Semelhante a Serverless computing with AWS Lambda

Semelhante a Serverless computing with AWS Lambda (20)

Compute Without Servers – Building Applications with AWS Lambda
Compute Without Servers – Building Applications with AWS LambdaCompute Without Servers – Building Applications with AWS Lambda
Compute Without Servers – Building Applications with AWS Lambda
 
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
 
re:Invent recap session 1: What's New with AWS Lambda
re:Invent recap session 1: What's New with AWS Lambda re:Invent recap session 1: What's New with AWS Lambda
re:Invent recap session 1: What's New with AWS Lambda
 
Serverless Architectural Patterns & Best Practices
Serverless Architectural Patterns & Best PracticesServerless Architectural Patterns & Best Practices
Serverless Architectural Patterns & Best Practices
 
Build and run applications without thinking about servers
Build and run applications without thinking about serversBuild and run applications without thinking about servers
Build and run applications without thinking about servers
 
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
 
An introduction to serverless architectures (February 2017)
An introduction to serverless architectures (February 2017)An introduction to serverless architectures (February 2017)
An introduction to serverless architectures (February 2017)
 
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
 
Migrating your .NET Applications to the AWS Serverless Platform
Migrating your .NET Applications to the AWS Serverless PlatformMigrating your .NET Applications to the AWS Serverless Platform
Migrating your .NET Applications to the AWS Serverless Platform
 
Serverless cat detector workshop - cloudyna 2017 (16.12.2017)
Serverless cat detector   workshop - cloudyna 2017 (16.12.2017)Serverless cat detector   workshop - cloudyna 2017 (16.12.2017)
Serverless cat detector workshop - cloudyna 2017 (16.12.2017)
 
AWS re:Invent 2016: Monitoring, Hold the Infrastructure: Getting the Most fro...
AWS re:Invent 2016: Monitoring, Hold the Infrastructure: Getting the Most fro...AWS re:Invent 2016: Monitoring, Hold the Infrastructure: Getting the Most fro...
AWS re:Invent 2016: Monitoring, Hold the Infrastructure: Getting the Most fro...
 
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless CloudSRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural Patterns
 
February 2016 Webinar Series - Introducing VPC Support for AWS Lambda
February 2016 Webinar Series - Introducing VPC Support for AWS LambdaFebruary 2016 Webinar Series - Introducing VPC Support for AWS Lambda
February 2016 Webinar Series - Introducing VPC Support for AWS Lambda
 
Serverless Design Patterns
Serverless Design PatternsServerless Design Patterns
Serverless Design Patterns
 
Serveless design patterns (VoxxedDays Luxembourg)
Serveless design patterns (VoxxedDays Luxembourg)Serveless design patterns (VoxxedDays Luxembourg)
Serveless design patterns (VoxxedDays Luxembourg)
 
Introduction to AWS lambda & Serverless Application1.pptx
Introduction to AWS lambda & Serverless Application1.pptxIntroduction to AWS lambda & Serverless Application1.pptx
Introduction to AWS lambda & Serverless Application1.pptx
 
Serverless use cases with AWS Lambda
Serverless use cases with AWS Lambda Serverless use cases with AWS Lambda
Serverless use cases with AWS Lambda
 
Raleigh DevDay 2017: Building serverless web applications
Raleigh DevDay 2017: Building serverless web applicationsRaleigh DevDay 2017: Building serverless web applications
Raleigh DevDay 2017: Building serverless web applications
 

Mais de Apigee | Google Cloud

Mais de Apigee | Google Cloud (20)

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

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 

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