SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Boaz Ziniman, Technical Evangelist, AWS
@ziniman
Serverless Use Cases with AWS Lambda
IsraelCloud Meetup – October 2017
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What does Serverless mean?
No servers to provision or
manage
Scale with your usage
Built in availability and
fault-tolerance
Never pay for idle/unused
capacity
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless runs on functions
• Functions are the unit of deployment and scale
• This scales per request!
• Skip the boring parts, skip the hard parts
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless applications
FUNCTION SERVICES (ANYTHING)
Changes in
data state
Requests to
endpoints
Changes in
resource state
Node
Python
Java
C#
EVENT SOURCE
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Example event sources
Data stores Endpoints
Configuration repositories Event/message sources
Amazon S3 Amazon
DynamoDB
Amazon
Kinesis
Amazon
Cognito
Amazon IoT AWS Step
Functions
Amazon
Alexa
AWS
CloudTrail
AWS
CodeCommit
Amazon
CloudWatch
Amazon SES Amazon SNS Cron events
Amazon
API Gateway
AWS
Cloudformation
…and more!
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
A few Lambda specific best practices
Lambda is stateless à architect accordingly!
• Assume no affinity with underlying compute infrastructure
• Local filesystem and child processes may not extend beyond
the lifetime of the Lambda request
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda considerations and best practices
• Can your Lambda functions
survive the cold?
• Instantiate AWS clients and
database clients outside the scope
of the handler to take advantage
of connection re-use.
• Schedule with CloudWatch Events
for warmth
• ENIs for VPC support are attached
during cold start
import sys
import logging
import rds_config
import pymysql
rds_host = "rds-instance"
db_name =
rds_config.db_name
try:
conn = pymysql.connect(
except:
logger.error("ERROR:
def handler(event, context):
with conn.cursor() as cur:
Executes during
cold start
Executes with
each invocation
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda considerations and best practices
How about a file system?
• Don’t forget about /tmp
(512 MB of scratch space)
exports.ffmpeg = function(event,context)
{
new ffmpeg('./thumb.MP4', function (err,
video)
{
if (!err) {
video.fnExtractFrameToJPG('/tmp’)
function (error, files) { … }
…
if (!error)
console.log(files);
context.done();
...
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda Use Cases
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
#1: 3-Tier Web Application
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
3-Tier web application
Data stored in
Amazon
DynamoDB
Dynamic content
in AWS Lambda
Amazon API
Gateway
Browser
Amazon
CloudFront
Amazon
S3
Browser
Amazon
CloudFront
Amazon
S3
Amazon API
Gateway
Dynamic content in
AWS Lambda
Data store in Amazon
DynamoDB
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon API
Gateway AWS
Lambda
Amazon
DynamoDB
Amazon
S3
Amazon
CloudFront
• Bucket Policies
• ACLs
• OAI
• Geo-Restriction
• Signed Cookies
• Signed URLs
• DDOS
AuthZ
IAM
Serverless web app security
• Throttling
• Caching
• Usage Plans
Browser
IAM
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon API
Gateway AWS
Lambda
Amazon
DynamoDB
Amazon
S3
Amazon
CloudFront
• Bucket Policies
• ACLs
• OAI
• Geo-Restriction
• Signed Cookies
• Signed URLs
• DDOS
AuthZ
Serverless web app security
• Throttling
• Caching
• Usage Plans
Browser
Amazon
CloudFront
• HTTPS
• Disable Host
Header Forwarding
AWS WAF
IAMIAM
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon API
Gateway
AWS
Lambda
Amazon
DynamoDB
Amazon
S3
Amazon
CloudFront
• Access Logs in S3
Bucket• Access Logs in S3 Bucket
• CloudWatch Metrics-
https://aws.amazon.com/
cloudfront/reporting/
Serverless web app monitoring
AWS WAF
• WebACL Testing
• Total Requests
• Allowed/Blocked
Requests by ACL
logslogs
• Invocations
• Invocation Errors
• Duration
• Throttled
Invocations
• Latency
• Throughput
• Throttled Reqs
• Latency
• Count
• Cache Hit/Miss
• 4XX/5XX Errors
Streams
AWS
CloudTrail
Browser
Custom CloudWatch
Metrics & Alarms
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless web app lifecycle management
• AWS SAM (Serverless Application Model) - blog
AWS
Lambda
Amazon API
Gateway
AWS
CloudFormation
Amazon
S3
Amazon
DynamoDB
Package &
Deploy
Code/Packages/Swagger
Serverless
Template
Serverless
Template
w/ CodeUri
package deploy
CI/CD Tools
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
http://bit.ly/ServerlessShop
https://github.com/patrick-michelberger/serverless-shop
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
#2: stream processing
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Characteristics of stream processing
• High ingest rate
• Near real-time processing (low latency from ingest to
process)
• Spiky traffic (lots of devices with intermittent network
connections)
• Message durability
• Message ordering
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data
Generators
Amazon Kinesis:
Stream
Lambda:
Stream Processor
S3:
Final Aggregated Output
Lambda:
Periodic Dump to S3
CloudWatch Events:
Trigger every 5 minutes
S3:
Intermediate Aggregated
Data
Lambda:
Scheduled Dispatcher
KPL:
Producer
Serverless stream processing architecture
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data
Generators
Fan-out pattern
• Trade higher throughput & lower latency vs. strict message ordering
Amazon Kinesis:
Stream
Lambda:
Dispatcher
KPL:
Producer Lambda:
Processors
Increase throughput, reduce processing latency
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
#3: automation
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Automation characteristics
• Respond to alarms or events
• Periodic jobs
• Auditing and Notification
• Extend AWS functionality
• Highly Available and scalable
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Lambda:
Update Route53
Amazon CloudWatch Events:
Rule Triggered
Amazon EC2 Instance
State Changes
Amazon DynamoDB:
EC2 Instance Properties
Amazon Route53:
Private Hosted Zone
Tag:
CNAME = ‘xyz.example.com’
xyz.example.com A 10.2.0.134
Automation: dynamic DNS for EC2 instances
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Lambda:
Resize Images
Users upload photos
S3:
Source Bucket
S3:
Destination Bucket
Triggered on
PUTs
Automation: image thumbnail creation from S3
https://github.com/awslabs/serverless-image-resizing
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
#4: IoT
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IoT – Click to Website
MQTT
AWS
IoT
Static S3
Site
Read
SMS
Amazon
CloudFront
Read/
Write
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
MQTT
AWS
IoT
Static S3
Site
Read
SMS
Amazon
CloudFront
Read/
Write
IoT – Click to Website
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IoT – Click to Website
MQTT
AWS
IoT
Static S3
Site
Read
SMS
Amazon
CloudFront
Read/
Write
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
http://bit.ly/OneClickIoT
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Other resources
• AWS documentation:
http://docs.aws.amazon.com/lambda/latest/dg/welcome.html
• Tons of compute blog posts:
https://aws.amazon.com/blogs/compute/category/aws-lambda/
• Lambda reference architecture:
https://github.com/awslabs/lambda-refarch-webapp
• Hello Retail:
https://github.com/Nordstrom/hello-retail
• Serverless beyond Functions – Serverless using IoT:
https://medium.com/cloud-academy-inc/serverless-beyond-
functions-cd81ee4c6b8d
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thanks!
Boaz Ziniman, Technical Evangelist, AWS
@ziniman

Weitere ähnliche Inhalte

Was ist angesagt?

ACUG 12 Clouds - Cloud Formation
ACUG 12 Clouds - Cloud FormationACUG 12 Clouds - Cloud Formation
ACUG 12 Clouds - Cloud Formationjoehack3r
 
Scalable Deep Learning on AWS with Apache MXNet
Scalable Deep Learning on AWS with Apache MXNetScalable Deep Learning on AWS with Apache MXNet
Scalable Deep Learning on AWS with Apache MXNetJulien SIMON
 
Build text analytics solutions with AWS ML Services
Build text analytics solutions with AWS ML ServicesBuild text analytics solutions with AWS ML Services
Build text analytics solutions with AWS ML ServicesAmazon Web Services
 
Artem Zhurbila 5 aws - cloud formation and beanstalk
Artem Zhurbila 5 aws - cloud formation and beanstalkArtem Zhurbila 5 aws - cloud formation and beanstalk
Artem Zhurbila 5 aws - cloud formation and beanstalkArtem Zhurbila
 
AI in Java and Scala on AWS
AI in Java and Scala on AWSAI in Java and Scala on AWS
AI in Java and Scala on AWSJulien SIMON
 
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...Provectus
 
20180113_cloudgirl_tominaga
20180113_cloudgirl_tominaga20180113_cloudgirl_tominaga
20180113_cloudgirl_tominagaMaya Tominaga
 
Scale Machine Learning from zero to millions of users (April 2020)
Scale Machine Learning from zero to millions of users (April 2020)Scale Machine Learning from zero to millions of users (April 2020)
Scale Machine Learning from zero to millions of users (April 2020)Julien SIMON
 
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
 
Optimize your Machine Learning Workloads on AWS (July 2019)
Optimize your Machine Learning Workloads on AWS (July 2019)Optimize your Machine Learning Workloads on AWS (July 2019)
Optimize your Machine Learning Workloads on AWS (July 2019)Julien SIMON
 
Kate Werling - Build text analytics solutions with AWS ML Services (300) _BP.pdf
Kate Werling - Build text analytics solutions with AWS ML Services (300) _BP.pdfKate Werling - Build text analytics solutions with AWS ML Services (300) _BP.pdf
Kate Werling - Build text analytics solutions with AWS ML Services (300) _BP.pdfAmazon Web Services
 
Build Deep Learning Applications with TensorFlow & SageMaker
Build Deep Learning Applications with TensorFlow & SageMakerBuild Deep Learning Applications with TensorFlow & SageMaker
Build Deep Learning Applications with TensorFlow & SageMakerAmazon Web Services
 
Using Amazon SageMaker to build, train, & deploy your ML Models
Using Amazon SageMaker to build, train, & deploy your ML ModelsUsing Amazon SageMaker to build, train, & deploy your ML Models
Using Amazon SageMaker to build, train, & deploy your ML ModelsAmazon Web Services
 
Building smart applications with AWS AI services (October 2019)
Building smart applications with AWS AI services (October 2019)Building smart applications with AWS AI services (October 2019)
Building smart applications with AWS AI services (October 2019)Julien SIMON
 
Picking the right AWS backend for your Java application
Picking the right AWS backend for your Java applicationPicking the right AWS backend for your Java application
Picking the right AWS backend for your Java applicationJulien SIMON
 
Batchly - Automated AWS Cost Reduction
Batchly - Automated AWS Cost ReductionBatchly - Automated AWS Cost Reduction
Batchly - Automated AWS Cost ReductionCMPUTE
 
Scalable Deep Learning on AWS using Apache MXNet (May 2017)
Scalable Deep Learning on AWS using Apache MXNet (May 2017)Scalable Deep Learning on AWS using Apache MXNet (May 2017)
Scalable Deep Learning on AWS using Apache MXNet (May 2017)Julien SIMON
 
End to End Model Development to Deployment using SageMaker
End to End Model Development to Deployment using SageMakerEnd to End Model Development to Deployment using SageMaker
End to End Model Development to Deployment using SageMakerAmazon Web Services
 
Amazon Web Services for Application Hosting | SugarCon 2011
Amazon Web Services for Application Hosting | SugarCon 2011Amazon Web Services for Application Hosting | SugarCon 2011
Amazon Web Services for Application Hosting | SugarCon 2011SugarCRM
 
AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)
AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)
AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)Francesco Lerro
 

Was ist angesagt? (20)

ACUG 12 Clouds - Cloud Formation
ACUG 12 Clouds - Cloud FormationACUG 12 Clouds - Cloud Formation
ACUG 12 Clouds - Cloud Formation
 
Scalable Deep Learning on AWS with Apache MXNet
Scalable Deep Learning on AWS with Apache MXNetScalable Deep Learning on AWS with Apache MXNet
Scalable Deep Learning on AWS with Apache MXNet
 
Build text analytics solutions with AWS ML Services
Build text analytics solutions with AWS ML ServicesBuild text analytics solutions with AWS ML Services
Build text analytics solutions with AWS ML Services
 
Artem Zhurbila 5 aws - cloud formation and beanstalk
Artem Zhurbila 5 aws - cloud formation and beanstalkArtem Zhurbila 5 aws - cloud formation and beanstalk
Artem Zhurbila 5 aws - cloud formation and beanstalk
 
AI in Java and Scala on AWS
AI in Java and Scala on AWSAI in Java and Scala on AWS
AI in Java and Scala on AWS
 
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
 
20180113_cloudgirl_tominaga
20180113_cloudgirl_tominaga20180113_cloudgirl_tominaga
20180113_cloudgirl_tominaga
 
Scale Machine Learning from zero to millions of users (April 2020)
Scale Machine Learning from zero to millions of users (April 2020)Scale Machine Learning from zero to millions of users (April 2020)
Scale Machine Learning from zero to millions of users (April 2020)
 
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
 
Optimize your Machine Learning Workloads on AWS (July 2019)
Optimize your Machine Learning Workloads on AWS (July 2019)Optimize your Machine Learning Workloads on AWS (July 2019)
Optimize your Machine Learning Workloads on AWS (July 2019)
 
Kate Werling - Build text analytics solutions with AWS ML Services (300) _BP.pdf
Kate Werling - Build text analytics solutions with AWS ML Services (300) _BP.pdfKate Werling - Build text analytics solutions with AWS ML Services (300) _BP.pdf
Kate Werling - Build text analytics solutions with AWS ML Services (300) _BP.pdf
 
Build Deep Learning Applications with TensorFlow & SageMaker
Build Deep Learning Applications with TensorFlow & SageMakerBuild Deep Learning Applications with TensorFlow & SageMaker
Build Deep Learning Applications with TensorFlow & SageMaker
 
Using Amazon SageMaker to build, train, & deploy your ML Models
Using Amazon SageMaker to build, train, & deploy your ML ModelsUsing Amazon SageMaker to build, train, & deploy your ML Models
Using Amazon SageMaker to build, train, & deploy your ML Models
 
Building smart applications with AWS AI services (October 2019)
Building smart applications with AWS AI services (October 2019)Building smart applications with AWS AI services (October 2019)
Building smart applications with AWS AI services (October 2019)
 
Picking the right AWS backend for your Java application
Picking the right AWS backend for your Java applicationPicking the right AWS backend for your Java application
Picking the right AWS backend for your Java application
 
Batchly - Automated AWS Cost Reduction
Batchly - Automated AWS Cost ReductionBatchly - Automated AWS Cost Reduction
Batchly - Automated AWS Cost Reduction
 
Scalable Deep Learning on AWS using Apache MXNet (May 2017)
Scalable Deep Learning on AWS using Apache MXNet (May 2017)Scalable Deep Learning on AWS using Apache MXNet (May 2017)
Scalable Deep Learning on AWS using Apache MXNet (May 2017)
 
End to End Model Development to Deployment using SageMaker
End to End Model Development to Deployment using SageMakerEnd to End Model Development to Deployment using SageMaker
End to End Model Development to Deployment using SageMaker
 
Amazon Web Services for Application Hosting | SugarCon 2011
Amazon Web Services for Application Hosting | SugarCon 2011Amazon Web Services for Application Hosting | SugarCon 2011
Amazon Web Services for Application Hosting | SugarCon 2011
 
AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)
AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)
AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)
 

Ähnlich wie Serverless use cases with AWS Lambda

AWSomeDay Zurich 2018 - How to go serverless
AWSomeDay Zurich 2018 - How to go serverless AWSomeDay Zurich 2018 - How to go serverless
AWSomeDay Zurich 2018 - How to go serverless Roman Plessl
 
Getting started with Serverless on AWS
Getting started with Serverless on AWSGetting started with Serverless on AWS
Getting started with Serverless on AWSAdrian Hornsby
 
Serverless Developer Experience I AWS Dev Day 2018
Serverless Developer Experience I AWS Dev Day 2018Serverless Developer Experience I AWS Dev Day 2018
Serverless Developer Experience I AWS Dev Day 2018AWS Germany
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural PatternsAmazon Web Services
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural PatternsAdrian Hornsby
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep DiveAmazon Web Services
 
Serverless Architectural Patterns 
and Best Practices - Madhu Shekar - AWS
Serverless Architectural Patterns 
and Best Practices - Madhu Shekar - AWSServerless Architectural Patterns 
and Best Practices - Madhu Shekar - AWS
Serverless Architectural Patterns 
and Best Practices - Madhu Shekar - AWSCodeOps Technologies LLP
 
Genomics on aws-webinar-april2018
Genomics on aws-webinar-april2018Genomics on aws-webinar-april2018
Genomics on aws-webinar-april2018Brendan Bouffler
 
Serverless Architecture and Best Practices
Serverless Architecture and Best PracticesServerless Architecture and Best Practices
Serverless Architecture and Best PracticesAmazon Web Services
 
Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)Amazon Web Services
 
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017Amazon Web Services
 
LFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfLFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfAmazon Web Services
 
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
 
GPSTEC314-GPS From Monolithic to Serverless - Why and How to Move
GPSTEC314-GPS From Monolithic to Serverless - Why and How to MoveGPSTEC314-GPS From Monolithic to Serverless - Why and How to Move
GPSTEC314-GPS From Monolithic to Serverless - Why and How to MoveAmazon Web Services
 
Building Serverless Microservices with AWS
Building Serverless Microservices with AWSBuilding Serverless Microservices with AWS
Building Serverless Microservices with AWSDonnie Prakoso
 
Productionize Serverless Application Building and Deployments with AWS SAM - ...
Productionize Serverless Application Building and Deployments with AWS SAM - ...Productionize Serverless Application Building and Deployments with AWS SAM - ...
Productionize Serverless Application Building and Deployments with AWS SAM - ...Amazon Web Services
 
Serverless Architecture Patterns
Serverless Architecture PatternsServerless Architecture Patterns
Serverless Architecture PatternsAmazon Web Services
 
Serverless in Action on AWS
Serverless in Action on AWSServerless in Action on AWS
Serverless in Action on AWSAdrian Hornsby
 

Ähnlich wie Serverless use cases with AWS Lambda (20)

AWSomeDay Zurich 2018 - How to go serverless
AWSomeDay Zurich 2018 - How to go serverless AWSomeDay Zurich 2018 - How to go serverless
AWSomeDay Zurich 2018 - How to go serverless
 
