SlideShare una empresa de Scribd logo
1 de 45
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Pop-up Loft
Introduction to AWS Lambda and Serverless Applications
Chris Munns
Principal Developer Advocate
AWS Serverless
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
About me:
Chris Munns - munns@amazon.com, @chrismunns
– Principal Developer Advocate - Serverless
– New Yorker
– Previously:
• AWS Business Development Manager – DevOps, July ’15 - Feb ‘17
• AWS Solutions Architect Nov, 2011- Dec 2014
• Formerly on operations teams @Etsy and @Meetup
• Little time at a hedge fund, Xerox and a few other startups
– Rochester Institute of Technology: Applied Networking and Systems
Administration ’05
– Internet infrastructure geek
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
https://secure.flickr.com/photos/mgifford/4525333972
Why are we
here today?
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Serverless means …
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Serverless means …
No servers to provision
or manage
Scales with usage
Pay for value Availability and fault
tolerance built in
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Serverless means:
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Serverless means:
Greater agility
Less overhead
Better focus
Increased scale
More flexibility
Faster time to market
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Today’s focus:
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Event-driven compute
Functions as a service
Serverless FaaS
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Lambda Handles
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
AWS Lambda release history
LambdaPreview
Announcement
re:Invent2014
?
*As of October 2018, does not include region launches
2015 2016 2017 2018
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Serverless applications
Services (anything)Event source Function
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Serverless applications
Services (anything)
Changes in
data state
Requests to
endpoints
Changes in
resource state
Event source Function
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Serverless applications
Services (anything)
Changes in
data state
Requests to
endpoints
Changes in
resource state
Event source Function
Node.js
Python
Java
C#
Go
Ruby
Runtime APINEW!
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
DEMO!
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Anatomy of a Lambda function
Handler() function
Function to be executed
upon invocation
Event object
Data sent during
Lambda function
Invocation
Context object
Methods available to
interact with runtime
information (request ID,
log group, more)
public String handleRequest(Book book, Context context) {
saveBook(book);
return book.getName() + " saved!";
}
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Introducing: AWS Lambda runtime API and layers
Features that allow developers to share, discover, and deploy both libraries and
languages as part of their serverless applications
Runtime API enables
developers to use
Lambda with any
programming language.
Layers let functions
easily share code.
Upload layer once,
reference within any
function.
Layers promote
separation of
responsibilities, lets
developers focus on
writing business logic.
Combined, runtime API
and layers allow
developers to share any
programming language
or language version with
others
NEW!
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Fine-grained pricing
Buy compute time in 100ms
increments
Low request charge
No hourly, daily, or monthly
minimums
No per-device fees
Never pay for idle
Free Tier
1M requests and 400,000 GBs of compute.
Every month, every customer.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Tweak your function’s computer power
Lambda exposes only a memory control, with the % of CPU
core and network capacity allocated to a function
proportionally
Is your code CPU, Network or memory-bound? If so, it could be cheaper
to choose more memory.
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Smart resource allocation
Match resource allocation (up to 3 GB!) to logic
Stats for Lambda function that calculates 1000 times all prime numbers
<= 1000000
128 MB 11.722965sec $0.024628
256 MB 6.678945sec $0.028035
512 MB 3.194954sec $0.026830
1024 MB 1.465984sec $0.024638
Green==Best Red==Worst
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Smart resource allocation
Match resource allocation (up to 3 GB!) to logic
Stats for Lambda function that calculates 1000 times all prime numbers
<= 1000000
128 MB 11.722965sec $0.024628
256 MB 6.678945sec $0.028035
512 MB 3.194954sec $0.026830
1024 MB 1.465984sec $0.024638
Green==Best Red==Worst
+$0.00001-10.256981sec
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Lambda execution model
Synchronous
(push)
Amazon
API Gateway
AWS Lambda
function
/order
Asynchronous
(event)
Amazon
SNS
AWS Lambda
function
Amazon
S3
reqs
Poll-based
Amazon
DynamoDB
Amazon
Kinesis
changes
AWS Lambda
service
function
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Lambda API
1. Lambda directly invoked
via invoke API
SDK clients
Lambda
function
API provided by the Lambda service
Used by all other services that
invoke Lambda across all models
Supports sync and async
Can pass any event payload
structure you want
Client included in every SDK
Lambda permissions model
Fine grained security controls for both
execution and invocation:
• Execution policies:
• Define what AWS resources/API calls can this
function access via IAM
• Used in streaming invocations
• E.g. “Lambda function A can read from
DynamoDB table users”
• Function policies:
• Used for sync and async invocations
• E.g. “Actions on bucket X can invoke Lambda
function Z"
• Resource policies allow for cross account
access
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Common Lambda use cases
Web
Applications
• Static websites
• Complex web
apps
• Packages for
Flask and
Express
Data
Processing
• Real time
• MapReduce
• Batch
Chatbots
• Powering
chatbot logic
Backends
• Apps & services
• Mobile
• IoT
</></>
Amazon Alexa
• Powering
voice-enabled
apps
• Alexa Skills Kit
IT
Automation
• Policy engines
• Extending
AWS services
• Infrastructure
management
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Amazon API Gateway
Create a unified
API frontend for
multiple micro-
services
Authenticate and
authorize
requests to a
backend
DDoS protection
and throttling for
your backend
Throttle, meter,
and monetize API
usage by third-
party developers
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Amazon API Gateway
Internet
Mobile apps
Websites
Services
AWS Lambda
functions
AWS
API Gateway
Cache
Endpoints on
Amazon EC2
Amazon
CloudWatch
monitoring
Amazon
CloudFront
Any other
AWS service
YOUR VPC
Endpoints in
Your VPC
Regional API endpoints
All publicly
accessible endpoints
AWS Lambda
functions
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Introducing: API Gateway WebSockets
Invoke AWS services
like Lambda, Kinesis, or any
HTTP endpoint based on
message content
Build real-time two-way
communication applications
chat, alerts and notifications,
and streaming dashboards
Fully managed APIs
to handle connections and
messages transfer between
users and backend services
Pay for what you use
based on connection minutes
and messages transferred
Stateful connection Stateless connection
Amazon API Gateway
WebSockets API
Public
endpoints on
Amazon EC2
Lambda
functions
Any other
AWS service
All publicly
accessible
endpoints
Amazon
Kinesis
Mobile apps
Chat
AWS IoT
devices
Dashboards
Coming
soon!
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Serverless web application with API Gateway
API Gateway handles all your
application routing. It can
handle authentication and
authorization, throttling,
DDOS protection, and more.
Amazon S3
API Gateway
Lambda runs all the logic
behind your website and
interfaces with databases,
other backend services, or
anything else your site needs.
AWS Lambda
Amazon Simple Storage
Service (Amazon S3) stores all
of your static content: CSS,
JS, images, and more. You
would typically front this with
a CDN such as CloudFront.
Amazon
CloudFront
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Serverless architectures
S3
bucket
object
Lambda
function
1. File put into
bucket
2. Lambda invoked
Lambda
function
2. Lambda invoked
SNS
topic
1. Data published to a
topic
Data
1. Message inserted
into to a queue
message
Amazon
SQS
Lambda
function
3. Function
removes
message from
queue
2. Lambda polls
queue and
invokes function
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Serverless architectures
Lambda
function
2. Lambda polls
stream
Amazon
Kinesis
Data
Stream
1. Data published to a
stream
3. Amazon
Kinesis returns
stream data
Data
2. Lambda invoked
1. Chatbot
conversation needs
“fulfillment”
Lambda
function
Amazon
Lex
Chatbot
Lambda
function
1. Scheduled time
occurs
CloudWatch
Events
(time-based)
2. Lambda
invoked
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Keep orchestration out of code
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
AWS Step Functions
“Serverless” workflow management with
zero administration
• Makes it easy to coordinate the
components of distributed applications
and microservices using visual
workflows
• Automatically triggers and tracks each
step and retries when there are errors,
so your application executes in order
and as expected
• Logs the state of each step, so when
things do go wrong, you can diagnose
and debug problems quickly
Task
Choice
Failure capture
Parallel tasks
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Build PCI and HIPAA compliant serverless applications!
Serverless platform services that can be used in both:
AWS
Lambda
Amazon
S3
Amazon
CloudFront
Amazon
DynamoDB
Amazon
Kinesis
Data
Streams
Amazon
Cognito
Amazon API
Gateway
Amazon
SNS
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Where do you ...
https://secure.flickr.com/photos/stevendepolo/57491920?
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Start with a framework
AWS
Chalice
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Metrics and logging are a universal right!
• CloudWatch Metrics:
• 7 Built in metrics for Lambda
• Invocation Count, Invocation duration, Invocation
errors, Throttled Invocation, Iterator Age, DLQ
Errors, Concurrency
• Can call “put-metric-data” from your function code
for custom metrics
• 7 Built in metrics for API-Gateway
• API Calls Count, Latency, 4XXs, 5XXs, Integration
Latency, Cache Hit Count, Cache Miss Count
• Error and Cache metrics support averages and
percentiles
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Metrics and logging are a universal right!
• CloudWatch Logs:
• API Gateway Logging
• 2 Levels of logging, ERROR and INFO
• Optionally log method request/body content
• Set globally in stage, or override per method
• Lambda Logging
• Logging directly from your code with your language’s equivalent
of console.log()
• Basic request information included
• Log Pivots
• Build metrics based on log filters
• Jump to logs that generated metrics
• Export logs to AWS ElastiCache or S3
• Explore with Kibana or Athena/QuickSight
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
AWS X-Ray Integration with Serverless
• Lambda instruments incoming
requests for all supported
languages and can capture calls
made in code
• API Gateway inserts a tracing
header into HTTP calls as well
as reports data back to X-Ray
itself
var AWSXRay = require(‘aws-xray-sdk-core‘);
var AWS = AWSXRay.captureAWS(require(‘aws-sdk’));
S3Client = AWS.S3();
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
X-Ray Trace Example
DEMO!
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
aws.amazon.com/serverless
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
Chris Munns
munns@amazon.com
@chrismunnshttps://www.flickr.com/photos/theredproject/3302110152/
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
?
https://secure.flickr.com/photos/dullhunk/202872717/

