Movatterモバイル変換


[0]ホーム

URL:


Boaz Ziniman, profile picture
Uploaded byBoaz Ziniman
PDF, PPTX2,866 views

Serverless use cases with AWS Lambda

The document outlines the concept of serverless computing using AWS Lambda, highlighting its benefits such as no server management, built-in scaling, and cost efficiency. It presents Lambda use cases including web applications, stream processing, automation, and IoT, while also detailing best practices for optimization and lifecycle management. Additionally, it includes resources for further learning about AWS Lambda and serverless architecture.

Embed presentation

Download as PDF, PPTX
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.Boaz Ziniman, Technical Evangelist, AWS@zinimanServerless Use Cases with AWS LambdaIsraelCloud Meetup – October 2017
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.What does Serverless mean?No servers to provision ormanageScale with your usageBuilt in availability andfault-toleranceNever pay for idle/unusedcapacity
© 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 applicationsFUNCTION SERVICES (ANYTHING)Changes indata stateRequests toendpointsChanges inresource stateNodePythonJavaC#EVENT SOURCE
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.Example event sourcesData stores EndpointsConfiguration repositories Event/message sourcesAmazon S3 AmazonDynamoDBAmazonKinesisAmazonCognitoAmazon IoT AWS StepFunctionsAmazonAlexaAWSCloudTrailAWSCodeCommitAmazonCloudWatchAmazon SES Amazon SNS Cron eventsAmazonAPI GatewayAWSCloudformation…and more!
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.A few Lambda specific best practicesLambda is stateless à architect accordingly!• Assume no affinity with underlying compute infrastructure• Local filesystem and child processes may not extend beyondthe lifetime of the Lambda request
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.Lambda considerations and best practices• Can your Lambda functionssurvive the cold?• Instantiate AWS clients anddatabase clients outside the scopeof the handler to take advantageof connection re-use.• Schedule with CloudWatch Eventsfor warmth• ENIs for VPC support are attachedduring cold startimport sysimport loggingimport rds_configimport pymysqlrds_host = "rds-instance"db_name =rds_config.db_nametry:conn = pymysql.connect(except:logger.error("ERROR:def handler(event, context):with conn.cursor() as cur:Executes duringcold startExecutes witheach invocation
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.Lambda considerations and best practicesHow 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 applicationData stored inAmazonDynamoDBDynamic contentin AWS LambdaAmazon APIGatewayBrowserAmazonCloudFrontAmazonS3BrowserAmazonCloudFrontAmazonS3Amazon APIGatewayDynamic content inAWS LambdaData store in AmazonDynamoDB
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.Amazon APIGateway AWSLambdaAmazonDynamoDBAmazonS3AmazonCloudFront• Bucket Policies• ACLs• OAI• Geo-Restriction• Signed Cookies• Signed URLs• DDOSAuthZIAMServerless web app security• Throttling• Caching• Usage PlansBrowserIAM
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.Amazon APIGateway AWSLambdaAmazonDynamoDBAmazonS3AmazonCloudFront• Bucket Policies• ACLs• OAI• Geo-Restriction• Signed Cookies• Signed URLs• DDOSAuthZServerless web app security• Throttling• Caching• Usage PlansBrowserAmazonCloudFront• HTTPS• Disable HostHeader ForwardingAWS WAFIAMIAM
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.Amazon APIGatewayAWSLambdaAmazonDynamoDBAmazonS3AmazonCloudFront• Access Logs in S3Bucket• Access Logs in S3 Bucket• CloudWatch Metrics-https://aws.amazon.com/cloudfront/reporting/Serverless web app monitoringAWS WAF• WebACL Testing• Total Requests• Allowed/BlockedRequests by ACLlogslogs• Invocations• Invocation Errors• Duration• ThrottledInvocations• Latency• Throughput• Throttled Reqs• Latency• Count• Cache Hit/Miss• 4XX/5XX ErrorsStreamsAWSCloudTrailBrowserCustom CloudWatchMetrics & Alarms
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.Serverless web app lifecycle management• AWS SAM (Serverless Application Model) - blogAWSLambdaAmazon APIGatewayAWSCloudFormationAmazonS3AmazonDynamoDBPackage &DeployCode/Packages/SwaggerServerlessTemplateServerlessTemplatew/ CodeUripackage deployCI/CD Tools
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.http://bit.ly/ServerlessShophttps://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 toprocess)• Spiky traffic (lots of devices with intermittent networkconnections)• Message durability• Message ordering
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.DataGeneratorsAmazon Kinesis:StreamLambda:Stream ProcessorS3:Final Aggregated OutputLambda:Periodic Dump to S3CloudWatch Events:Trigger every 5 minutesS3:Intermediate AggregatedDataLambda:Scheduled DispatcherKPL:ProducerServerless stream processing architecture
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.DataGeneratorsFan-out pattern• Trade higher throughput & lower latency vs. strict message orderingAmazon Kinesis:StreamLambda:DispatcherKPL:Producer Lambda:ProcessorsIncrease 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 Route53Amazon CloudWatch Events:Rule TriggeredAmazon EC2 InstanceState ChangesAmazon DynamoDB:EC2 Instance PropertiesAmazon Route53:Private Hosted ZoneTag:CNAME = ‘xyz.example.com’xyz.example.com A 10.2.0.134Automation: dynamic DNS for EC2 instances
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.AWS Lambda:Resize ImagesUsers upload photosS3:Source BucketS3:Destination BucketTriggered onPUTsAutomation: image thumbnail creation from S3https://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 WebsiteMQTTAWSIoTStatic S3SiteReadSMSAmazonCloudFrontRead/Write
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.MQTTAWSIoTStatic S3SiteReadSMSAmazonCloudFrontRead/WriteIoT – Click to Website
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.IoT – Click to WebsiteMQTTAWSIoTStatic S3SiteReadSMSAmazonCloudFrontRead/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

Recommended

PPTX
AWS Cloud Formation
PDF
ACUG 12 Clouds - Cloud Formation
PDF
AWS Lambda: Advanced Coding Session
PDF
AWS User Group BiH @ Mostar
PDF
Cloud Academy & AWS: how we use Amazon Web Services for machine learning and ...
PDF
Building Serverless Machine Learning Models in the Cloud [PyData DC]
PDF
Serverless Machine Learning Workshop
PDF
How to deploy machine learning models in the Cloud
PPTX
Optimize your Machine Learning Workloads on AWS (July 2019)
PDF
AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)
PDF
Artem Zhurbila 5 aws - cloud formation and beanstalk
PDF
Building smart applications with AWS AI services (October 2019)
PDF
Picking the right AWS backend for your Java application
PPTX
Amazon Web Services for Application Hosting | SugarCon 2011
PDF
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
PPTX
AI in Java and Scala on AWS
PPTX
Scale Machine Learning from zero to millions of users (April 2020)
PDF
Batchly - Automated AWS Cost Reduction
 
PDF
20180113_cloudgirl_tominaga
PDF
Scalable Deep Learning on AWS with Apache MXNet
PDF
Scalable Deep Learning on AWS using Apache MXNet (May 2017)
PDF
Serverless use cases with AWS Lambda - More Serverless Event
PDF
Serverless on AWS: Architectural Patterns and Best Practices
PDF
Wildrydes Serverless Workshop Tel Aviv
PDF
Serverless applications with AWS
PDF
AWSomeDay Zurich 2018 - How to go serverless
PPTX
Getting started with Serverless on AWS
PPTX
Serverless Architectural Patterns
PDF
Serverless Architectural Patterns 
and Best Practices - Madhu Shekar - AWS
PDF
Introduction to Serverless Computing and AWS Lambda - AWS IL Meetup

More Related Content

PPTX
AWS Cloud Formation
PDF
ACUG 12 Clouds - Cloud Formation
PDF
AWS Lambda: Advanced Coding Session
PDF
AWS User Group BiH @ Mostar
PDF
Cloud Academy & AWS: how we use Amazon Web Services for machine learning and ...
PDF
Building Serverless Machine Learning Models in the Cloud [PyData DC]
PDF
Serverless Machine Learning Workshop
PDF
How to deploy machine learning models in the Cloud
AWS Cloud Formation
ACUG 12 Clouds - Cloud Formation
AWS Lambda: Advanced Coding Session
AWS User Group BiH @ Mostar
Cloud Academy & AWS: how we use Amazon Web Services for machine learning and ...
Building Serverless Machine Learning Models in the Cloud [PyData DC]
Serverless Machine Learning Workshop
How to deploy machine learning models in the Cloud

What's hot

PPTX
Optimize your Machine Learning Workloads on AWS (July 2019)
PDF
AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)
PDF
Artem Zhurbila 5 aws - cloud formation and beanstalk
PDF
Building smart applications with AWS AI services (October 2019)
PDF
Picking the right AWS backend for your Java application
PPTX
Amazon Web Services for Application Hosting | SugarCon 2011
PDF
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
PPTX
AI in Java and Scala on AWS
PPTX
Scale Machine Learning from zero to millions of users (April 2020)
PDF
Batchly - Automated AWS Cost Reduction
 