Getting started with Serverless on AWS
Getting started with Serverless on AWSGetting started with Serverless on AWS
Getting started with Serverless on AWS
 
Serverless Developer Experience I AWS Dev Day 2018
Serverless Developer Experience I AWS Dev Day 2018Serverless Developer Experience I AWS Dev Day 2018
Serverless Developer Experience I AWS Dev Day 2018
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural Patterns
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural Patterns
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
 
Serverless Architectural Patterns 
and Best Practices - Madhu Shekar - AWS
Serverless Architectural Patterns 
and Best Practices - Madhu Shekar - AWSServerless Architectural Patterns 
and Best Practices - Madhu Shekar - AWS
Serverless Architectural Patterns 
and Best Practices - Madhu Shekar - AWS
 
Genomics on aws-webinar-april2018
Genomics on aws-webinar-april2018Genomics on aws-webinar-april2018
Genomics on aws-webinar-april2018
 
Serverless Architecture and Best Practices
Serverless Architecture and Best PracticesServerless Architecture and Best Practices
Serverless Architecture and Best Practices
 
Amazon ECS Deep Dive
Amazon ECS Deep DiveAmazon ECS Deep Dive
Amazon ECS Deep Dive
 
Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)Amazon Amazon Elastic Container Service (Amazon ECS)
Amazon Amazon Elastic Container Service (Amazon ECS)
 
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
High-Throughput Genomics on AWS - LFS309 - re:Invent 2017
 
LFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdfLFS309-High-Throughput Genomics on AWS.pdf
LFS309-High-Throughput Genomics on AWS.pdf
 
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
 
GPSTEC314-GPS From Monolithic to Serverless - Why and How to Move
GPSTEC314-GPS From Monolithic to Serverless - Why and How to MoveGPSTEC314-GPS From Monolithic to Serverless - Why and How to Move
GPSTEC314-GPS From Monolithic to Serverless - Why and How to Move
 
Building Serverless Microservices with AWS
Building Serverless Microservices with AWSBuilding Serverless Microservices with AWS
Building Serverless Microservices with AWS
 
Productionize Serverless Application Building and Deployments with AWS SAM - ...
Productionize Serverless Application Building and Deployments with AWS SAM - ...Productionize Serverless Application Building and Deployments with AWS SAM - ...
Productionize Serverless Application Building and Deployments with AWS SAM - ...
 
Serverless Architecture Patterns
Serverless Architecture PatternsServerless Architecture Patterns
Serverless Architecture Patterns
 
Serverless in Action on AWS
Serverless in Action on AWSServerless in Action on AWS
Serverless in Action on AWS
 

Mehr von Boaz Ziniman

AWS Cost Optimization - JLM
AWS Cost Optimization - JLMAWS Cost Optimization - JLM
AWS Cost Optimization - JLMBoaz Ziniman
 
