Introduction

Today we will talk about AWS Lambda in 15 simple points.

AWS Lambda

  1. AWS Lambda is a simple server-less, compute service that runs your application code when triggered by an event (manual or automated).
  2. AWS Lambda deploys functions (known as lambda functions) which can run your code without having your worried about server configurations. AWS Lambda internally runs code on EC2 (micro-virtual machines). As a developer you don’t have to worry about CPU or memory configurations for a lambda function.
  3. Lambda has the maximum execution time of 15 mins. This means if you wish to run your application for a longer time for batch processing, making bulk upload or download, serving longer requests etc. which take longer than 15 mins, you will have to look for other compute options like EC2. [ref]
  4. Lambda has easy integration with various other AWS services. You can attach a lambda function to a DynamoDB stream where in your lambda code you can define the logic of performing required actions on the incoming DynamoDB stream records. For example – If you have a website where you store new user data in DynamoDB and you want to send an email to the new user. You can attach a lambda function to the DynamoDB stream. As soon as a user registers on your website, the user entry will be stored in the DynamoDB and the stream will trigger the attached lambda. The lambda will read the new user data and send an email using the data.
  5. When you create a lambda function and attach it to an event. In the distributed system, when the event occurs multiple places simultaneously, it will trigger different instances of your lambda function. It means if an event occurs twice at the same time, two different concurrent execution will be invoked.
  6. Maximum number of concurrent execution of AWS Lambda function is 1,000 per AWS account per region. Learn more about lambda concurrency here.
  7. Lambda function automatically provides monitoring capabilities like dashboard that tracks metrics like number of invocations, concurrency, failures, successful executions etc.
  8. You can secure your lambda by deploying it inside a private VPC.
  9. AWS Lambda supports Java, Go, PowerShell, Node.js, C#, Python, and Ruby code, and provides a Runtime API which allows you to use any additional programming languages to author your functions. [ref]
  10. As of now, DynamoDB cross-account trigger to AWS Lambda is not possible. It means that a DynamoDB stream can attach a lambda function only in its own AWS account. A DynamoDB stream cannot attach to a lambda function cross-account.
  11. There can be multiple trigger sources attached to the lambda. This means there can be multiple sources that can trigger same lambda function.
  12. You can define your own environment variables for a lambda function.
  13. You can attach a lambda function as a destination to another lambda function.
  14. Lambda also provides other services which can be added as destinations which includes – SQS, SNS, Lambda Function, EventBridge Event Bus. You can configure the lambda to send data to destination on failure or success.
  15. You can call the destination either asynchronously or on event source mapping. [ref]

See you in the next read.

Leave a Reply

Your email address will not be published. Required fields are marked *