PDF
20180113_cloudgirl_tominaga
PDF
Scalable Deep Learning on AWS with Apache MXNet
PDF
Scalable Deep Learning on AWS using Apache MXNet (May 2017)
Optimize your Machine Learning Workloads on AWS (July 2019)
AWS ❤ SAM - Serverless on stage #9 (Milan, 20/02/2018)
Artem Zhurbila 5 aws - cloud formation and beanstalk
Building smart applications with AWS AI services (October 2019)
Picking the right AWS backend for your Java application
Amazon Web Services for Application Hosting | SugarCon 2011
Data Summer Conf 2018, “Build, train, and deploy machine learning models at s...
AI in Java and Scala on AWS
Scale Machine Learning from zero to millions of users (April 2020)
Batchly - Automated AWS Cost Reduction
 
20180113_cloudgirl_tominaga
Scalable Deep Learning on AWS with Apache MXNet
Scalable Deep Learning on AWS using Apache MXNet (May 2017)

Similar to Serverless use cases with AWS Lambda

PDF
Serverless use cases with AWS Lambda - More Serverless Event
PDF
Serverless on AWS: Architectural Patterns and Best Practices
PDF
Wildrydes Serverless Workshop Tel Aviv
PDF
Serverless applications with AWS
PDF
AWSomeDay Zurich 2018 - How to go serverless
PPTX
Getting started with Serverless on AWS
PPTX
Serverless Architectural Patterns
PDF
Serverless Architectural Patterns 
and Best Practices - Madhu Shekar - AWS
PDF
Introduction to Serverless Computing and AWS Lambda - AWS IL Meetup
PDF
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
PDF
Modern Applications Development on AWS
PPTX
Primeros pasos en desarrollo serverless
PPTX
Going Serverless at AWS Startup Day Bangalore
PPTX
Getting Started with Serverless Architectures
PDF
Introduction to Serverless
PDF
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
PDF
Serverless Architectural Patterns and Best Practices | AWS
PPTX
Serverless Architectural Patterns I AWS Dev Day 2018
PDF
Getting Started with Serverless Architectures
PDF
How serverless helps startups innovate and scale
Serverless use cases with AWS Lambda - More Serverless Event
Serverless on AWS: Architectural Patterns and Best Practices
Wildrydes Serverless Workshop Tel Aviv
Serverless applications with AWS
AWSomeDay Zurich 2018 - How to go serverless
Getting started with Serverless on AWS
Serverless Architectural Patterns
Serverless Architectural Patterns 
and Best Practices - Madhu Shekar - AWS
Introduction to Serverless Computing and AWS Lambda - AWS IL Meetup
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Development on AWS
Primeros pasos en desarrollo serverless
Going Serverless at AWS Startup Day Bangalore
Getting Started with Serverless Architectures
Introduction to Serverless
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Serverless Architectural Patterns and Best Practices | AWS
Serverless Architectural Patterns I AWS Dev Day 2018
Getting Started with Serverless Architectures
How serverless helps startups innovate and scale