What can you do with Serverless in 2020
What can you do with Serverless in 2020What can you do with Serverless in 2020
What can you do with Serverless in 2020Boaz Ziniman
 
Six ways to reduce your AWS bill
Six ways to reduce your AWS billSix ways to reduce your AWS bill
Six ways to reduce your AWS billBoaz Ziniman
 
From Cloud to Edge & back again
From Cloud to Edge & back againFrom Cloud to Edge & back again
From Cloud to Edge & back againBoaz Ziniman
 
Modern Applications Development on AWS
Modern Applications Development on AWSModern Applications Development on AWS
Modern Applications Development on AWSBoaz Ziniman
 
Enriching your app with Image recognition and AWS AI services Hebrew Webinar
Enriching your app with Image recognition and AWS AI services Hebrew WebinarEnriching your app with Image recognition and AWS AI services Hebrew Webinar
Enriching your app with Image recognition and AWS AI services Hebrew WebinarBoaz Ziniman
 
AI Services and Serverless Workshop
AI Services and Serverless WorkshopAI Services and Serverless Workshop
AI Services and Serverless WorkshopBoaz Ziniman
 
Drive Down the Cost of your Data Lake by Using the Right Data Tiering
Drive Down the Cost of your Data Lake by Using the Right Data TieringDrive Down the Cost of your Data Lake by Using the Right Data Tiering
Drive Down the Cost of your Data Lake by Using the Right Data TieringBoaz Ziniman
 
