← Back to list

What is Serverless computing? Let’s understand the AWS Lambda.

In a typical software development lifecycle, a significant amount of effort goes into setting up the development environment even before…

Rajat Arora · 2026-01-09 15:18 · 1 claps · 7.7 min read
#aws-lambda #serverless #serverless-architecture #serverless-framework #aws
Open on Medium ↗
Wiki topics: 💻 · Programming ☁️ · DevOps & Cloud 🏛️ · Architecture

What is Serverless computing? Let’s understand the AWS Lambda.

In a typical software development lifecycle, a significant amount of effort goes into setting up the development environment even before application development begins. This process usually starts with preparing the operating system by installing the required OS packages and applying patches. For example, on Ubuntu systems this involves running commands like apt-get update and apt-get upgrade, while on Windows machines it requires installing regular system updates and ensuring the latest .NET Framework or kernel dependencies are in place. Once the OS is ready, the next step is to install the required runtime environments such as Java SDK, Python 3, or other language runtimes, followed by configuring system paths and environment variables. Additional tools like Git, build utilities, and application-specific libraries also need to be installed and validated to ensure everything works as expected.

Now, imagine performing all these steps not on a single machine, but across multiple servers. If your development environment consists of 20 or more EC2 instances, each instance requires the same set of configurations, updates, and validations. This quickly becomes a repetitive and time-consuming task. The challenge grows even larger in production environments, where you may have 100 or more EC2 instances. Setting up and maintaining consistency across all these machines demands enormous manual effort, often running into hundreds of hours of work, and significantly increases the chances of configuration drift, human error, and inconsistencies between servers.

This manual, server-by-server approach does not scale well and becomes a major bottleneck as applications grow. Any change — such as a security patch, runtime upgrade, or dependency update — must be applied individually to every machine. As infrastructure scales, this leads to slower deployments, higher operational costs, and reliability issues, ultimately pushing teams toward automated, standardized, and modern approaches such as infrastructure automation, pre-baked machine images, and containerized environments.

Why Serverless?

  • No Server Management: Eliminate operation overhead so your team can release quickly, get feedback, and iterate to get to market faster.
  • Automatic scaling: With technologies that automatically scale from zeto to peak demands, you can adapt to customer needs faster than ever.
  • High availability built in: With technologies that automatically scale from zero to peak demands, you can adapt to customer needs faster than ever.
  • Pay for value billing model: With pay-for-value billing model, resource utilization is automatically optimized, and you never pay for over-provisioning.
  • Build better applications, easier: Serverless applications have built in server integrations, so you can focus on building your application instead of configuring it.

What is AWS Lambda?

AWS Lambda is a service that lets you run code without needing to provision or manage servers.

While using AWS Lambda, you pay only for the compute time that you consume. Charges apply only when your code is running. You can also run code for virtually any type of application or backend service, all with zero administration.

For example, a simple Lambda function might involve automatically resizing uploaded images to the AWS Cloud. In this case, the function triggers when uploading new image.

AWS Lambda provides a wide variety of Runtimes to support a large set of languages :

  • Java SDK and JRE
  • Python
  • .NET CSharp
  • Go Lang
  • NodeJS

AWS Lambda workflow

An AWS Lambda workflow is an event-driven process where an AWS service triggers a Lambda function to run code without managing servers. Events can come from services like API Gateway, S3, DynamoDB, or EventBridge. When triggered, Lambda receives input data, executes business logic, and interacts with other AWS services such as databases, queues, or notification systems. The function runs in a managed, scalable environment with permissions defined by IAM roles. For complex workflows involving multiple steps, AWS Step Functions can coordinate several Lambda functions with built-in error handling, retries, and monitoring.

AWS Lambda Components

Step-by-Step Flow

1️⃣ Event Source

Something happens in AWS that triggers Lambda:

  • API Gateway → HTTP request
  • S3 → file upload
  • DynamoDB → data change
  • EventBridge → scheduled/cron job
  • SQS / SNS → message arrival

2️⃣ Lambda Invocation

  • AWS invokes the Lambda function
  • Input event is passed as JSON
  • Lambda runs inside a managed runtime environment

3️⃣ Execution Environment

  • AWS spins up (or reuses) a container
  • Runtime loads your code (Node.js, Python, Java, etc.)
  • Cold start (first run) or warm start (reuse)

Example :

Important use cases that are best suitable to run using AWS Lambda in Serverless mode

Use Case 1: Realtime File Processing

Real-time file processing using AWS Lambda allows files to be processed automatically as soon as they are uploaded to Amazon S3. When a file is added to an S3 bucket, an event notification triggers a Lambda function. The function receives file details, fetches the file, and performs tasks such as validation, transformation, data extraction, or resizing. After processing, the output can be stored in another S3 bucket, saved to a database, or sent as a notification using SNS or SQS. This serverless approach provides instant processing, automatic scaling, built-in monitoring, and eliminates the need to manage servers.

Use Case 2: Stream Processing

AWS Lambda is commonly used for stream processing to handle continuous, real-time data with minimal delay. It integrates natively with streaming services such as Amazon Kinesis Data Streams, DynamoDB Streams, and Amazon MSK, where incoming records automatically trigger Lambda functions.