Más contenido relacionado

La actualidad más candente

AWS Lambda use cases and best practices - Builders Day Israel
AWS Lambda use cases and best practices - Builders Day IsraelAWS Lambda use cases and best practices - Builders Day Israel
AWS Lambda use cases and best practices - Builders Day IsraelAmazon Web Services
 
Building a fully serverless application on AWS | AWS Summit Tel Aviv 2019
Building a fully serverless application on AWS | AWS Summit Tel Aviv 2019Building a fully serverless application on AWS | AWS Summit Tel Aviv 2019
Building a fully serverless application on AWS | AWS Summit Tel Aviv 2019AWS Summits
 
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019AWS Summits
 
Immersion Day - Well Architected Workshop - June 2019
Immersion Day - Well Architected Workshop - June 2019Immersion Day - Well Architected Workshop - June 2019
Immersion Day - Well Architected Workshop - June 2019Amazon Web Services
 
All the Ops you need to know to Dev Serverless
All the Ops you need to know to Dev ServerlessAll the Ops you need to know to Dev Serverless
All the Ops you need to know to Dev ServerlessChris Munns
 
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019AWS Summits
 
利用 AWS Step Functions 建構穩定的資料處理流程.pdf
利用 AWS Step Functions 建構穩定的資料處理流程.pdf利用 AWS Step Functions 建構穩定的資料處理流程.pdf
利用 AWS Step Functions 建構穩定的資料處理流程.pdfAmazon Web Services
 
