KEMBAR78
AWS Serverless Computing Introduction Session 2.pptx
19CS3281S
CLOUD SERVERLESS COMPUTING
SESSION-2
Serverless Computing
IAAS
•APP
•CODE
•RUNTIME
•GUEST OS/VM1-
VM2
•HYPERVISOR
•HOST OS
CAAS
•APP
•CODE
•RUNTIME
•GUEST OS/VM1-
VM2
•CONTAINER
•HOST OS
SERVERLESS
•APP
•CODE
•RUNTIME
•GUEST OS/VM1-
VM2
•CONTAINER
•HOST OS
EC2, LIGHTSAIL
EKS, ECS,FARGATE
FAAS, LAMBDA,EVENDRIVEN
•-no maintanence
•Pay as you use
•High available
•Scalability
•Monitoring
•logging
Introduction to Lambda –
•AWS Lambda is a compute service that lets you run code without provisioning or
managing servers
• – AWS Lambda executes your code only when needed and scales automatically, from
a few requests per day to thousands per second
•- You pay only for the compute time you consume - there is no charge when your
code is not running
•- With AWS Lambda, you can run code for virtually any type of application or backend
service
• - all with zero administration
• - AWS Lambda runs your code on a high-availability compute infrastructure and
performs all of the administration of the compute resources, including server and
operating system maintenance, capacity provisioning and automatic scaling, code
monitoring and logging
•- All you need to do is supply your code in one of the languages that AWS Lambda
supports
•- You can use AWS Lambda to run your code in response to events, such as changes to
data in an Amazon S3 bucket or an Amazon DynamoDB table
When Should I Use AWS Lambda? –
•AWS Lambda is an ideal compute platform for many application scenarios, provided
that you can write your application code in languages supported by AWS Lambda,
and run within the AWS Lambda standard runtime environment and resources
provided by Lambda
•- When using AWS Lambda, you are responsible only for your code
• - AWS Lambda manages the compute fleet that offers a balance of memory, CPU,
network, and other resources
•- This is in exchange for flexibility, which means you cannot log in to compute
instances, or customize the operating system on provided runtimes
• - These constraints enable AWS Lambda to perform operational and administrative
activities on your behalf, including provisioning capacity, monitoring fleet health,
applying security patches, deploying your code, and monitoring and logging your
Lambda functions
•- Lambda is a highly available service
•- Languages supported by AWS Lambda are .NET, Go, Java, Node.js, Python, Ruby
•- If you need to manage your own compute resources, Amazon
Web Services also offers other compute services to meet your
needs
•- Amazon Elastic Compute Cloud (Amazon EC2) service offers
flexibility and a wide range of EC2 instance types to choose
from. It gives you the option to customize operating systems,
network and security settings, and the entire software stack,
but you are responsible for provisioning capacity, monitoring
fleet health and performance, and using Availability Zones for
fault tolerance
•- Elastic Beanstalk offers an easy-to-use service for deploying
and scaling applications onto Amazon EC2 in which you retain
ownership and full control over the underlying EC2 instances
AWS Lambda –Building Block
- Lambda Function : The foundation, it is comprised of your
custom code and any dependent libraries
-Event Source : An AWS service, such as Amazon SNS, that
triggers your function and executes its logic
-Downstream resources : An AWS service, such Dynamo DB
tables or Amazon S3 buckets, that your Lambda function calls
once it is triggered
-- Log Streams : While Lambda automatically monitors your
function invocations and reports metrics to CloudWatch
Event Source Mapping –
-In AWS Lambda, Lambda functions and event sources are the
core components
- An event source is the entity that publishes events, and a
Lambda function is the custom code that processes the events -
Supported event sources refer to those AWS services that can
be pre-configured to work with AWS Lambda
- The configuration is referred to as event source mapping
which maps an event source to a Lambda function
- AWS Lambda supports many AWS services as event sources -
When you configure these event sources to trigger a Lambda
function, the Lambda function is invoked automatically when
events occur
- Some of the supported AWS Event sources for Lambda
functions are - Amazon S3 - Amazon DynamoDB - Amazon
Simple Notification Service - Amazon SQS - Amazon Cloudwatch
Lambda Function Configuration
Compute resources that you need –
You only specify the amount of memory you want to allocate
for your Lambda function - AWS Lambda allocates CPU power
proportional to the memory - You can update the configuration
and request additional memory in 64 MB increments from 128
MB to 3008 MB - If the maximum memory use is exceeded,
function invocation will be terminated - Functions larger than
1536 MB are allocated multiple CPU threads, and multi-
threaded or multi-process code is needed to take advantage of
the additional performance
Maximum execution time (timeout) –
You pay for the AWS resources that are used to run your
Lambda function - To prevent your Lambda function from
running indefinitely, you specify a timeout - When the specified
time out is reached, AWS Lambda terminates your Lambda
function - Default is 3 seconds, maximum is 900 seconds
(15minutes)
Lambda@Edge –
-Lambda@Edge is a feature of Amazon CloudFront that lets you
run code closer to users of your application, which improves
performance and reduces latency
-Lambda@Edge runs your code in response to events
generated by the Amazon CloudFront content delivery network
(CDN)
-- With Lambda@Edge, you can enrich your web applications by
making them globally distributed and improving their
performance
-— all with zero server administration - you don't have to
provision or manage infrastructure in multiple locations around
the world - You pay only for the compute time you consume -
there is no charge when your code is not running
-- Just upload your code to AWS Lambda, which takes care of
everything required to run and scale your code with high
availability at an AWS location closest to your end user
Benefits –
-Build more responsive applications
- No servers to manage
- Customize your content delivery
Scenario - Real-time Image Transformation - You can customize
your users' experience by transforming images on the fly based
on the user characteristics - For example, you can resize images
based on the viewer's device type—mobile, desktop, or tablet -
You can also cache the transformed images at CloudFront Edge
locations to further improve performance when delivering
images
AWS Serverless Computing Introduction Session 2.pptx
AWS Serverless Computing Introduction Session 2.pptx
AWS Serverless Computing Introduction Session 2.pptx
AWS Serverless Computing Introduction Session 2.pptx
AWS Serverless Computing Introduction Session 2.pptx
AWS Serverless Computing Introduction Session 2.pptx
AWS Serverless Computing Introduction Session 2.pptx
AWS Serverless Computing Introduction Session 2.pptx
AWS Serverless Computing Introduction Session 2.pptx
AWS Serverless Computing Introduction Session 2.pptx
AWS Serverless Computing Introduction Session 2.pptx
AWS Serverless Computing Introduction Session 2.pptx
AWS Serverless Computing Introduction Session 2.pptx

