Skip to content
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions

Simplified Learning Blog

Learning made easy

  • Java
    • Core Java Tutorial
    • Java 8
    • What is Rest API in java
    • Spring Framework
    • Type Casting in Java | 2 types Implicit and explicit casting
    • Spring Boot Tutorial
      • Spring Boot Rest API Example complete guide
    • Top 50 Java Interview Questions
    • JUnit 5 Tutorial
      • Assertall in JUnit 5
      • Assertions in JUnit 5
    • Java Thread Tutorials
      • How to create thread in Java
      • Multithreading in java
      • Daemon Thread in Java | How to create daemon thread in java
      • Top 40+ Multithreading interview questions
  • AWS
    • What is AWS (Amazon Web Services)
    • AWS IAM (Identity and Access Management)
    • AWS SNS | What is SNS
    • What is SQS | AWS SQS (Simple Queue Service)
    • What is AWS Lambda
    • Top 10 AWS Lambda interview questions
  • Java Codes
  • Software Architecture
    • Software Architecture Performance
    • Performance Principles of Software Architecture
    • System Performance Objective
  • Spring Boot Tutorial
  • Tools
    • JSON Formatter and Validator
  • Tech Blogs
    • Java 21 New Features
    • Is Java Dead? Is java dead, 2023 ?
    • New Features in Java 17
  • Toggle search form

What is AWS Lambda

Posted on February 15, 2023February 27, 2024 By Admin No Comments on What is AWS Lambda

What is AWS Lambda? It is a serverless compute service which runs seamlessly without the need/intervention of manually creating or configuring servers for it.

Table of Contents

Toggle
  • What is Serverless ?
  • What is AWS Lambda
  • What AWS Lambda Manages
  • Features of AWS Lambda
  • When to use AWS Lambda
  • How Lambda Works
    • Problem Statement:
    • Resolution
  • Use Cases:
  • AWS Lambda Runtimes
  • Limitations of AWS Lambda
  • AWS Lambda Java Code Example

What is Serverless ?

Serverless is a model where in we are not required to manage servers on our own. Basically, it allows developers to build and run an application without managing servers.

So who manages these servers ? The cloud provider like AWS, Google, Microsoft handles the rest, provisioning the cloud infrastructure required to run the code and scaling the infrastructure up and down on demand as needed.

Serverless does not mean ‘no servers’ : It means that servers are managed by cloud providers not be developers, that is the reasons it’s called serverless.

What is AWS Lambda

What is AWS Lambda is a serverless compute service that runs the code, and it responds to the events and automatically manages the compute resources that are required by the application. For example of events lets suppose on shopping sites like Flipkart, Amazon we place the items in carts or remove them, these are the events and lambda responds to it and runs the code that is required to perform the action.

With AWS Lambda, you can run any type of service or application without any type of administration (Administration means managed by AWS).

What AWS Lambda Manages

All the below is managed by AWS lambda itself:

  • Provisioning and capacity of compute resource required by the application like CPU, Memory, network, etc.
  • Server and OS maintenance. All backend servers and OS it manages.
  • High Availability and automatic scaling
  • Monitoring health of all the AWS Lambda function.
  • Security Patches and monitoring.
  • Code deployment
  • Monitoring application logs and performance.

Features of AWS Lambda

Some of the key features of lambda are :

No need to manage servers: AWS Automatically manages all the servers for you. Lambda runs your code on highly available, fault-tolerant infrastructure spread across multiple Availability Zones (AZ’s) in a single Region, seamlessly deploying code, and providing all the administration, maintenance, and patches of the infrastructure.

Lambda also provides built-in logging and monitoring, including integration with Amazon CloudWatch, CloudWatch Logs, and AWS Cloud Trail.

Scaling: AWS Lambda functions scales automatically as it responds to events and runs multiple events parallelly and process each event individually.

Increase Innovation: As most of the work behind the scenes is taken care by lambda itself, thus it allows you to focus on the work and innovating it.

Pay-as-use: It charges only for the milliseconds your code uses and number of times you run.

Deployment and logging: AWS Lambda automatically deploy your code and logs the events for you to use.

When to use AWS Lambda

Lambda is ideal in few scenarios like :

1. File Processing: We can use Amazon Simple Storage Service (Amazon S3) to trigger Lambda data processing in real time after an upload. We can use Amazon Simple Storage Service (Amazon S3) to trigger Lambda data processing in real time after an upload. Here, upload on S3 is an event we are using.