AWS Multi-Account Architecture and Best Practices
AWS Multi-Account Architecture and Best PracticesAWS Multi-Account Architecture and Best Practices
AWS Multi-Account Architecture and Best PracticesAmazon Web Services
 
Building serverless applications with Amazon S3
Building serverless applications with Amazon S3Building serverless applications with Amazon S3
Building serverless applications with Amazon S3Chris Munns
 
Stages of Adoption leading to Complete Migration
Stages of Adoption leading to Complete Migration	Stages of Adoption leading to Complete Migration
Stages of Adoption leading to Complete Migration Amazon Web Services
 
Machine Learning: From Notebook to Production with Amazon Sagemaker
Machine Learning: From Notebook to Production with Amazon SagemakerMachine Learning: From Notebook to Production with Amazon Sagemaker
Machine Learning: From Notebook to Production with Amazon SagemakerAmazon Web Services
 
Breaking the Monolith Road to Containers
Breaking the Monolith Road to ContainersBreaking the Monolith Road to Containers
Breaking the Monolith Road to ContainersAmazon Web Services
 
Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
 Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019 Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019AWS Summits
 
Serverless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best PracticesServerless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best PracticesVladimir Simek
 
AWS Serverless Webinar- Unleash Innovation & Build Modern Application
AWS Serverless Webinar- Unleash Innovation & Build Modern ApplicationAWS Serverless Webinar- Unleash Innovation & Build Modern Application
AWS Serverless Webinar- Unleash Innovation & Build Modern ApplicationAmazon Web Services
 
A Practitioner Guide to Securing Your Cloud (Like an Expert)
A Practitioner Guide to Securing Your Cloud (Like an Expert)A Practitioner Guide to Securing Your Cloud (Like an Expert)
A Practitioner Guide to Securing Your Cloud (Like an Expert)Amazon Web Services
 