More from Boaz Ziniman

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

Recently uploaded

PDF
Transforming Supply Chains with Amazon Bedrock AgentCore (AWS Swiss User Grou...
PDF
[BDD 2025 - Mobile Development] Exploring Apple’s On-Device FoundationModels
PDF
Cheryl Hung, Vibe Coding Auth Without Melting Down! isaqb Software Architectu...
PDF
[BDD 2025 - Artificial Intelligence] Building AI Systems That Users (and Comp...
PDF
How Much Does It Cost to Build an eCommerce Website in 2025.pdf
PDF
[DevFest Strasbourg 2025] - NodeJs Can do that !!
PDF
DUBAI IT MODERNIZATION WITH AZURE MANAGED SERVICES.pdf
PDF
Parallel Computing BCS702 Module notes of the vtu college 7th sem 4.pdf
PPTX
Guardrails in Action - Ensuring Safe AI with Azure AI Content Safety.pptx
PPTX
MuleSoft AI Series : Introduction to MCP
PPTX
The power of Slack and MuleSoft | Bangalore MuleSoft Meetup #60
PPTX
"Feelings versus facts: why metrics are more important than intuition", Igor ...
 
PPTX
Leon Brands - Intro to GPU Occlusion (Graphics Programming Conference 2024)
PDF
[BDD 2025 - Mobile Development] Crafting Immersive UI with E2E and AGSL Shade...
PDF
KMWorld - KM & AI Bring Collectivity, Nostalgia, & Selectivity
PPTX
Connecting the unconnectable: Exploring LoRaWAN for IoT
PDF
Transcript: The partnership effect: Libraries and publishers on collaborating...
PDF
The Necessity of Digital Forensics, the Digital Forensics Process & Laborator...
PDF
Cybersecurity Prevention and Detection: Unit 2
PDF
Crane Accident Prevention Guide: Key OSHA Regulations for Safer Operations
Transforming Supply Chains with Amazon Bedrock AgentCore (AWS Swiss User Grou...
[BDD 2025 - Mobile Development] Exploring Apple’s On-Device FoundationModels
Cheryl Hung, Vibe Coding Auth Without Melting Down! isaqb Software Architectu...
[BDD 2025 - Artificial Intelligence] Building AI Systems That Users (and Comp...
How Much Does It Cost to Build an eCommerce Website in 2025.pdf
[DevFest Strasbourg 2025] - NodeJs Can do that !!
DUBAI IT MODERNIZATION WITH AZURE MANAGED SERVICES.pdf
Parallel Computing BCS702 Module notes of the vtu college 7th sem 4.pdf
Guardrails in Action - Ensuring Safe AI with Azure AI Content Safety.pptx
MuleSoft AI Series : Introduction to MCP
The power of Slack and MuleSoft | Bangalore MuleSoft Meetup #60
"Feelings versus facts: why metrics are more important than intuition", Igor ...
 
Leon Brands - Intro to GPU Occlusion (Graphics Programming Conference 2024)
[BDD 2025 - Mobile Development] Crafting Immersive UI with E2E and AGSL Shade...
KMWorld - KM & AI Bring Collectivity, Nostalgia, & Selectivity
Connecting the unconnectable: Exploring LoRaWAN for IoT
Transcript: The partnership effect: Libraries and publishers on collaborating...
The Necessity of Digital Forensics, the Digital Forensics Process & Laborator...
Cybersecurity Prevention and Detection: Unit 2
Crane Accident Prevention Guide: Key OSHA Regulations for Safer Operations

Serverless use cases with AWS Lambda

  • 1.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.Boaz Ziniman, Technical Evangelist, AWS@zinimanServerless Use Cases with AWS LambdaIsraelCloud Meetup – October 2017
  • 2.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.What does Serverless mean?No servers to provision ormanageScale with your usageBuilt in availability andfault-toleranceNever pay for idle/unusedcapacity
  • 3.
    © 2017, AmazonWeb 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, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.Serverless applicationsFUNCTION SERVICES (ANYTHING)Changes indata stateRequests toendpointsChanges inresource stateNodePythonJavaC#EVENT SOURCE
  • 5.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.Example event sourcesData stores EndpointsConfiguration repositories Event/message sourcesAmazon S3 AmazonDynamoDBAmazonKinesisAmazonCognitoAmazon IoT AWS StepFunctionsAmazonAlexaAWSCloudTrailAWSCodeCommitAmazonCloudWatchAmazon SES Amazon SNS Cron eventsAmazonAPI GatewayAWSCloudformation…and more!
  • 6.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.A few Lambda specific best practicesLambda is stateless à architect accordingly!• Assume no affinity with underlying compute infrastructure• Local filesystem and child processes may not extend beyondthe lifetime of the Lambda request
  • 7.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.Lambda considerations and best practices• Can your Lambda functionssurvive the cold?• Instantiate AWS clients anddatabase clients outside the scopeof the handler to take advantageof connection re-use.• Schedule with CloudWatch Eventsfor warmth• ENIs for VPC support are attachedduring cold startimport sysimport loggingimport rds_configimport pymysqlrds_host = "rds-instance"db_name =rds_config.db_nametry:conn = pymysql.connect(except:logger.error("ERROR:def handler(event, context):with conn.cursor() as cur:Executes duringcold startExecutes witheach invocation
  • 8.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.Lambda considerations and best practicesHow 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, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.Lambda Use Cases
  • 10.
    © 2017, AmazonWeb 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, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.3-Tier web applicationData stored inAmazonDynamoDBDynamic contentin AWS LambdaAmazon APIGatewayBrowserAmazonCloudFrontAmazonS3BrowserAmazonCloudFrontAmazonS3Amazon APIGatewayDynamic content inAWS LambdaData store in AmazonDynamoDB
  • 12.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.Amazon APIGateway AWSLambdaAmazonDynamoDBAmazonS3AmazonCloudFront• Bucket Policies• ACLs• OAI• Geo-Restriction• Signed Cookies• Signed URLs• DDOSAuthZIAMServerless web app security• Throttling• Caching• Usage PlansBrowserIAM
  • 13.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.Amazon APIGateway AWSLambdaAmazonDynamoDBAmazonS3AmazonCloudFront• Bucket Policies• ACLs• OAI• Geo-Restriction• Signed Cookies• Signed URLs• DDOSAuthZServerless web app security• Throttling• Caching• Usage PlansBrowserAmazonCloudFront• HTTPS• Disable HostHeader ForwardingAWS WAFIAMIAM
  • 14.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.Amazon APIGatewayAWSLambdaAmazonDynamoDBAmazonS3AmazonCloudFront• Access Logs in S3Bucket• Access Logs in S3 Bucket• CloudWatch Metrics-https://aws.amazon.com/cloudfront/reporting/Serverless web app monitoringAWS WAF• WebACL Testing• Total Requests• Allowed/BlockedRequests by ACLlogslogs• Invocations• Invocation Errors• Duration• ThrottledInvocations• Latency• Throughput• Throttled Reqs• Latency• Count• Cache Hit/Miss• 4XX/5XX ErrorsStreamsAWSCloudTrailBrowserCustom CloudWatchMetrics & Alarms
  • 15.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.Serverless web app lifecycle management• AWS SAM (Serverless Application Model) - blogAWSLambdaAmazon APIGatewayAWSCloudFormationAmazonS3AmazonDynamoDBPackage &DeployCode/Packages/SwaggerServerlessTemplateServerlessTemplatew/ CodeUripackage deployCI/CD Tools
  • 16.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.http://bit.ly/ServerlessShophttps://github.com/patrick-michelberger/serverless-shop
  • 17.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.#2: stream processing
  • 18.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.Characteristics of stream processing• High ingest rate• Near real-time processing (low latency from ingest toprocess)• Spiky traffic (lots of devices with intermittent networkconnections)• Message durability• Message ordering
  • 19.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.DataGeneratorsAmazon Kinesis:StreamLambda:Stream ProcessorS3:Final Aggregated OutputLambda:Periodic Dump to S3CloudWatch Events:Trigger every 5 minutesS3:Intermediate AggregatedDataLambda:Scheduled DispatcherKPL:ProducerServerless stream processing architecture
  • 20.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.DataGeneratorsFan-out pattern• Trade higher throughput & lower latency vs. strict message orderingAmazon Kinesis:StreamLambda:DispatcherKPL:Producer Lambda:ProcessorsIncrease throughput, reduce processing latency
  • 21.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.#3: automation
  • 22.
    © 2017, AmazonWeb 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, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.AWS Lambda:Update Route53Amazon CloudWatch Events:Rule TriggeredAmazon EC2 InstanceState ChangesAmazon DynamoDB:EC2 Instance PropertiesAmazon Route53:Private Hosted ZoneTag:CNAME = ‘xyz.example.com’xyz.example.com A 10.2.0.134Automation: dynamic DNS for EC2 instances
  • 24.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.AWS Lambda:Resize ImagesUsers upload photosS3:Source BucketS3:Destination BucketTriggered onPUTsAutomation: image thumbnail creation from S3https://github.com/awslabs/serverless-image-resizing
  • 25.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.#4: IoT
  • 26.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.IoT – Click to WebsiteMQTTAWSIoTStatic S3SiteReadSMSAmazonCloudFrontRead/Write
  • 27.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.MQTTAWSIoTStatic S3SiteReadSMSAmazonCloudFrontRead/WriteIoT – Click to Website
  • 28.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.IoT – Click to WebsiteMQTTAWSIoTStatic S3SiteReadSMSAmazonCloudFrontRead/Write
  • 29.
    © 2017, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.http://bit.ly/OneClickIoT
  • 30.
    © 2017, AmazonWeb 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, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.Thanks!Boaz Ziniman, Technical Evangelist, AWS@ziniman

[8]ページ先頭

©2009-2025 Movatter.jp