
Originally posted on LinkedIn on: August 10, 2022
We all have heard (primarily if you work in the IT space) about AWS, GCP, Azure, and many more online tools that help developers and businesses, in general, accomplish their work; however, it gets scary for us who handle basic to intermediate technical knowledge to wrap our heads around the multitude of tools out there.
One of the tools that I would like to explore today is AWS Lambdas.
The first time I heard about this, I quickly related it to the lambdas you get when using, for example, Python but little did I know that this could be a much more powerful tool within the AWS ecosystem.
For more of a formal definition, we can say AWS Lambdas is a serverless computing tool that allows developers to run code responding to events such as new Amazon S3 objects, DynamoDB table updates, and even Amazon Kinesis records.
The services that AWS Lambda powers are very robust. We could say that AWS Lambda is an event-driven compute service that can execute code in response to various events. AWS Lambda allows you to run code just about anywhere, which means you can access it anywhere. You can run your code from mobile web browsers, desktop applications, and apps or connect it with other services via APIs.
But how exactly does AWS Lambdas work? In AWS Lambda, developers write code that is executed when an event occurs. For example, if you have a new object (i.e., someone clicks on a link or requests a file) in your application or service (i.e., Amazon S3 bucket) and you want to know when this happens, developers would write an AWS lambda function that checks the state of the object and invokes your code. The use could be way more complicated, but this gets to the simplicity we want in this blog.
So, instead of going back to the computer and checking the state of the application/service (i.e., Amazon S3 bucket) every time it changes, the engineer would use AWS Lambdas to do this. AWS Lambdas are highly scalable as well and can handle many events simultaneously.
Some of the uses for AWS Lambdas are:
- File processing where developers can upload files to S3 and have a lambda running on their behalf where this code is responsible for carrying out tasks such as converting files to other formats.
- E-mail processing where you can have a lambda execute a predefined series of tasks when an e-mail is received.
- Processing commands received over the internet. For example, Amazon Lex Bot can ping your lambda function when it receives a message from the user (via Amazon Lex). In turn, this function will respond with a corresponding text message.
- Stream processing where an engineer uses Lambda functions as a source of events or as a destination to process data.
- Generate a new AWS CloudFormation template that changes the structure of an AWS resource (i.e., Amazon S3 bucket).
- Generate alerts when detecting an anomaly in data flow related to your AWS account.
- Web Applications where developers can serve your AWS Lambda code via their web application.
- Integration with other AWS services via SNS, Kinesis, and SQS.
- Displaying information on a webpage (i.e., hundreds of events).
- IoT backends where developers would use AWS Lambda to listen for events coming from their AWS IoT device.
The number of uses for the AWS Lambdas is enormous, and it will only keep growing as more engineers come up with ideas on how to use this service. But, we have to remember that AWS Lambda is not a framework but a service. The engineer can’t just write lots of code and deploy it to an AWS Lambda function. This would be disastrous because it would cause a lot of instability.
AWS Lambdas are triggered by events and must be written in a manner to be highly responsive and run fast (by not being bulky). We have to think of AWS Lambdas as a small container that executes tasks rather than a full container.
It is a platform for building applications with high availability and auto-scaling. AWS Lambdas makes it easier for developers who want to write code without worrying about hosting and servers. Developers can use languages they want, like Node.js, Python, Java 8, Go, etc., to write and deploy code.
The platform provides a perfect solution for companies to build highly available applications with auto-scaling. It plays well with AWS services like Amazon Kinesis and Amazon DynamoDB (topics for another post).
The exciting thing about this service is that developers don’t have to worry about installing dependencies or setting up their servers. They write the code in the preferred language of choice and let AWS Lambdas take care of hosting, scaling, and keeping it online 24×7. All you have to do is create a function that can pass the test for the event, and it will execute immediately.
AWS Lambda service is a vast and complex topic to try to keep simple, but I hope I have made it easy for you to understand and relate it in a digestible non-technical way. If you are looking for more in-depth information, tons of videos and pages have been written, and I encourage you to look around and learn more. Take this as the steppingstone in your journey to understanding AWS Lambdas, and why not teach me more in the comments?
Disclaimer:
The views and opinions expressed in this blog are solely my own and are intended for educational and informational purposes only. They do not constitute legal, financial, or business advice. Readers are encouraged to seek independent professional advice before applying any ideas or suggestions discussed herein. Any reliance you place on the information provided is strictly at your own risk.