How to train and deploy your machine learning models with Amazon SageMaker
How to train and deploy your machine learning models with Amazon SageMakerHow to train and deploy your machine learning models with Amazon SageMaker
How to train and deploy your machine learning models with Amazon SageMakerAmazon Web Services
 
How a Major Australian University Brought Backup to the Cloud
 How a Major Australian University Brought Backup to the Cloud How a Major Australian University Brought Backup to the Cloud
How a Major Australian University Brought Backup to the CloudAmazon Web Services
 
Module 3: Building in the cloud - AWSome Day Online Conference 2019
Module 3: Building in the cloud - AWSome Day Online Conference 2019Module 3: Building in the cloud - AWSome Day Online Conference 2019
Module 3: Building in the cloud - AWSome Day Online Conference 2019Amazon Web Services
 

La actualidad más candente (20)

AWS Lambda use cases and best practices - Builders Day Israel
AWS Lambda use cases and best practices - Builders Day IsraelAWS Lambda use cases and best practices - Builders Day Israel
AWS Lambda use cases and best practices - Builders Day Israel
 
Building a fully serverless application on AWS | AWS Summit Tel Aviv 2019
Building a fully serverless application on AWS | AWS Summit Tel Aviv 2019Building a fully serverless application on AWS | AWS Summit Tel Aviv 2019
Building a fully serverless application on AWS | AWS Summit Tel Aviv 2019
 
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
 
Immersion Day - Well Architected Workshop - June 2019
Immersion Day - Well Architected Workshop - June 2019Immersion Day - Well Architected Workshop - June 2019
Immersion Day - Well Architected Workshop - June 2019
 
All the Ops you need to know to Dev Serverless
All the Ops you need to know to Dev ServerlessAll the Ops you need to know to Dev Serverless
All the Ops you need to know to Dev Serverless
 
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019Orchestrating containers on AWS  | AWS Summit Tel Aviv 2019
Orchestrating containers on AWS | AWS Summit Tel Aviv 2019
 
Breaking down the Monowhat
Breaking down the MonowhatBreaking down the Monowhat
Breaking down the Monowhat
 
利用 AWS Step Functions 建構穩定的資料處理流程.pdf
利用 AWS Step Functions 建構穩定的資料處理流程.pdf利用 AWS Step Functions 建構穩定的資料處理流程.pdf
利用 AWS Step Functions 建構穩定的資料處理流程.pdf
 
AWS Multi-Account Architecture and Best Practices
AWS Multi-Account Architecture and Best PracticesAWS Multi-Account Architecture and Best Practices
AWS Multi-Account Architecture and Best Practices
 
Building serverless applications with Amazon S3
Building serverless applications with Amazon S3Building serverless applications with Amazon S3
Building serverless applications with Amazon S3
 
Stages of Adoption leading to Complete Migration
Stages of Adoption leading to Complete Migration	Stages of Adoption leading to Complete Migration
Stages of Adoption leading to Complete Migration
 
Machine Learning: From Notebook to Production with Amazon Sagemaker
Machine Learning: From Notebook to Production with Amazon SagemakerMachine Learning: From Notebook to Production with Amazon Sagemaker
Machine Learning: From Notebook to Production with Amazon Sagemaker
 
Breaking the Monolith Road to Containers
Breaking the Monolith Road to ContainersBreaking the Monolith Road to Containers
Breaking the Monolith Road to Containers
 
Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
 Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019 Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
 
Serverless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best PracticesServerless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best Practices
 
AWS Serverless Webinar- Unleash Innovation & Build Modern Application
AWS Serverless Webinar- Unleash Innovation & Build Modern ApplicationAWS Serverless Webinar- Unleash Innovation & Build Modern Application
AWS Serverless Webinar- Unleash Innovation & Build Modern Application
 
A Practitioner Guide to Securing Your Cloud (Like an Expert)
A Practitioner Guide to Securing Your Cloud (Like an Expert)A Practitioner Guide to Securing Your Cloud (Like an Expert)
A Practitioner Guide to Securing Your Cloud (Like an Expert)
 
How to train and deploy your machine learning models with Amazon SageMaker
How to train and deploy your machine learning models with Amazon SageMakerHow to train and deploy your machine learning models with Amazon SageMaker
How to train and deploy your machine learning models with Amazon SageMaker
 
How a Major Australian University Brought Backup to the Cloud
 How a Major Australian University Brought Backup to the Cloud How a Major Australian University Brought Backup to the Cloud