Breaking Voice and Language Barriers with AI - Chatbot Summit Tel Aviv
Breaking Voice and Language Barriers with AI - Chatbot Summit Tel AvivBreaking Voice and Language Barriers with AI - Chatbot Summit Tel Aviv
Breaking Voice and Language Barriers with AI - Chatbot Summit Tel AvivBoaz Ziniman
 
Serverless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLMServerless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLMBoaz Ziniman
 
Websites Go Serverless - ServerlessDays TLV 2019
Websites Go Serverless - ServerlessDays TLV 2019Websites Go Serverless - ServerlessDays TLV 2019
Websites Go Serverless - ServerlessDays TLV 2019Boaz Ziniman
 
SKL208 - Turbocharge your Business with AI and Machine Learning - Tel Aviv Su...
SKL208 - Turbocharge your Business with AI and Machine Learning - Tel Aviv Su...SKL208 - Turbocharge your Business with AI and Machine Learning - Tel Aviv Su...
SKL208 - Turbocharge your Business with AI and Machine Learning - Tel Aviv Su...Boaz Ziniman
 
AIM301 - Breaking Language Barriers With AI - Tel Aviv Summit 2019
AIM301 - Breaking Language Barriers With AI - Tel Aviv Summit 2019AIM301 - Breaking Language Barriers With AI - Tel Aviv Summit 2019
AIM301 - Breaking Language Barriers With AI - Tel Aviv Summit 2019Boaz Ziniman
 
Breaking Language Barriers with AI - AWS Summit
Breaking Language Barriers with AI - AWS SummitBreaking Language Barriers with AI - AWS Summit
Breaking Language Barriers with AI - AWS SummitBoaz Ziniman
 
Websites go Serverless - AWS Summit Berlin
Websites go Serverless - AWS Summit BerlinWebsites go Serverless - AWS Summit Berlin
Websites go Serverless - AWS Summit BerlinBoaz Ziniman
 
AWS Lambda updates from re:Invent
AWS Lambda updates from re:InventAWS Lambda updates from re:Invent
AWS Lambda updates from re:InventBoaz Ziniman
 
Artificial Intelligence for Developers - OOP Munich
Artificial Intelligence for Developers - OOP MunichArtificial Intelligence for Developers - OOP Munich
Artificial Intelligence for Developers - OOP MunichBoaz Ziniman
 
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
 
IoT from Cloud to Edge & Back Again - WebSummit 2018
IoT from Cloud to Edge & Back Again - WebSummit 2018IoT from Cloud to Edge & Back Again - WebSummit 2018
IoT from Cloud to Edge & Back Again - WebSummit 2018Boaz Ziniman
 
Breaking Language Barriers with AI - Web Summit 2018
Breaking Language Barriers with AI - Web Summit 2018Breaking Language Barriers with AI - Web Summit 2018
Breaking Language Barriers with AI - Web Summit 2018Boaz Ziniman
 

Mehr von Boaz Ziniman (20)

AWS Cost Optimization - JLM
AWS Cost Optimization - JLMAWS Cost Optimization - JLM
AWS Cost Optimization - JLM
 
What can you do with Serverless in 2020
What can you do with Serverless in 2020What can you do with Serverless in 2020
What can you do with Serverless in 2020
 
Six ways to reduce your AWS bill
Six ways to reduce your AWS billSix ways to reduce your AWS bill
Six ways to reduce your AWS bill
 
From Cloud to Edge & back again
From Cloud to Edge & back againFrom Cloud to Edge & back again
From Cloud to Edge & back again
 
Modern Applications Development on AWS
Modern Applications Development on AWSModern Applications Development on AWS
Modern Applications Development on AWS
 
Enriching your app with Image recognition and AWS AI services Hebrew Webinar
Enriching your app with Image recognition and AWS AI services Hebrew WebinarEnriching your app with Image recognition and AWS AI services Hebrew Webinar
Enriching your app with Image recognition and AWS AI services Hebrew Webinar
 
AI Services and Serverless Workshop
AI Services and Serverless WorkshopAI Services and Serverless Workshop
AI Services and Serverless Workshop
 
Drive Down the Cost of your Data Lake by Using the Right Data Tiering
Drive Down the Cost of your Data Lake by Using the Right Data TieringDrive Down the Cost of your Data Lake by Using the Right Data Tiering
Drive Down the Cost of your Data Lake by Using the Right Data Tiering
 
Breaking Voice and Language Barriers with AI - Chatbot Summit Tel Aviv
Breaking Voice and Language Barriers with AI - Chatbot Summit Tel AvivBreaking Voice and Language Barriers with AI - Chatbot Summit Tel Aviv
Breaking Voice and Language Barriers with AI - Chatbot Summit Tel Aviv
 
Serverless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLMServerless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLM
 
