Is AWS Lambda a Server-Side Component?

Before I answer this question, let’s understand about AWS compute services and that too Lambda in details.

1. AWS Compute Domain

Following are the main services in the compute domain –

1.1 EC2 

Most important is EC2 service, It’s like your Personal computer in which you are working remotely. You can install any OS which is supported by AWS and you can work on it as per your needs.

1.2 Elastic Beanstalk

Which is an automated version of EC2, where you will not have permissions to access OS but you will have control on configurations. Beanstalk used to deploy applications basically we upload the code and our application automatically get deployed on AWS infrastructure.

1.3 AWS Lambda

It is a server less compute service (an automated version of EC2 instance) that runs your code in response to events, where you don’t have to access any OS or even have to configure your server. Simply you just need to upload the code and it will be executed on the respective trigger.

2. Why AWS Lambda?

  1. Lambda is a compute service (where actual computation will AWS happen) which enables you to run your business logic without having to provision or manage any servers.
  2. Lambda code will run on top of AWS infrastructure, leaving developers worry-free from infrastructure management.
  3. AWS Lambda executes your code only when needed and scales automatically, from a few requests per day to thousands per second.
  4. AWS Lambda offers following features
  • High-availability compute infrastructure and manages the affairs of compute resources
  • Operating system maintenance
  • Capacity provisioning and automatic scaling, AWS Lambda will dynamically scale capacity in response to increased traffic. https://docs.aws.amazon.com/lambda/latest/dg/scaling.html
  • Code monitoring and logging.

3. When Should I Use AWS Lambda?

AWS Lambda is the platform with computational power which can be used in various application use cases. As of today, it is supporting the application development in the following languages:

  • Node.js
  • Java
  • Go
  • C#
  • Python

And runs within the AWS Lambda standard runtime environment.

When using AWS Lambda, you are responsible only for your code irrespective of the languages whether it is Java development or Python development or any other. AWS Lambda manages the compute resources that offers a perfect balance across different parameters like memory, CPU, network, etc. This is of course, in exchange to flexibility, meaning you cannot log in to AWS account and customize compute instances in terms of the operating system or language runtime.

4. Event Driven Model

AWS Lambda functions will be invoked against various preconfigured events, including events from AWS services such as:

  1. S3 (such as changes to S3 buckets)
  2. DynamoDB (such as updates to a table in the database)
  3. CodeCommit
  4. CloudWatch (such as as a response to an alarm)
  5. and AWS IoT
  6. This platform can also enable function calls based on following hooks
  • inbound messages (Kinesis, SNS)
  • incoming HTTP requests (API Gateway)
  • by a scheduled event

Here we can see one scenario where

  1. We will upload a CSV file to an S3 Bucket, which triggers a Lambda function.
  2. The Lambda function reads the CSV file and sums each line, which consists of comma separated numbers.
  3. SNS topic will publish the results and distribute to two subscribers
Event Driven Model

5. AWS Lambda Limits

AWS Lambda Resource Limits per Invocation (as taken from aws docs)

ResourceLimits
Memory allocation rangeMinimum = 128 MB / Maximum = 3008 MB (with 64 MB increments). If the maximum memory use is exceeded, function invocation will be terminated.
Ephemeral disk capacity (“/tmp” space)512 MB
Number of file descriptors1,024
Number of processes and threads (combined total)1,024
Maximum execution duration per request300 seconds (5 minutes)
Invoke request body payload size (RequestResponse/synchronous invocation) NOTE: The response body payload also must adhere to this limit.6 MB
Invoke request body payload size (Event/asynchronous invocation)128 KB

6. AWS Lambda Account Limits Per Region

ResourceDefault Limit
Concurrent executions (see Managing Concurrency)1000

7. Pricing

This is in my opinion, the biggest win. You pay only for the actual processing time you consume – when your code is sitting idle, your billing meter is down!

The Lambda free tier includes 1M free requests per month and 400,000 GB-seconds of compute time per month.

AWS Lambda Pricing
profile-image
Vishal Shah

Vishal Shah has an extensive understanding of multiple application development frameworks and holds an upper hand with newer trends in order to strive and thrive in the dynamic market. He has nurtured his managerial growth in both technical and business aspects and gives his expertise through his blog posts.

Related Service

Know more about Cloud and DevOps services

Learn more

Want to Hire Skilled Developers?


    Comments

    • Leave a message...