Skip to content
Cloud Computing

Serverless Architecture: Benefits, AWS Guide & Trade-Offs

Learn how serverless architecture works, where it fits and what trade-offs to consider. Follow a practical AWS SAM walkthrough to deploy and verify a serverless API.

Serverless Architecture: Benefits, AWS Guide & Trade-Offs

Serverless architecture lets you build and run applications without managing the underlying servers directly. It can simplify deployments and scale automatically, but the provider still runs servers. You still need to design for reliability, security, cost and operational visibility.

Serverless architecture is a cloud computing model in which a provider manages the infrastructure that runs application code. You deploy functions or services that respond to events. The provider can scale execution as demand changes and may charge based on use. Applications still rely on servers, networks and storage behind the scenes.

What is serverless architecture?

Serverless architecture is a design approach where your team focuses on application logic instead of provisioning and maintaining the servers that run it. The provider handles much of the infrastructure work. You remain responsible for application code, permissions, data and service configuration.

The term does not mean that an application has no servers. It means the provider takes server management off your team's hands. Function as a service (FaaS) is a common serverless model. You deploy small units of code that run in response to requests, messages, schedules or other events.

Serverless computing architecture is typically event-driven. An event, such as an HTTP request, a new file or a scheduled task, triggers a function or managed service. The function processes the event and can read from or write to databases, queues and other services.

How does the architecture of serverless computing work?

The architecture of serverless computing connects event sources to managed execution and supporting services. A typical request flows like this: a client sends a request, an entry service routes it to a function, the function runs your application logic, and a data service stores or returns information.

For example, an application on Amazon Web Services (AWS) might use Amazon API Gateway to receive HTTP requests, AWS Lambda to run code, and Amazon DynamoDB to store data. AWS documents Lambda's event-driven execution model and the API Gateway integration with Lambda.

The same pattern works with other event sources and services. A file upload might trigger image processing, and a message in a queue might trigger order processing. Design each function to handle its events reliably, including retries and duplicate delivery where the connected services allow them.

Lambda exposes three invocation models, and each one handles retries differently:

  • Synchronous (API Gateway, Application Load Balancer, direct Invoke): The caller receives the function result or error. Lambda does not retry automatically, so the caller decides whether to retry.
  • Asynchronous (Amazon S3, Amazon SNS, Amazon EventBridge): Lambda queues the event and retries a failed invocation twice by default, for three total attempts. After that, Lambda discards the event unless you configure a dead-letter queue or an OnFailure destination.
  • Poll-based (Amazon SQS, Kinesis, DynamoDB Streams): Lambda polls the source and invokes the function in batches. Depending on the service, failed batches are retried or sent to the source's own dead-letter configuration.

Asynchronous and poll-based sources can deliver the same event more than once. Make your handlers idempotent. For example, write items with a conditional expression keyed on a client-supplied request ID.

What are the main benefits of serverless architecture?

Serverless architecture reduces infrastructure administration and makes it easier to match capacity to changing demand. These benefits matter most when your workload is event-driven or traffic varies a lot.

  • Less server maintenance: The provider handles most server provisioning, patching and capacity work for the execution service. You still configure deployments, access controls and application dependencies.
  • Automatic scaling: Managed execution adds or removes capacity as requests or events change. Scaling limits and behavior depend on the provider and your service configuration.
  • Usage-based billing: Some services charge for execution or resource use, so you don't run dedicated capacity around the clock. Your total bill can also include databases, storage, network transfer, logging and other services.
  • Faster iteration: You can deploy functions without first building and maintaining a server fleet. This can shorten infrastructure setup, but testing, security review and deployment still take time.
  • Managed integrations: Serverless applications connect to managed queues, databases and event services. You don't have to operate every component yourself.

Which use cases suit serverless computing architecture?

Serverless computing architecture suits workloads you can split into event-triggered tasks that don't need a continuously running process. It works especially well when demand is intermittent, variable or hard to predict.

Common use cases include:

  • Web and mobile backends: Functions process API requests, validate input and access managed data services.
  • File and media processing: A new upload can trigger tasks such as resizing an image, extracting metadata or converting a document.
  • Scheduled jobs: A timer can start tasks such as report generation, cleanup or periodic data synchronization.
  • Event and message processing: Functions respond to queue messages, application events or changes in a data store.
  • Internet of Things (IoT) workflows: Incoming device events trigger validation, routing or data processing.
  • Short-lived data transformations: Individual functions prepare or enrich records before passing them to another service.