Websites Go Serverless - ServerlessDays TLV 2019
Websites Go Serverless - ServerlessDays TLV 2019Websites Go Serverless - ServerlessDays TLV 2019
Websites Go Serverless - ServerlessDays TLV 2019
 
SKL208 - Turbocharge your Business with AI and Machine Learning - Tel Aviv Su...
SKL208 - Turbocharge your Business with AI and Machine Learning - Tel Aviv Su...SKL208 - Turbocharge your Business with AI and Machine Learning - Tel Aviv Su...
SKL208 - Turbocharge your Business with AI and Machine Learning - Tel Aviv Su...
 
AIM301 - Breaking Language Barriers With AI - Tel Aviv Summit 2019
AIM301 - Breaking Language Barriers With AI - Tel Aviv Summit 2019AIM301 - Breaking Language Barriers With AI - Tel Aviv Summit 2019
AIM301 - Breaking Language Barriers With AI - Tel Aviv Summit 2019
 
Breaking Language Barriers with AI - AWS Summit
Breaking Language Barriers with AI - AWS SummitBreaking Language Barriers with AI - AWS Summit
Breaking Language Barriers with AI - AWS Summit
 
Websites go Serverless - AWS Summit Berlin
Websites go Serverless - AWS Summit BerlinWebsites go Serverless - AWS Summit Berlin
Websites go Serverless - AWS Summit Berlin
 
AWS Lambda updates from re:Invent
AWS Lambda updates from re:InventAWS Lambda updates from re:Invent
AWS Lambda updates from re:Invent
 
Artificial Intelligence for Developers - OOP Munich
Artificial Intelligence for Developers - OOP MunichArtificial Intelligence for Developers - OOP Munich
Artificial Intelligence for Developers - OOP Munich
 
Introduction to Serverless Computing - OOP Munich
 Introduction to Serverless Computing - OOP Munich Introduction to Serverless Computing - OOP Munich
Introduction to Serverless Computing - OOP Munich
 
IoT from Cloud to Edge & Back Again - WebSummit 2018
IoT from Cloud to Edge & Back Again - WebSummit 2018IoT from Cloud to Edge & Back Again - WebSummit 2018
IoT from Cloud to Edge & Back Again - WebSummit 2018
 
Breaking Language Barriers with AI - Web Summit 2018
Breaking Language Barriers with AI - Web Summit 2018Breaking Language Barriers with AI - Web Summit 2018
Breaking Language Barriers with AI - Web Summit 2018
 