How a Major Australian University Brought Backup to the Cloud
 
Module 3: Building in the cloud - AWSome Day Online Conference 2019
Module 3: Building in the cloud - AWSome Day Online Conference 2019Module 3: Building in the cloud - AWSome Day Online Conference 2019
Module 3: Building in the cloud - AWSome Day Online Conference 2019
 

Similar a Intro to AWS Lambda and Serverless Applications: re:Invent 2018 Recap at the AWS Loft - San Francisco

The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...Amazon Web Services
 
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...Amazon Web Services
 
Introduction to Serverless Computing - OOP Munich
 Introduction to Serverless Computing - OOP Munich Introduction to Serverless Computing - OOP Munich
Introduction to Serverless Computing - OOP MunichBoaz Ziniman
 
Thinking Asynchronously Full Vesion - Utah UG
Thinking Asynchronously Full Vesion - Utah UGThinking Asynchronously Full Vesion - Utah UG
Thinking Asynchronously Full Vesion - Utah UGEric Johnson
 
Modern Applications Development on AWS
Modern Applications Development on AWSModern Applications Development on AWS
Modern Applications Development on AWSBoaz Ziniman
 
Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...
Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...
Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...Amazon Web Services
 
Build Enterprise-Grade Serverless Apps - SRV315 - Atlanta AWS Summit
Build Enterprise-Grade Serverless Apps - SRV315 - Atlanta AWS SummitBuild Enterprise-Grade Serverless Apps - SRV315 - Atlanta AWS Summit
Build Enterprise-Grade Serverless Apps - SRV315 - Atlanta AWS SummitAmazon Web Services
 
Getting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless ComputingGetting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless ComputingAmazon Web Services
 
Building Serverless Microservices with AWS
Building Serverless Microservices with AWSBuilding Serverless Microservices with AWS
Building Serverless Microservices with AWSDonnie Prakoso
 
Serverless workshop with Amazon Web Services
Serverless workshop with Amazon Web ServicesServerless workshop with Amazon Web Services
Serverless workshop with Amazon Web ServicesTheFamily
 
The family - presentation on AWS Serverless
The family - presentation on AWS ServerlessThe family - presentation on AWS Serverless
The family - presentation on AWS ServerlessAlexandre Pinhel
 
Thinking Asynchronously - ServerlessDays Istanbul - Oct 3 2019
Thinking Asynchronously - ServerlessDays Istanbul - Oct 3 2019 Thinking Asynchronously - ServerlessDays Istanbul - Oct 3 2019
Thinking Asynchronously - ServerlessDays Istanbul - Oct 3 2019 Eric Johnson
 
Build and Deploy Serverless Applications with AWS SAM
Build and Deploy Serverless Applications with AWS SAM Build and Deploy Serverless Applications with AWS SAM
Build and Deploy Serverless Applications with AWS SAM Amazon Web Services
 
A Culture of Rapid Innovation with DevOps, Microservices, & Serverless - MAD2...
A Culture of Rapid Innovation with DevOps, Microservices, & Serverless - MAD2...A Culture of Rapid Innovation with DevOps, Microservices, & Serverless - MAD2...
A Culture of Rapid Innovation with DevOps, Microservices, & Serverless - MAD2...Amazon Web Services
 
Building Serverless Enterprise Applications - SRV315 - Anaheim AWS Summit
Building Serverless Enterprise Applications - SRV315 - Anaheim AWS SummitBuilding Serverless Enterprise Applications - SRV315 - Anaheim AWS Summit
Building Serverless Enterprise Applications - SRV315 - Anaheim AWS SummitAmazon Web Services
 
Build a Serverless Web Application
Build a Serverless Web ApplicationBuild a Serverless Web Application
Build a Serverless Web ApplicationAmazon Web Services
 
Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate...
Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate...Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate...
Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate...Amazon Web Services
 
Serverless applications with AWS
Serverless applications with AWSServerless applications with AWS
Serverless applications with AWSjavier ramirez
 
Building serverless enterprise applications - SRV315 - Toronto AWS Summit
Building serverless enterprise applications - SRV315 - Toronto AWS SummitBuilding serverless enterprise applications - SRV315 - Toronto AWS Summit
Building serverless enterprise applications - SRV315 - Toronto AWS SummitAmazon Web Services
 

Similar a Intro to AWS Lambda and Serverless Applications: re:Invent 2018 Recap at the AWS Loft - San Francisco (20)

The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
 
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech T...
 