Serverless is often a poor fit for workloads that need a long-running process, specialized hardware, stable low-latency execution or fine-grained operating-system control. If an application runs busy all the time, compare it with reserved or dedicated capacity. Usage-based pricing isn't automatically cheaper for every traffic pattern.

How does serverless architecture work on AWS?

AWS serverless architecture combines managed services to receive events, run code and store or route data. A basic web API can use Amazon API Gateway, AWS Lambda and Amazon DynamoDB. Production systems often add services for authentication, queues, monitoring and delivery.

In this pattern, API Gateway accepts an HTTP request and invokes a Lambda function. The function runs your application logic and may read or write to DynamoDB before it returns a response. AWS describes building an API with Lambda and API Gateway. Your choice of services depends on your data and traffic needs.

An AWS serverless design doesn't remove operational work. You still define identity and access management (IAM) permissions, set resource limits, handle errors and monitor service behavior. AWS provides Lambda monitoring guidance for tracking function activity.

Component Role in an AWS serverless application
Amazon API Gateway Receives and routes HTTP requests.
AWS Lambda Executes code in response to requests or other events.
Amazon DynamoDB Provides managed NoSQL data storage.
Amazon Simple Queue Service (Amazon SQS) Holds messages for asynchronous processing.
Amazon CloudWatch Collects logs and metrics for monitoring.

This is one example, not a required stack. The same principles apply to serverless offerings from other cloud providers, though service names, limits, pricing and integrations differ.

What do I need before deploying a serverless API on AWS?

To deploy a serverless API on AWS, you need an AWS account, the AWS CLI v2, the AWS SAM CLI, Python 3.12 and a region where every service in your stack is available. This walkthrough targets Ubuntu 24.04 LTS on your workstation, AWS CLI v2, SAM CLI 1.x, the python3.12 Lambda runtime and the us-east-1 region. If you change regions, use your new region consistently throughout.

Prerequisites checklist:

  • An AWS account. Don't use the root user for deployments.
  • An IAM user or role that can create CloudFormation stacks, Lambda functions, API Gateway APIs, DynamoDB tables, IAM roles and CloudWatch log groups.
  • Outbound HTTPS access from your workstation to *.amazonaws.com.
  • Docker, only if you want to run the API locally with sam local.

Warning

The policy below is deliberately broad and suits only a sandbox account. Granting iam:PassRole and cloudformation:* on * lets the holder create roles with arbitrary permissions. Narrow the resource ARNs before you use it anywhere shared.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DeployServerlessTutorialStack",
      "Effect": "Allow",
      "Action": [
        "cloudformation:CreateStack",
        "cloudformation:UpdateStack",
        "cloudformation:DeleteStack",
        "cloudformation:DescribeStacks",
        "cloudformation:DescribeStackEvents",
        "cloudformation:GetTemplateSummary",
        "lambda:*",
        "apigateway:*",
        "dynamodb:CreateTable",
        "dynamodb:DescribeTable",
        "dynamodb:DeleteTable",
        "iam:CreateRole",
        "iam:DeleteRole",
        "iam:GetRole",
        "iam:PassRole",
        "iam:AttachRolePolicy",
        "iam:DetachRolePolicy",
        "iam:PutRolePolicy",
        "iam:DeleteRolePolicy",
        "logs:CreateLogGroup",
        "logs:DeleteLogGroup",
        "logs:DescribeLogGroups",
        "logs:PutRetentionPolicy",
        "s3:CreateBucket",
        "s3:PutObject",
        "s3:GetObject",
        "s3:ListBucket",
        "xray:PutTraceSegments"
      ],
      "Resource": "*"
    }
  ]
}

Install the tooling and verify each version:

sudo apt-get update
sudo apt-get install -y unzip curl jq
curl -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o awscliv2.zip
unzip -q awscliv2.zip
sudo ./aws/install --update
aws --version

Expected output (the exact patch numbers will differ):

aws-cli/2.17.0 Python/3.11.6 Linux/6.8.0-45-generic exe/x86_64.ubuntu.24
curl -fsSL "https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip" -o aws-sam-cli-linux-x86_64.zip
unzip -q aws-sam-cli-linux-x86_64.zip -d sam-installation
sudo ./sam-installation/install
sam --version

Expected output:

SAM CLI, version 1.120.0

Configure credentials for a dedicated profile and confirm which identity the CLI will use:

