AWS Lambda : The Ultimate Guide
AWS Lambda, launched in 2014, has become a popular service due to its unique value proposition for businesses. In the wake of its popularity and increasing adoption, we are writing a series of three articles that explains what Lambda is about, specific uses cases by which users can benefit and best practices by which you can effectively migrate workloads to AWS Lambda.
What is AWS Lambda
AWS Lambda is a serverless compute service which developers can use to build stateless applications, without worrying about underlying servers and scalability. AWS Lambda is designed to make it easy for developers to run code in the cloud and easily connect to AWS services. It responds to events and changes generated by user applications or other AWS Services such as an upload to Amazon S3 bucket or changes in an Amazon DynamoDB table.
Developers can use a language of their preference such as Node.JS, Python, Java and C #, .Net and only pay for the execution time of the code.
How It Works
You only have to write the code and upload it in an AWS Lambda function. You have to specify how much memory your function will require to run and maximum execution time you want to allow to your function to execute.
A Lambda container is launched when an event calls the lambda function. AWS Lambda takes care of resource provisioning when your lambda function is executed.
Benefits of AWS Lambda
The key benefit of AWS Lambda is that you never have to pay for idle time. Since the code execution is event-driven, the compute will start running only when an event is triggered and you are billed on the basis of memory usage, number of requests and execution duration.
Another significant advantage of using AWS Lambda is that you do not have to worry about operational and administration issues such as capacity provisioning, fleet-health monitoring, availability and scalability of underlying compute infrastructure as Lambda has built-in fault tolerance and auto-scaling.
AWS Lambda integrates well with other AWS services, so it can be used to automatically trigger other AWS services to call and enhance any application deployed on AWS.
AWS Lambda Use case scenarios
AWS Lambda can be used for a variety of applications including the following:
Use Lambda as a serverless backend for your mobile App: APIs are deployed as Lambda functions and accessed through AWS API Gateway. Lambda can process the application logic and transmit data to the RDS (or any other database or AWS Services) at the backend.
Processing of files (video, images etc.): You could use Lambda to trigger transcoding of videos and images appropriate for multiple devices and sizes.
Scheduled event: You can schedule backups of files, transactions, etc for compliance and audit purposes. You can also deploy a small piece of code in Lambda to check that all your EC2 instances are appropriately tagged.
Filtering Content between AWS services: You can use AWS Lambda can to transition data between AWS services such as S3 and Redshift and put a filter to transform and load data according to your guidelines.
Log Analysis on the Fly: For example you can use Lambda with CloudTrail to identify any change in security groups (e.g. a port is opened for public) and send notification to administrators if that change is not permitted.
Hope, this helps you to understand AWS Lambda at a broad level. We’ll come up with more detailed use cases of AWS Lambda in our subsequent articles.
Your feedback is most important for us. Please drop a line to firstname.lastname@example.org.