Day 9 of AWS essentials

Day 9 of AWS essentials

Serverless with AWS Lambda

AWS Lambda is one of the serverless compute options you have available to you on AWS. Lambda allows you to package and upload your code to the Lambda service, creating what is called a Lambda function. Once you create a Lambda function, it isn't always running all of the time. Instead, Lambda functions run in response to triggers. You can configure a trigger for when you want your function to run. And from there, the Lambda service waits for the trigger or polls for an event to trigger the function, depending on what the trigger is that you choose. There's a long list of available triggers for AWS Lambda, and new ones are being supported all of the time, so I won't run through them all now. However, a couple of common examples of triggers for Lambda functions are an HTTP request, an upload of a file to the storage service Amazon S3, events originating from other AWS services, or even in-app activity from mobile devices.

Serverless Function, FaaS Serverless - AWS Lambda - AWS

When the trigger is detected, the code is automatically run in a managed environment, an environment that you do not need to worry too much about because it is automatically scalable, highly available, and all of the maintenance of the environment itself is done by AWS. You do, however, get to choose the language your Lambda function is coded in, the amount of memory and CPU your function is allocated in the environment, permissions, dependencies, and many other aspects of how the function runs. If you have 1 or 1,000 incoming triggers, AWS Lambda will scale your function to meet demand, each in its own isolated environment. Lambda is currently designed to run code that has a runtime of under 15 minutes. So this isn't for long-running processes like deep learning or batch jobs. You wouldn't host something like a WordPress site on AWS Lambda. It's more suited for quick processing like a web backend handling request, or a backend report processing service, or microservice hosting. One of the best things about Lambda is that you aren't billed for code that isn't running. You only get billed for the resources that you use.

Running code on AWS Lambda

If you want to deploy your workloads and applications without having to manage any EC2 instances or containers, you can use Lambda.With Lambda, you can run code without provisioning or managing servers. You can run code for virtually any type of application or backend service. This includes data processing, real-time stream processing, machine learning, WebSockets, IoT backends, mobile backends, and web applications like your employee directory application!

Field Notes: Optimize your Java application for AWS Lambda with Quarkus |  AWS Architecture Blog

Lambda runs your code on a high availability compute infrastructure and requires no administration from the user. You upload your source code in one of the languages that Lambda supports, and Lambda takes care of everything required to run and scale your code with high availability. There are no servers to manage. You get continuous scaling with subsecond metering and consistent performance.