aws configure --profile serverless-tutorial
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: us-east-1
Default output format [None]: json
export AWS_PROFILE=serverless-tutorial
export AWS_REGION=us-east-1
aws sts get-caller-identity

Expected output:

{
    "UserId": "AIDAEXAMPLEUSERID",
    "Account": "123456789012",
    "Arn": "arn:aws:iam::123456789012:user/serverless-tutorial"
}

If that command fails, stop here. Every later step will fail the same way.

How do I deploy a serverless API on AWS with SAM?

Deploy a serverless API on AWS with the AWS Serverless Application Model (SAM). Define the API, function and table in a template, build the package locally, then deploy the resulting CloudFormation stack. SAM is a transform over CloudFormation, so the deployed resources are ordinary Lambda, API Gateway and DynamoDB resources. You can inspect them with the standard AWS CLI commands.

Step 1: Create the project layout

mkdir -p serverless-api/src serverless-api/events
cd serverless-api

Step 2: Write the SAM template

Save the following as template.yaml. It creates an on-demand DynamoDB table, a Python 3.12 function with least-privilege access to that table, and two API Gateway routes.

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Serverless items API (API Gateway + Lambda + DynamoDB)

Globals:
  Function:
    Runtime: python3.12
    Architectures:
      - x86_64
    Timeout: 10
    MemorySize: 256
    Tracing: Active

Resources:
  ItemsTable:
    Type: AWS::DynamoDB::Table
    Properties:
      TableName: !Sub "${AWS::StackName}-items"
      BillingMode: PAY_PER_REQUEST
      AttributeDefinitions:
        - AttributeName: id
          AttributeType: S
      KeySchema:
        - AttributeName: id
          KeyType: HASH
      PointInTimeRecoverySpecification:
        PointInTimeRecoveryEnabled: true

  ItemsFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: src/
      Handler: app.handler
      Policies:
        - DynamoDBCrudPolicy:
            TableName: !Ref ItemsTable
      Environment:
        Variables:
          TABLE_NAME: !Ref ItemsTable
      Events:
        ListItems:
          Type: Api
          Properties:
            Path: /items
            Method: get
        CreateItem:
          Type: Api
          Properties:
            Path: /items
            Method: post

Outputs:
  ApiUrl:
    Description: Base URL of the deployed API stage
    Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/"
  TableName:
    Description: DynamoDB table backing the API
    Value: !Ref ItemsTable

DynamoDBCrudPolicy is a SAM policy template. It expands to a scoped IAM policy for that one table. Tracing: Active turns on AWS X-Ray and makes SAM attach the X-Ray write policy automatically.

Step 3: Write the function code

Save the following as src/app.py. The boto3 library ships with the python3.12 runtime, so this example doesn't need a requirements.txt file.

import json
import os
import uuid
from datetime import datetime, timezone

import boto3
from botocore.exceptions import ClientError

TABLE_NAME = os.environ["TABLE_NAME"]
table = boto3.resource("dynamodb").Table(TABLE_NAME)


def handler(event, context):
    method = event.get("httpMethod")
    if method == "GET":
        return list_items()
    if method == "POST":
        return create_item(event)
    return _response(405, {"message": "Method not allowed"})


def list_items():
    # scan is fine for a tutorial; use query with a partition key at scale
    result = table.scan(Limit=50)
    return _response(200, {"items": result.get("Items", [])})


def create_item(event):
    try:
        body = json.loads(event.get("body") or "{}")
    except json.JSONDecodeError:
        return _response(400, {"message": "Body must be valid JSON"})

    name = body.get("name")
    if not name:
        return _response(400, {"message": "Field 'name' is required"})

    item = {
        "id": str(uuid.uuid4()),
        "name": name,
        "created_at": datetime.now(timezone.utc).isoformat(),
    }
    try:
        table.put_item(Item=item, ConditionExpression="attribute_not_exists(id)")
    except ClientError as exc:
        return _response(500, {"message": exc.response["Error"]["Code"]})
    return _response(201, item)


def _response(status, payload):
    return {
        "statusCode": status,
        "headers": {"Content-Type": "application/json"},
        "body": json.dumps(payload),
    }

Step 4: Add a local test event

Save the following as events/create-item.json. You can then invoke the function without API Gateway.

{
  "httpMethod": "POST",
  "path": "/items",
  "headers": { "Content-Type": "application/json" },
  "body": "{\"name\":\"local item\"}",
  "isBase64Encoded": false
}

Step 5: Validate and build