Introduction to Serverless Computing - OOP Munich
 Introduction to Serverless Computing - OOP Munich Introduction to Serverless Computing - OOP Munich
Introduction to Serverless Computing - OOP Munich
 
Thinking Asynchronously Full Vesion - Utah UG
Thinking Asynchronously Full Vesion - Utah UGThinking Asynchronously Full Vesion - Utah UG
Thinking Asynchronously Full Vesion - Utah UG
 
Modern Applications Development on AWS
Modern Applications Development on AWSModern Applications Development on AWS
Modern Applications Development on AWS
 
Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...
Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...
Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...
 
Serverless Developer Experience
Serverless Developer ExperienceServerless Developer Experience
Serverless Developer Experience
 
Build Enterprise-Grade Serverless Apps - SRV315 - Atlanta AWS Summit
Build Enterprise-Grade Serverless Apps - SRV315 - Atlanta AWS SummitBuild Enterprise-Grade Serverless Apps - SRV315 - Atlanta AWS Summit
Build Enterprise-Grade Serverless Apps - SRV315 - Atlanta AWS Summit
 
Getting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless ComputingGetting Started with AWS Lambda Serverless Computing
Getting Started with AWS Lambda Serverless Computing
 
Building Serverless Microservices with AWS
Building Serverless Microservices with AWSBuilding Serverless Microservices with AWS
Building Serverless Microservices with AWS
 
Serverless workshop with Amazon Web Services
Serverless workshop with Amazon Web ServicesServerless workshop with Amazon Web Services
Serverless workshop with Amazon Web Services
 
The family - presentation on AWS Serverless
The family - presentation on AWS ServerlessThe family - presentation on AWS Serverless
The family - presentation on AWS Serverless
 
Thinking Asynchronously - ServerlessDays Istanbul - Oct 3 2019
Thinking Asynchronously - ServerlessDays Istanbul - Oct 3 2019 Thinking Asynchronously - ServerlessDays Istanbul - Oct 3 2019
Thinking Asynchronously - ServerlessDays Istanbul - Oct 3 2019
 
Build and Deploy Serverless Applications with AWS SAM
Build and Deploy Serverless Applications with AWS SAM Build and Deploy Serverless Applications with AWS SAM
Build and Deploy Serverless Applications with AWS SAM
 
A Culture of Rapid Innovation with DevOps, Microservices, & Serverless - MAD2...
A Culture of Rapid Innovation with DevOps, Microservices, & Serverless - MAD2...A Culture of Rapid Innovation with DevOps, Microservices, & Serverless - MAD2...
A Culture of Rapid Innovation with DevOps, Microservices, & Serverless - MAD2...
 
Building Serverless Enterprise Applications - SRV315 - Anaheim AWS Summit
Building Serverless Enterprise Applications - SRV315 - Anaheim AWS SummitBuilding Serverless Enterprise Applications - SRV315 - Anaheim AWS Summit
Building Serverless Enterprise Applications - SRV315 - Anaheim AWS Summit
 
Build a Serverless Web Application
Build a Serverless Web ApplicationBuild a Serverless Web Application
Build a Serverless Web Application
 
Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate...
Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate...Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate...
Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate...
 
Serverless applications with AWS
Serverless applications with AWSServerless applications with AWS
Serverless applications with AWS
 
Building serverless enterprise applications - SRV315 - Toronto AWS Summit
Building serverless enterprise applications - SRV315 - Toronto AWS SummitBuilding serverless enterprise applications - SRV315 - Toronto AWS Summit
Building serverless enterprise applications - SRV315 - Toronto AWS Summit
 

