AWS Lambda is Amazon’s serverless computing service, which allows customers to execute their code in response to events without managing the underlying compute infrastructure, such as provisioning and managing the servers. The service executes code only when needed and scales automatically.
AWS Lambda supports Java, Node.js, C#, and Python code. Lambda also allows use of any third party library.
AWS Lambda function
The code you run on Lamda is called a Lambda Function. Every Lambda function will carry associated configuration information such as name, description, entry point, and resource requirements.
The function has to be stateless, which means the code must be written with no affinity the underlying infrastructure. This allows Lambda to create as many copies of the function rapidly to meet the demand of incoming events.
AWS Lambda: What does it do
Runs code on high-availability compute infrastructure.
Takes care of all the compute resource administration such as server and Operating system maintenance, capacity provisioning, code and security patch deployment.
Built-in code monitoring and logging through Amazon CloudWatch
Automatic OS updates
AWS Lambda: Benefits
Lambda enjoys all the advantages and disadvantages that come with serverless computing.
Since the underlying infrastructure is managed by Amazon Web Service, IT teams using Lambda need not worry about provisioning and managing the servers. This moves the administrative tasks from internal teams to external (AWS ) teams, thus reducing labor hours, time to implementation and costs.
Lamda will automatically scale the application, to match the demand. Since you are only paying for the amount of time your code is running, it reduces overall infrastructure costs. Users pay for every 100ms their code executes and the number of times their code is triggered.
The service inherently has high fault tolerance as Lambda maintains compute capacity across multiple availability zones. This protects the code from going down due to an individual machine failure or a data center outage.
Real-time scaling of
AWS Lambda invokes your code only when needed and automatically scales to support the rate of incoming requests without requiring you to configure anything.
There is no limit to the number of requests your code can handle. AWS Lambda typically starts running your code within milliseconds of an event, and since Lambda scales automatically, the performance remains consistently high as the frequency of events increases.
Since your code is stateless, Lambda can start as many instances of it as needed without lengthy deployment and configuration delays.
Lambda@Edge, a feature of Amazon’s Content Delivery Network, Amazon CloudFront, allows users to execute Lambda functions in AWS locations closer to the viewer.
AWS Lambda Limits
Amazon limits the amount of compute and storage resources that is used to run and store functions. Customers can request AWS to increase these limits.
The following table shows the number of concurrent executions allowed for a function and storage
|Function and layer storage||75 GB|
The following table shows function configuration, deployments, and execution. These limits cannot be increased
|Function memory allocation||128 MB to 3008 MB, in 64 MB increments.|
|Function timeout||900 seconds (15 minutes)|
|Function environment variables||4 KB|
|Function resource-based policy||20 KB|
|Function layers||5 layers|
|Invocation payload (request and response)||6 MB (synchronous)256 KB (asynchronous)|
|Deployment package size||50 MB (zipped, for direct upload)250 MB (unzipped, including layers)3 MB (console editor)|
|Test events (console editor)||10|
AWS Lambda Service Level Agreement
AWS guarantees a Monthly Uptime Percentage of at least 99.95%. If Lambda does not meet the SLA, customers will be eligible for a service credit calculated as shown below.
|Monthly Uptime Percentage||Service Credit Percentage|
|Less than 99.95% but greater than or equal to 99%||10%|
|Less than 99%||25%|
For up to date SLA information please visit this page
AWS Lambda Pricing
AWS uses the pay as you go pricing model for Lambda. Users only pay for the resources they consume. Charges are based on the number of times you request your function and the amount of time it takes to execute the code.
Customers who want to try the service can use the free tier, which offers 1M free requests/month and 400,000 GB-seconds of compute time/month.
Once you exceed the free request limit, you will have to pay
$0.20 for every additional 1M requests. After you exceed the compute time limit, you will have to pay $0.00001667 for every additional GB-Second.
The fee tier does not automatically expire after 12 months as a lot of other free AWS services do. The memory size which you select for Lambda function will affect the duration you will be able to use the service.
|Memory (MB)||Free tier seconds per month||Price per 100ms ($)|
For up to date information please visit AWS Lambda Pricing Page here