sam validate
sam build

Expected output ends with:

Build Succeeded

Built Artifacts  : .aws-sam/build
Built Template   : .aws-sam/build/template.yaml

If your function later gains native dependencies, run sam build --use-container. This compiles the wheels for the Lambda runtime instead of your workstation.

Step 6: Deploy the stack

sam deploy --guided

Answer the prompts as follows:

Stack Name [sam-app]: serverless-api
AWS Region [us-east-1]: us-east-1
Confirm changes before deploy [y/N]: y
Allow SAM CLI IAM role creation [Y/n]: y
Disable rollback [y/N]: n
ItemsFunction has no authentication. Is this okay? [y/N]: y
Save arguments to configuration file [Y/n]: y
SAM configuration file [samconfig.toml]: <Enter>
SAM configuration environment [default]: <Enter>

The generated samconfig.toml should look like this:

version = 0.1

[default.global.parameters]
stack_name = "serverless-api"

[default.deploy.parameters]
capabilities = "CAPABILITY_IAM"
confirm_changeset = true
resolve_s3 = true
region = "us-east-1"

Later deploys only need sam deploy.

Step 7: Verify the stack and the API

aws cloudformation describe-stacks \
  --stack-name serverless-api \
  --query "Stacks[0].StackStatus" \
  --output text

Expected output:

CREATE_COMPLETE
aws dynamodb describe-table \
  --table-name serverless-api-items \
  --query "Table.{Status:TableStatus,Billing:BillingModeSummary.BillingMode}" \
  --output table

Expected output:

-------------------------------------
|          DescribeTable            |
+----------+------------------------+
| Billing  |  PAY_PER_REQUEST       |
| Status   |  ACTIVE                |
+----------+------------------------+

Capture the API URL and call both routes:

API_URL=$(aws cloudformation describe-stacks \
  --stack-name serverless-api \
  --query "Stacks[0].Outputs[?OutputKey=='ApiUrl'].OutputValue" \
  --output text)
echo "$API_URL"
curl -s -i -X POST "${API_URL}items" \
  -H "Content-Type: application/json" \
  -d '{"name":"first item"}'

Expected response (the id and timestamp will differ):

HTTP/2 201
content-type: application/json

{"id": "6f1c2a3e-8b4d-4f0a-9c1e-2d7b5a9e4c11", "name": "first item", "created_at": "2025-01-01T12:00:00+00:00"}
curl -s "${API_URL}items" | jq

Expected response:

{
  "items": [
    {
      "id": "6f1c2a3e-8b4d-4f0a-9c1e-2d7b5a9e4c11",
      "name": "first item",
      "created_at": "2025-01-01T12:00:00+00:00"
    }
  ]
}

Step 8: Confirm logs and traces are flowing

FUNCTION_NAME=$(aws lambda list-functions \
  --query "Functions[?starts_with(FunctionName,'serverless-api-ItemsFunction')].FunctionName" \
  --output text)
echo "$FUNCTION_NAME"
aws logs tail "/aws/lambda/${FUNCTION_NAME}" --since 10m

The output should include a START RequestId: ..., an END RequestId: ... and a REPORT RequestId: ... Duration: ... ms Billed Duration: ... ms line for each invocation.

Step 9: Run the API locally (optional)

sam local start-api --port 3000

In a second terminal:

curl -s http://127.0.0.1:3000/items | jq

Warning

sam local start-api binds to 127.0.0.1 by default. Adding --host 0.0.0.0 exposes the unauthenticated API to every host that can reach your machine, including your local network. Do this only on a trusted network, and only for the length of a test.

You can also invoke the function directly with the saved event:

sam local invoke ItemsFunction --event events/create-item.json

Step 10: Tear down the stack

Warning

sam delete removes the CloudFormation stack, the Lambda function, the API and the DynamoDB table. Deleting the table destroys every item in it, and point-in-time recovery backups expire after 35 days. Export any data you need first.

aws dynamodb scan --table-name serverless-api-items --output json > items-backup.json
sam delete --stack-name serverless-api

Confirm the stack is gone:

aws cloudformation describe-stacks --stack-name serverless-api

Expected error:

An error occurred (ValidationError) when calling the DescribeStacks operation: Stack with id serverless-api does not exist

What are the challenges of serverless architecture?