AWS Serverless Computing Introduction Session 2.pptx

  • 1.
  • 2.
  • 5.
    IAAS •APP •CODE •RUNTIME •GUEST OS/VM1- VM2 •HYPERVISOR •HOST OS CAAS •APP •CODE •RUNTIME •GUESTOS/VM1- VM2 •CONTAINER •HOST OS SERVERLESS •APP •CODE •RUNTIME •GUEST OS/VM1- VM2 •CONTAINER •HOST OS EC2, LIGHTSAIL EKS, ECS,FARGATE FAAS, LAMBDA,EVENDRIVEN
  • 6.
    •-no maintanence •Pay asyou use •High available •Scalability •Monitoring •logging
  • 9.
    Introduction to Lambda– •AWS Lambda is a compute service that lets you run code without provisioning or managing servers • – AWS Lambda executes your code only when needed and scales automatically, from a few requests per day to thousands per second •- You pay only for the compute time you consume - there is no charge when your code is not running •- With AWS Lambda, you can run code for virtually any type of application or backend service • - all with zero administration • - AWS Lambda runs your code on a high-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging •- All you need to do is supply your code in one of the languages that AWS Lambda supports •- You can use AWS Lambda to run your code in response to events, such as changes to data in an Amazon S3 bucket or an Amazon DynamoDB table
  • 10.
    When Should IUse AWS Lambda? – •AWS Lambda is an ideal compute platform for many application scenarios, provided that you can write your application code in languages supported by AWS Lambda, and run within the AWS Lambda standard runtime environment and resources provided by Lambda •- When using AWS Lambda, you are responsible only for your code • - AWS Lambda manages the compute fleet that offers a balance of memory, CPU, network, and other resources •- This is in exchange for flexibility, which means you cannot log in to compute instances, or customize the operating system on provided runtimes • - These constraints enable AWS Lambda to perform operational and administrative activities on your behalf, including provisioning capacity, monitoring fleet health, applying security patches, deploying your code, and monitoring and logging your Lambda functions •- Lambda is a highly available service •- Languages supported by AWS Lambda are .NET, Go, Java, Node.js, Python, Ruby
  • 11.
    •- If youneed to manage your own compute resources, Amazon Web Services also offers other compute services to meet your needs •- Amazon Elastic Compute Cloud (Amazon EC2) service offers flexibility and a wide range of EC2 instance types to choose from. It gives you the option to customize operating systems, network and security settings, and the entire software stack, but you are responsible for provisioning capacity, monitoring fleet health and performance, and using Availability Zones for fault tolerance •- Elastic Beanstalk offers an easy-to-use service for deploying and scaling applications onto Amazon EC2 in which you retain ownership and full control over the underlying EC2 instances
  • 12.
    AWS Lambda –BuildingBlock - Lambda Function : The foundation, it is comprised of your custom code and any dependent libraries -Event Source : An AWS service, such as Amazon SNS, that triggers your function and executes its logic -Downstream resources : An AWS service, such Dynamo DB tables or Amazon S3 buckets, that your Lambda function calls once it is triggered -- Log Streams : While Lambda automatically monitors your function invocations and reports metrics to CloudWatch
  • 13.
    Event Source Mapping– -In AWS Lambda, Lambda functions and event sources are the core components - An event source is the entity that publishes events, and a Lambda function is the custom code that processes the events - Supported event sources refer to those AWS services that can be pre-configured to work with AWS Lambda - The configuration is referred to as event source mapping which maps an event source to a Lambda function - AWS Lambda supports many AWS services as event sources - When you configure these event sources to trigger a Lambda function, the Lambda function is invoked automatically when events occur - Some of the supported AWS Event sources for Lambda functions are - Amazon S3 - Amazon DynamoDB - Amazon Simple Notification Service - Amazon SQS - Amazon Cloudwatch
  • 14.
    Lambda Function Configuration Computeresources that you need – You only specify the amount of memory you want to allocate for your Lambda function - AWS Lambda allocates CPU power proportional to the memory - You can update the configuration and request additional memory in 64 MB increments from 128 MB to 3008 MB - If the maximum memory use is exceeded, function invocation will be terminated - Functions larger than 1536 MB are allocated multiple CPU threads, and multi- threaded or multi-process code is needed to take advantage of the additional performance Maximum execution time (timeout) – You pay for the AWS resources that are used to run your Lambda function - To prevent your Lambda function from running indefinitely, you specify a timeout - When the specified time out is reached, AWS Lambda terminates your Lambda function - Default is 3 seconds, maximum is 900 seconds (15minutes)
  • 15.
    Lambda@Edge – -Lambda@Edge isa feature of Amazon CloudFront that lets you run code closer to users of your application, which improves performance and reduces latency -Lambda@Edge runs your code in response to events generated by the Amazon CloudFront content delivery network (CDN) -- With Lambda@Edge, you can enrich your web applications by making them globally distributed and improving their performance -— all with zero server administration - you don't have to provision or manage infrastructure in multiple locations around the world - You pay only for the compute time you consume - there is no charge when your code is not running -- Just upload your code to AWS Lambda, which takes care of everything required to run and scale your code with high availability at an AWS location closest to your end user Benefits – -Build more responsive applications - No servers to manage - Customize your content delivery
  • 16.
    Scenario - Real-timeImage Transformation - You can customize your users' experience by transforming images on the fly based on the user characteristics - For example, you can resize images based on the viewer's device type—mobile, desktop, or tablet - You can also cache the transformed images at CloudFront Edge locations to further improve performance when delivering images