Aws
19 Jul 23

Using AWS Lambdas? 3 Important Considerations

AWS Lambda is one of the best serverless services out there and we have discussed some of its benefits in a previous article

This article is going to show you the three important things to consider before using AWS Lambda for your applications. You will gain a deeper understanding of the potential pitfalls of using Lambda so that you can avoid them. And who knows, a question like this might come up in your interview, and you will be prepared to answer it if it does.

What is AWS Lambda?

AWS Lambda is a serverless compute service designed to make it easy for developers to run their code without having to worry about managing servers.

Lambda can be used for different use cases such as data processing, web applications, mobile backend, etc. It can be integrated with Amazon S3 and DynamoDB to build robust and scalable applications.

Here are the three things to bear in mind when deploying your applications to Lambda.

Time outs

Time outs

Lambda can run your code for a set amount of time without timing out. 

The default time is 3 seconds but it can be adjusted to a maximum of 15 minutes.

When the specific time out is reached, AWS Lambda terminates the execution of your Lambda function.

The best way to protect against timeouts is to ensure that your application never needs to run for more than 15minutes. If your application runs for more than 15mins, then Lambda might not be the right choice for that application.

Cold Starts

A cold start issue is where a lambda takes a long time to start once it is triggered.

This usually occurs if the Lambda has not been used for a long time due to the underlying nature of how Lambdas work. The impact of cold starts is that it could cause application errors or delays due to the lambda not being ready for execution

To minimize cold starts, keep your function warm by invoking it periodically or configuring it to use provisioned concurrency. Provisioned concurrency initializes a requested number of execution environments so that they are prepared to respond immediately to your function's invocations.

Storage

Lambda storage is classified as ‘ephemeral’ or temporary storage. This means the data is stored only for as long as the application runs (temporary storage). AWS Lambda offers up to 10GB of file storage, which is limited and might be a factor if you want more storage capacity. To get more storage capacity, you can use Amazon Elastic File Storage (EFS), which easily integrates with Lambda.

You are now aware of three of the most important factors to consider before deploying any applications on AWS Lambda. Make sure you consider them before deploying any applications to Lambda.

Join our newsletter

Get actionable tips to break into the cloud industry. No spam, we promise.

To work on real world hands on projects with AWS Lambda and other AWS services, you can enroll in our program