Más de Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Más de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Intro to AWS Lambda and Serverless Applications: re:Invent 2018 Recap at the AWS Loft - San Francisco

  • 1. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Pop-up Loft Introduction to AWS Lambda and Serverless Applications Chris Munns Principal Developer Advocate AWS Serverless
  • 2. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved About me: Chris Munns - munns@amazon.com, @chrismunns – Principal Developer Advocate - Serverless – New Yorker – Previously: • AWS Business Development Manager – DevOps, July ’15 - Feb ‘17 • AWS Solutions Architect Nov, 2011- Dec 2014 • Formerly on operations teams @Etsy and @Meetup • Little time at a hedge fund, Xerox and a few other startups – Rochester Institute of Technology: Applied Networking and Systems Administration ’05 – Internet infrastructure geek
  • 3. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved https://secure.flickr.com/photos/mgifford/4525333972 Why are we here today?
  • 4. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Serverless means …
  • 5. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Serverless means … No servers to provision or manage Scales with usage Pay for value Availability and fault tolerance built in
  • 6. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Serverless means:
  • 7. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Serverless means: Greater agility Less overhead Better focus Increased scale More flexibility Faster time to market
  • 8. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Today’s focus:
  • 9. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Event-driven compute Functions as a service Serverless FaaS
  • 10. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Lambda Handles
  • 11. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved AWS Lambda release history LambdaPreview Announcement re:Invent2014 ? *As of October 2018, does not include region launches 2015 2016 2017 2018
  • 12. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Serverless applications Services (anything)Event source Function
  • 13. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Serverless applications Services (anything) Changes in data state Requests to endpoints Changes in resource state Event source Function
  • 14. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Serverless applications Services (anything) Changes in data state Requests to endpoints Changes in resource state Event source Function Node.js Python Java C# Go Ruby Runtime APINEW!
  • 15. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved DEMO!
  • 16. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Anatomy of a Lambda function Handler() function Function to be executed upon invocation Event object Data sent during Lambda function Invocation Context object Methods available to interact with runtime information (request ID, log group, more) public String handleRequest(Book book, Context context) { saveBook(book); return book.getName() + " saved!"; }
  • 17. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Introducing: AWS Lambda runtime API and layers Features that allow developers to share, discover, and deploy both libraries and languages as part of their serverless applications Runtime API enables developers to use Lambda with any programming language. Layers let functions easily share code. Upload layer once, reference within any function. Layers promote separation of responsibilities, lets developers focus on writing business logic. Combined, runtime API and layers allow developers to share any programming language or language version with others NEW!
  • 18. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Fine-grained pricing Buy compute time in 100ms increments Low request charge No hourly, daily, or monthly minimums No per-device fees Never pay for idle Free Tier 1M requests and 400,000 GBs of compute. Every month, every customer.
  • 19. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Tweak your function’s computer power Lambda exposes only a memory control, with the % of CPU core and network capacity allocated to a function proportionally Is your code CPU, Network or memory-bound? If so, it could be cheaper to choose more memory.
  • 20. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Smart resource allocation Match resource allocation (up to 3 GB!) to logic Stats for Lambda function that calculates 1000 times all prime numbers <= 1000000 128 MB 11.722965sec $0.024628 256 MB 6.678945sec $0.028035 512 MB 3.194954sec $0.026830 1024 MB 1.465984sec $0.024638 Green==Best Red==Worst
  • 21. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Smart resource allocation Match resource allocation (up to 3 GB!) to logic Stats for Lambda function that calculates 1000 times all prime numbers <= 1000000 128 MB 11.722965sec $0.024628 256 MB 6.678945sec $0.028035 512 MB 3.194954sec $0.026830 1024 MB 1.465984sec $0.024638 Green==Best Red==Worst +$0.00001-10.256981sec
  • 22. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Lambda execution model Synchronous (push) Amazon API Gateway AWS Lambda function /order Asynchronous (event) Amazon SNS AWS Lambda function Amazon S3 reqs Poll-based Amazon DynamoDB Amazon Kinesis changes AWS Lambda service function
  • 23. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Lambda API 1. Lambda directly invoked via invoke API SDK clients Lambda function API provided by the Lambda service Used by all other services that invoke Lambda across all models Supports sync and async Can pass any event payload structure you want Client included in every SDK
  • 24. Lambda permissions model Fine grained security controls for both execution and invocation: • Execution policies: • Define what AWS resources/API calls can this function access via IAM • Used in streaming invocations • E.g. “Lambda function A can read from DynamoDB table users” • Function policies: • Used for sync and async invocations • E.g. “Actions on bucket X can invoke Lambda function Z" • Resource policies allow for cross account access
  • 25. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Common Lambda use cases Web Applications • Static websites • Complex web apps • Packages for Flask and Express Data Processing • Real time • MapReduce • Batch Chatbots • Powering chatbot logic Backends • Apps & services • Mobile • IoT </></> Amazon Alexa • Powering voice-enabled apps • Alexa Skills Kit IT Automation • Policy engines • Extending AWS services • Infrastructure management
  • 26. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Amazon API Gateway Create a unified API frontend for multiple micro- services Authenticate and authorize requests to a backend DDoS protection and throttling for your backend Throttle, meter, and monetize API usage by third- party developers
  • 27. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Amazon API Gateway Internet Mobile apps Websites Services AWS Lambda functions AWS API Gateway Cache Endpoints on Amazon EC2 Amazon CloudWatch monitoring Amazon CloudFront Any other AWS service YOUR VPC Endpoints in Your VPC Regional API endpoints All publicly accessible endpoints AWS Lambda functions
  • 28. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Introducing: API Gateway WebSockets Invoke AWS services like Lambda, Kinesis, or any HTTP endpoint based on message content Build real-time two-way communication applications chat, alerts and notifications, and streaming dashboards Fully managed APIs to handle connections and messages transfer between users and backend services Pay for what you use based on connection minutes and messages transferred Stateful connection Stateless connection Amazon API Gateway WebSockets API Public endpoints on Amazon EC2 Lambda functions Any other AWS service All publicly accessible endpoints Amazon Kinesis Mobile apps Chat AWS IoT devices Dashboards Coming soon!
  • 29. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Serverless web application with API Gateway API Gateway handles all your application routing. It can handle authentication and authorization, throttling, DDOS protection, and more. Amazon S3 API Gateway Lambda runs all the logic behind your website and interfaces with databases, other backend services, or anything else your site needs. AWS Lambda Amazon Simple Storage Service (Amazon S3) stores all of your static content: CSS, JS, images, and more. You would typically front this with a CDN such as CloudFront. Amazon CloudFront
  • 30. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Serverless architectures S3 bucket object Lambda function 1. File put into bucket 2. Lambda invoked Lambda function 2. Lambda invoked SNS topic 1. Data published to a topic Data 1. Message inserted into to a queue message Amazon SQS Lambda function 3. Function removes message from queue 2. Lambda polls queue and invokes function
  • 31. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Serverless architectures Lambda function 2. Lambda polls stream Amazon Kinesis Data Stream 1. Data published to a stream 3. Amazon Kinesis returns stream data Data 2. Lambda invoked 1. Chatbot conversation needs “fulfillment” Lambda function Amazon Lex Chatbot Lambda function 1. Scheduled time occurs CloudWatch Events (time-based) 2. Lambda invoked
  • 32. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Keep orchestration out of code
  • 33. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved AWS Step Functions “Serverless” workflow management with zero administration • Makes it easy to coordinate the components of distributed applications and microservices using visual workflows • Automatically triggers and tracks each step and retries when there are errors, so your application executes in order and as expected • Logs the state of each step, so when things do go wrong, you can diagnose and debug problems quickly Task Choice Failure capture Parallel tasks
  • 34. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Build PCI and HIPAA compliant serverless applications! Serverless platform services that can be used in both: AWS Lambda Amazon S3 Amazon CloudFront Amazon DynamoDB Amazon Kinesis Data Streams Amazon Cognito Amazon API Gateway Amazon SNS
  • 35. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Where do you ... https://secure.flickr.com/photos/stevendepolo/57491920?
  • 36. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Start with a framework AWS Chalice
  • 37. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved
  • 38. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Metrics and logging are a universal right! • CloudWatch Metrics: • 7 Built in metrics for Lambda • Invocation Count, Invocation duration, Invocation errors, Throttled Invocation, Iterator Age, DLQ Errors, Concurrency • Can call “put-metric-data” from your function code for custom metrics • 7 Built in metrics for API-Gateway • API Calls Count, Latency, 4XXs, 5XXs, Integration Latency, Cache Hit Count, Cache Miss Count • Error and Cache metrics support averages and percentiles
  • 39. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Metrics and logging are a universal right! • CloudWatch Logs: • API Gateway Logging • 2 Levels of logging, ERROR and INFO • Optionally log method request/body content • Set globally in stage, or override per method • Lambda Logging • Logging directly from your code with your language’s equivalent of console.log() • Basic request information included • Log Pivots • Build metrics based on log filters • Jump to logs that generated metrics • Export logs to AWS ElastiCache or S3 • Explore with Kibana or Athena/QuickSight
  • 40. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved AWS X-Ray Integration with Serverless • Lambda instruments incoming requests for all supported languages and can capture calls made in code • API Gateway inserts a tracing header into HTTP calls as well as reports data back to X-Ray itself var AWSXRay = require(‘aws-xray-sdk-core‘); var AWS = AWSXRay.captureAWS(require(‘aws-sdk’)); S3Client = AWS.S3();
  • 41. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved X-Ray Trace Example
  • 42. DEMO!
  • 43. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved aws.amazon.com/serverless
  • 44. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved Chris Munns munns@amazon.com @chrismunnshttps://www.flickr.com/photos/theredproject/3302110152/
  • 45. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved ? https://secure.flickr.com/photos/dullhunk/202872717/