When data arrives in the stream, Lambda reads it in small batches and processes each record. Typical operations include filtering events, transforming data formats, enriching records with additional information, or validating incoming data before further use.

Lambda automatically scales horizontally based on the stream’s throughput. As data volume increases, AWS increases the number of concurrent Lambda executions, removing the need to manage consumers or infrastructure manually.

For reliability, Lambda supports checkpointing, retries, and error handling, ensuring records are processed at least once. Processed data can be sent to services like Amazon S3, DynamoDB, OpenSearch, or SQS.

This serverless approach simplifies real-time stream processing while providing scalability, fault tolerance, and cost efficiency.

Use Case 3: Mobile and Web Application (Microservices Architecture)

AWS Lambda is widely used in mobile and web applications built on a microservices architecture to create scalable, independent backend services. Each microservice is implemented as a separate Lambda function, responsible for a single business capability such as user authentication, profile management, order processing, or payment handling.

Client applications like web browsers or mobile apps interact with these Lambda-based microservices through Amazon API Gateway. API Gateway securely exposes REST or HTTP endpoints and routes incoming requests to the appropriate Lambda function. This enables developers to build modular backends where services can be developed, deployed, and scaled independently.

Lambda automatically scales based on incoming traffic, making it ideal for applications with unpredictable usage patterns. There is no need to provision servers or manage capacity.

Each Lambda function uses IAM roles to securely access backend services such as DynamoDB, S3, or SNS. This serverless microservices approach reduces operational overhead, improves fault isolation, and allows faster feature delivery for modern mobile and web applications.

Requests

  • Charged per invocation
  • First 1 million requests per month are free, After that, you pay per additional million requests

Compute Time

  • Charged based on:
  • Execution duration (in milliseconds)
  • Memory allocated (from 128 MB to 10 GB)
  • Price increases as you allocate more memory
  • Billing starts when the function runs and stops when it finishes

Free Tier (per month)

  • 1 million free requests
  • 400,000 GB-seconds of compute time

Note: No cost when the function is idle, Automatic scaling with no infrastructure management.

Lambda Logging

AWS Lambda logging is an automatic mechanism that helps developers monitor, debug, and analyze function executions. When a Lambda function runs for the first time, AWS creates a CloudWatch log group with the name /aws/lambda/<function-name>. This log group acts as a container for all logs related to that function.

Each execution environment generates a log stream within the log group. If multiple Lambda instances run in parallel, multiple log streams are created. This makes it easier to track concurrent executions and identify performance issues or failures.

Lambda captures anything written to standard output or standard error. Developers can use statements like print() in Python or console.log() in Node.js, and the output is automatically sent to CloudWatch Logs. In addition to application logs, Lambda also records system-generated logs, including request IDs, execution duration, billed duration, and memory usage.

For logging to work, the Lambda execution role must have permissions such as AWSLambdaBasicExecutionRole. Logs can be searched, filtered, and analyzed in CloudWatch, and retention policies can be configured to control storage costs. Advanced use cases include creating metrics, alarms, and integrating logs with external monitoring tools.

Lambda Error Handling

AWS Lambda error handling ensures that failures during function execution are detected, retried, and managed in a reliable way. Error handling behavior depends on how the Lambda function is invoked — synchronous, asynchronous, or stream-based. Proper error handling helps build resilient serverless applications and prevents data loss.

For synchronous invocations (for example, API Gateway calling Lambda), errors are returned directly to the caller. If the function throws an exception or times out, Lambda sends an error response with details such as status code and error message. In this model, the client is responsible for retrying the request if needed.

For asynchronous invocations (such as S3 or EventBridge triggers), Lambda automatically retries the function up to two times if an error occurs. If all retries fail, the event can be sent to a Dead Letter Queue (DLQ) using Amazon SQS or SNS, or to Lambda Destinations for failure handling.

For stream-based sources like Kinesis, DynamoDB Streams, or MSK, Lambda retries processing the batch until it succeeds or the data expires. Failed records can block the stream, so features like bisect batch on error and partial batch responses are used to isolate problematic records.

START RequestId: 3f2a1c45-9b1a-4e8a-bd21-abc123 Version: $LATEST
ERROR ValidationError: Missing required field 'userId'
Traceback (most recent call last):
  File "/var/task/app.py", line 42, in handler
    raise ValueError("Missing required field 'userId'")
END RequestId: 3f2a1c45-9b1a-4e8a-bd21-abc123
REPORT RequestId: 3f2a1c45-9b1a-4e8a-bd21-abc123 Duration: 85 ms Memory Used: 64 MB

This structured logging helps identify the root cause quickly and improves observability and reliability.

Limitations of AWS Lambda


메타데이터
post_id
c8a5af2f7015
slug
what-is-serverless-computing-lets-understand-the-aws-lambda-c8a5af2f7015
url
https://medium.com/@rajat-aroramail/what-is-serverless-computing-lets-understand-the-aws-lambda-c8a5af2f7015
canonical_url
https://medium.com/@rajat-aroramail/what-is-serverless-computing-lets-understand-the-aws-lambda-c8a5af2f7015
author_url
https://medium.com/@rajat-aroramail
status
ok
fetched_at
2026-08-19 02:23:02