If you don’t know what serverless technology is, you’ve been living under a rock for the last year. Serverless-drive architecture in public cloud providers is not only the future, but the present for many cloud-native shops.
Let’s start with the basics
AWS Lambda is an Amazon web service, that works in conjunction with many other standard foundational services such as AWS EC2, AWS Ops works, and AWS Elastic Beanstalk etc. to provide event-driven computing. This is triggered by an event, which automatically prompts code execution. I have seen many companies bash scripts stating that running on-premise for a short amount of time would then kill the process, which is a perfect case for lambda. The lambda function can be executed for all sorts of items including policy-drive governance on services & IAM permissions.
Another common use case is for virtual assistants or chatbots as I have deployed at past large employers or many other IoT devices. Invoking a lambda function is done in many ways which I will go through later in this blog. You pay only for the compute time you consume & billing is done by 100 millisecond intervals. The best part about lambda is there is no charge when your code is not running.
Here is a list of terms that will help you understand AWS lambda:
A lambda function is a group of related statements that perform a specific task in your application. It consists of code and any dependencies that are associated with it. Each lambda function has its associated configuration information (name, description, entry point, and resource requirements).
The main benefit of using lambda functions is that as your application grows larger, it breaks your application into small modular chunks which makes it more organized and manageable in the long run.
What are event sources?
Along with lambda functions, event sources are the core components of AWS Lambda. Event source is an entity that publishes events, and a lambda function is a custom code that processes the events. An event source can be an AWS service or developer-created application that produces events that trigger a function to run. Check out AWS Lambda supported event sources here.
What’s an invocation?
Essentially, an invocation is called up to execute a specific lambda function. These are triggers for the code of the function to start running. Invocations can be either synchronous or asynchronous.
What’s event source mapping?
Event source mapping is a configuration of AWS services in which an event source is tied to a specific lambda function. It enables automatic invocation of a lambda function when specific events occur.
What’s a lambda execution model?
When you create a lambda function, you can specify configuration information, such as the amount of memory and maximum execution time that you allow for your function. When that function is invoked, AWS Lambda launches an Execution Context based on the configuration settings you have provided.
What are cold starts?
A cold start happens when a lambda function is invoked after not being used for an extended period of time and it results in increased invocation latency. Since this can potentially negatively affect the end-user experience with your application, this topic has been covered a lot lately.
One of the newest fun features is the Lambda@Edge capability, where one can run code at global AWS Locations in response to CloudFront events at these edges (CDN). Great example of this are request for content from origin servers, decreasing the latency to users by having these lambda functions cached at each edge.
Overall, AWS Lambda will provide a faster, more agile foundation for deploying code with the traditional server-based ecosystem.
Other helpful articles:
Great way to start your first lambda:
Features set for Lambda:
On my next topic, I will discuss CloudWatch-driven events.