2. Steam Processing: We can use AWS Lambda and Kinesis to track real time stream of data processing like transaction’s data, activity monitoring, log filtering, indexing, social media analysis where we have stream of data and events on the same.

3. Web Applications: We can even use AWS lambda to work with other AWS service to build web applications.

4. Mobile Backends: Using Lambda and Amazon API Gateway to authenticate and process API requests. Use AWS Amplify to easily integrate your backend with your iOS, Android, Web, and React Native frontends.

Some of the other use cases when you can use lambda:

Automated Backups of everyday tasks can be done with the help of lambda, Scalable back ends (mobile apps, loT devices) for these we can use lambda like API executions, etc. Lambda helps you to execute server-side backend logic, allows you to filter and transform data when needed.

How Lambda Works

Let’s take a small example of file upload and the same file is displaying on mobile or tablet screens.

Problem Statement:

How to resize any of the images taken from high-end camera or downloaded (high quality image) from internet for display on mobile screen ?

Resolution

We are going to write one lambda which will take care of resizing of images and publish it.

See below,

what is AWS Lambda

Here, we are uploading images, photos to the S3 bucket storage and then on upload event the lambda function gets triggered which contains the code to run the image resizing logic and after processing it will be available to display on the mobile devices.

Use Cases:

Most common use cases of AWS Lambda

  • Process data at scale
  • Run interactive web and mobile backends
  • Enable powerful ML insights
  • Create event-driven applications

AWS Lambda Runtimes

Lambda runtimes are the runtime environments supported by AWS lambda. AWS lambda supports multiple languages and runtime for those languages.

The following runtimes are supported by AWS:

Node.jsVersions: 18,16,14,12
PYTHONPYTHON: 3.7, 3.8, 3.9
JAVAJAVA 8, 11
.NETdotnet5.0 and 6
Go 1.xgo1.x
Ruby2.7
AWS LAMBDA RUNTIMES

Please note that AWS has a runtime deprecation policy, and it keeps on updating their runtime support to the community.

Limitations of AWS Lambda

  • AWS Lambda’s concurrent execution is limited to 1000. Lambda allocates CPU power in proportion to the amount of memory configured. You can increase or decrease the memory and CPU power allocated to your function using the Memory (MB) setting. At 1,769 MB, a function has the equivalent of one vCPU.
  • Storage for uploaded functions (.zip file archives) and layers. Each function version and layer version consumes storage. Default of 75 GB
  • Its Function memory allocation: 128 MB to 10,240 MB, in 1-MB increments.
  • Function Timeout : 15 mins.
  • Function environment variables is 4 KB
  • Invocation payload (request and response) 6 MB each for request and response (synchronous)
  • 256 KB (asynchronous).
  • Deployment package (.zip file archive) size 50 MB (zipped, for direct upload) 250 MB (unzipped)
  • Execution processes/threads: 1,024
  • AWS Lambda functions are not suitable for long-running workloads as it has the limitation of execution time of 15 minutes. It limits concurrent function executions to 1,000.

AWS Lambda Java Code Example

import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;

public class AwsLambdaExampleSLB implements RequestHandler<String, String> {

    @Override
    public String handleRequest(String input, Context context) {
        String output = "Hello there " + input + "!";
        context.getLogger().log(output);
        return output;
    }
}

Checkout some of the common interview questions and answers on AWS Lambda

Related

AWS

Post navigation

Previous Post: Top 40+ Multithreading interview questions
Next Post: Top 10 AWS Lambda interview questions

More Related Articles

AWS SNS | What is SNS AWS
Top 10 AWS Lambda interview questions AWS
What is AWS (Amazon Web Services) AWS
AWS IAM (Identity and Access Management) AWS
What is SQS | AWS SQS (Simple Queue Service) AWS

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Top 50 Java Coding Interview Questions and Answers (2025 Updated)
  • Java Record Class Explained: Simple, Immutable Data Carriers
  • Java Convert int to String – 5+ Methods with Examples
  • String to Integer Conversion in Java | Java convert string to int
  • PDF to JSON Convertor

Recent Comments

No comments to show.

Copyright © 2025 Simplified Learning Blog.

Powered by PressBook Green WordPress theme