Serverless architecture moves infrastructure management to the provider, but it brings its own design and operational trade-offs. Evaluate these constraints before you choose a serverless service.

  • Execution limits: Functions have provider-defined limits, such as maximum execution duration, memory and request size. Check the current service documentation before you design around a limit.
  • Cold starts: A function that hasn't run recently may need extra initialization before it processes a request. The impact depends on the runtime, configuration, workload and provider.
  • Distributed troubleshooting: A request may pass through several managed services. Diagnosing a failure can mean correlating logs, traces and events across components.
  • Cost complexity: The function's execution charge is only part of the bill. Data storage, network transfer, API requests, logging and idle provisioned resources can add costs.
  • Provider dependence: Applications can become tightly coupled to one provider's event formats, identity system and managed services. Staying portable may require extra abstraction and engineering work.
  • Testing and local development: Reproducing managed services locally takes effort. Test integration paths in a controlled cloud environment, not just individual functions.

For AWS Lambda specifically, these limits most often shape a design: a 15-minute maximum invocation duration, 10,240 MB of memory (with CPU scaled proportionally), a 50 MB zipped or 250 MB unzipped deployment package, a 6 MB synchronous request and response payload, a 256 KB asynchronous payload, and a default regional concurrency quota of 1,000 concurrent executions. Cold-start mitigation options include smaller deployment packages, provisioned concurrency (billed whether or not it's used) and SnapStart for supported runtimes.

Good design reduces these risks. Keep functions focused, make event handling safe to retry where appropriate, set budgets and alerts, and document how you detect and recover from failures.

Is serverless architecture or VPS hosting right for your workload?

Serverless architecture suits event-driven code that benefits from managed scaling. A virtual private server (VPS) gives you more direct control over a persistent operating environment. The right choice depends on your workload shape, your operating requirements and how much infrastructure management your team can take on.

Consideration Serverless architecture VPS hosting
Server administration Provider manages much of the execution infrastructure. The customer manages the operating system and server software, unless a managed service covers that work.
Workload pattern Suits event-triggered and variable workloads. Suits persistent services and workloads needing a continuously available environment.
Control Less control over the underlying runtime and host. More control over the operating system, software stack and configuration.
Scaling Often handled by the service, within its limits and configuration. Usually requires the customer to plan and configure capacity.
Cost planning Usage-based charges can vary with activity and connected services. Capacity is generally provisioned for a chosen server plan; actual billing depends on the provider and plan.

A VPS suits applications that need persistent processes, custom system software or predictable server-level access. To learn more, read what VPS hosting is and how to set up Ubuntu. If you build a serverless system, consider a VPS or another compute model for components that don't fit function execution. Don't force every component into one approach.

How do I decide whether to implement serverless?

A short workload review shows whether serverless solves a real operational problem for your application. Assess your traffic, execution needs, data flow and tolerance for provider-specific services before you commit.

  1. Map the events: Identify what starts each task, such as an HTTP request, file upload, schedule or queue message. If a process must run continuously, check whether the service you're considering supports it.
  2. Check execution requirements: Compare expected duration, memory, network access and dependencies with the provider's documented service limits.
  3. Estimate the full cost: Include execution, databases, storage, network transfer, logs and monitoring, not just function invocations. Model both quiet and busy periods.
  4. Plan reliability: Decide how the application handles timeouts, retries, duplicate events, failed messages and downstream outages.
  5. Review portability and skills: Confirm that your team can operate the provider's services and that vendor-specific integrations are acceptable.
  6. Test a small workload: Deploy a representative component, measure its behavior under realistic conditions and review the operational work before you expand the design.

Troubleshooting

Most serverless deployment failures on AWS come from credentials, IAM capabilities, handler paths or timeouts. Each one produces a recognizable error message. The entries below assume the serverless-tutorial profile and the serverless-api stack from the walkthrough.

Unable to locate credentials or An error occurred (InvalidClientTokenId)

The CLI isn't reading the profile you configured. Confirm that the environment variable is set in your current shell and that the identity resolves:

echo "$AWS_PROFILE"
aws sts get-caller-identity --profile serverless-tutorial

If the profile is missing from ~/.aws/credentials, run aws configure --profile serverless-tutorial again.

Requires capabilities : [CAPABILITY_IAM]

The template creates an IAM role, and CloudFormation won't proceed without explicit acknowledgement. Add the capability to samconfig.toml or pass it on the command line:

sam deploy --capabilities CAPABILITY_IAM

Use CAPABILITY_NAMED_IAM if the template assigns explicit role names.

Runtime.ImportModuleError: Unable to import module 'app': No module named 'app'

The handler path doesn't match the built artifact. Check that Handler is app.handler, that the file is src/app.py, and that CodeUri points at src/. Then rebuild and redeploy:

sam build && sam deploy

Task timed out after 10.00 seconds

The function exceeded the Timeout in the template. Raise it, but first check whether the function runs inside a VPC. A VPC-attached Lambda function with no NAT gateway or DynamoDB gateway endpoint can't reach the DynamoDB API, so it hangs until it times out.

aws lambda get-function-configuration \
  --function-name "$FUNCTION_NAME" \
  --query "{Timeout:Timeout,VpcConfig:VpcConfig}" \
  --output json

{"message": "Internal server error"} with HTTP 502 from API Gateway

The function crashed or returned a payload without statusCode and body. API Gateway accepts only the Lambda proxy response shape. Read the traceback in the logs:

aws logs tail "/aws/lambda/${FUNCTION_NAME}" --since 15m --format short

ResourceNotFoundException: Requested resource not found from DynamoDB

The TABLE_NAME environment variable points to a table that doesn't exist. This usually happens after the stack name changes. Compare the two values:

aws lambda get-function-configuration \
  --function-name "$FUNCTION_NAME" \
  --query "Environment.Variables.TABLE_NAME" --output text
aws dynamodb list-tables --output text

ValidationException: One or more parameter values were invalid: Missing the key id in the item

The put_item call omitted the partition key. Every item written to ItemsTable must include id, because it's the only key attribute defined in KeySchema.

CloudFormation stack is in ROLLBACK_COMPLETE state and can not be updated

A failed first deployment leaves a stack that can't be updated. Delete the stack and redeploy:

sam delete --stack-name serverless-api
sam deploy

Error: Running AWS SAM projects locally requires Docker. Have you got it installed and running?

sam local needs a container runtime. Install and start Docker, then run the command again:

sudo apt-get install -y docker.io
sudo systemctl enable --now docker
sudo usermod -aG docker "$USER"

Warning

Membership of the docker group is effectively root-equivalent on the host, because a container can mount the filesystem. Add only trusted accounts, and log out and back in for the group change to take effect.

An error occurred (InvalidSignatureException): Signature expired

Your workstation clock has drifted more than five minutes from AWS time. Resynchronize it:

sudo timedatectl set-ntp true
timedatectl status

Key takeaways

  • Serverless architecture lets developers deploy code without directly managing the servers that run it, but the application still depends on infrastructure.
  • Event-triggered APIs, scheduled jobs and file processing are common workloads for serverless services.
  • Serverless can reduce server administration and scale with demand, but connected services and usage patterns affect total cost.
  • Execution limits, cold starts, distributed troubleshooting and provider dependence are important trade-offs.
  • A VPS or dedicated environment may suit persistent workloads that need more control over the operating system and runtime.

Serverless is a useful option when managed, event-driven execution matches your workload. If your system needs persistent server control, compare it with VPS hosting options from PingRack and choose the model that fits your operational requirements.

Frequently asked questions

Does serverless architecture mean there are no servers?

No. Serverless architecture still uses servers, networks and storage behind the scenes. The term means the cloud provider manages much of the infrastructure that runs application code, while your team remains responsible for code, permissions, data and service configuration. Functions commonly run in response to requests or other events.

How many times does AWS Lambda retry an asynchronous invocation?

AWS Lambda makes two retries for a failed asynchronous invocation by default, giving three total attempts. After the third failed attempt, Lambda discards the event unless a dead-letter queue or an OnFailure destination is configured. Because asynchronous sources can deliver events more than once, make handlers idempotent.

What tools and versions do I need for the AWS serverless API walkthrough?

The required setup is Ubuntu 24.04 LTS on the workstation, AWS CLI v2, AWS SAM CLI 1.x, the python3.12 Lambda runtime and the us-east-1 region. The deployment also requires an AWS account and IAM permissions to create CloudFormation stacks, Lambda functions, API Gateway APIs, DynamoDB tables, IAM roles and CloudWatch log groups.

What is the maximum runtime for an AWS Lambda invocation?

AWS Lambda's maximum invocation duration is 15 minutes. AWS Lambda also allows up to 10,240 MB of memory, with CPU scaled proportionally. Its deployment package limit is 50 MB zipped or 250 MB unzipped; synchronous request and response payloads are limited to 6 MB, and asynchronous payloads to 256 KB.

Comments

Loading comments…

Leave a comment

All articles