Kürzlich hochgeladen

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Serverless use cases with AWS Lambda

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Boaz Ziniman, Technical Evangelist, AWS @ziniman Serverless Use Cases with AWS Lambda IsraelCloud Meetup – October 2017
  • 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What does Serverless mean? No servers to provision or manage Scale with your usage Built in availability and fault-tolerance Never pay for idle/unused capacity
  • 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Serverless runs on functions • Functions are the unit of deployment and scale • This scales per request! • Skip the boring parts, skip the hard parts
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Serverless applications FUNCTION SERVICES (ANYTHING) Changes in data state Requests to endpoints Changes in resource state Node Python Java C# EVENT SOURCE
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Example event sources Data stores Endpoints Configuration repositories Event/message sources Amazon S3 Amazon DynamoDB Amazon Kinesis Amazon Cognito Amazon IoT AWS Step Functions Amazon Alexa AWS CloudTrail AWS CodeCommit Amazon CloudWatch Amazon SES Amazon SNS Cron events Amazon API Gateway AWS Cloudformation …and more!
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. A few Lambda specific best practices Lambda is stateless à architect accordingly! • Assume no affinity with underlying compute infrastructure • Local filesystem and child processes may not extend beyond the lifetime of the Lambda request
  • 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lambda considerations and best practices • Can your Lambda functions survive the cold? • Instantiate AWS clients and database clients outside the scope of the handler to take advantage of connection re-use. • Schedule with CloudWatch Events for warmth • ENIs for VPC support are attached during cold start import sys import logging import rds_config import pymysql rds_host = "rds-instance" db_name = rds_config.db_name try: conn = pymysql.connect( except: logger.error("ERROR: def handler(event, context): with conn.cursor() as cur: Executes during cold start Executes with each invocation
  • 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lambda considerations and best practices How about a file system? • Don’t forget about /tmp (512 MB of scratch space) exports.ffmpeg = function(event,context) { new ffmpeg('./thumb.MP4', function (err, video) { if (!err) { video.fnExtractFrameToJPG('/tmp’) function (error, files) { … } … if (!error) console.log(files); context.done(); ...
  • 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lambda Use Cases
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. #1: 3-Tier Web Application
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 3-Tier web application Data stored in Amazon DynamoDB Dynamic content in AWS Lambda Amazon API Gateway Browser Amazon CloudFront Amazon S3 Browser Amazon CloudFront Amazon S3 Amazon API Gateway Dynamic content in AWS Lambda Data store in Amazon DynamoDB
  • 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon API Gateway AWS Lambda Amazon DynamoDB Amazon S3 Amazon CloudFront • Bucket Policies • ACLs • OAI • Geo-Restriction • Signed Cookies • Signed URLs • DDOS AuthZ IAM Serverless web app security • Throttling • Caching • Usage Plans Browser IAM
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon API Gateway AWS Lambda Amazon DynamoDB Amazon S3 Amazon CloudFront • Bucket Policies • ACLs • OAI • Geo-Restriction • Signed Cookies • Signed URLs • DDOS AuthZ Serverless web app security • Throttling • Caching • Usage Plans Browser Amazon CloudFront • HTTPS • Disable Host Header Forwarding AWS WAF IAMIAM
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon API Gateway AWS Lambda Amazon DynamoDB Amazon S3 Amazon CloudFront • Access Logs in S3 Bucket• Access Logs in S3 Bucket • CloudWatch Metrics- https://aws.amazon.com/ cloudfront/reporting/ Serverless web app monitoring AWS WAF • WebACL Testing • Total Requests • Allowed/Blocked Requests by ACL logslogs • Invocations • Invocation Errors • Duration • Throttled Invocations • Latency • Throughput • Throttled Reqs • Latency • Count • Cache Hit/Miss • 4XX/5XX Errors Streams AWS CloudTrail Browser Custom CloudWatch Metrics & Alarms
  • 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Serverless web app lifecycle management • AWS SAM (Serverless Application Model) - blog AWS Lambda Amazon API Gateway AWS CloudFormation Amazon S3 Amazon DynamoDB Package & Deploy Code/Packages/Swagger Serverless Template Serverless Template w/ CodeUri package deploy CI/CD Tools
  • 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. http://bit.ly/ServerlessShop https://github.com/patrick-michelberger/serverless-shop
  • 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. #2: stream processing
  • 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Characteristics of stream processing • High ingest rate • Near real-time processing (low latency from ingest to process) • Spiky traffic (lots of devices with intermittent network connections) • Message durability • Message ordering
  • 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Data Generators Amazon Kinesis: Stream Lambda: Stream Processor S3: Final Aggregated Output Lambda: Periodic Dump to S3 CloudWatch Events: Trigger every 5 minutes S3: Intermediate Aggregated Data Lambda: Scheduled Dispatcher KPL: Producer Serverless stream processing architecture
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Data Generators Fan-out pattern • Trade higher throughput & lower latency vs. strict message ordering Amazon Kinesis: Stream Lambda: Dispatcher KPL: Producer Lambda: Processors Increase throughput, reduce processing latency
  • 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. #3: automation
  • 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Automation characteristics • Respond to alarms or events • Periodic jobs • Auditing and Notification • Extend AWS functionality • Highly Available and scalable
  • 23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Lambda: Update Route53 Amazon CloudWatch Events: Rule Triggered Amazon EC2 Instance State Changes Amazon DynamoDB: EC2 Instance Properties Amazon Route53: Private Hosted Zone Tag: CNAME = ‘xyz.example.com’ xyz.example.com A 10.2.0.134 Automation: dynamic DNS for EC2 instances
  • 24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Lambda: Resize Images Users upload photos S3: Source Bucket S3: Destination Bucket Triggered on PUTs Automation: image thumbnail creation from S3 https://github.com/awslabs/serverless-image-resizing
  • 25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. #4: IoT
  • 26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. IoT – Click to Website MQTT AWS IoT Static S3 Site Read SMS Amazon CloudFront Read/ Write
  • 27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. MQTT AWS IoT Static S3 Site Read SMS Amazon CloudFront Read/ Write IoT – Click to Website
  • 28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. IoT – Click to Website MQTT AWS IoT Static S3 Site Read SMS Amazon CloudFront Read/ Write
  • 29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. http://bit.ly/OneClickIoT
  • 30. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Other resources • AWS documentation: http://docs.aws.amazon.com/lambda/latest/dg/welcome.html • Tons of compute blog posts: https://aws.amazon.com/blogs/compute/category/aws-lambda/ • Lambda reference architecture: https://github.com/awslabs/lambda-refarch-webapp • Hello Retail: https://github.com/Nordstrom/hello-retail • Serverless beyond Functions – Serverless using IoT: https://medium.com/cloud-academy-inc/serverless-beyond- functions-cd81ee4c6b8d
  • 31. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thanks! Boaz Ziniman, Technical Evangelist, AWS @ziniman