Cloud concept · Updated

Serverless - Serverless is a cloud operating model in which the provider manages the underlying servers while customers deploy applications or use services without provisioning and maintaining those servers.

In short

Serverless shifts infrastructure operations to the cloud provider so engineers can focus on application behavior, data, and configuration. It can reduce operational work and align costs with usage, but scaling behavior, billing, execution limits, and customer responsibilities vary by service.

Cloud Concepts Hub →

6 key aspects of Serverless

Serverless removes server administration while preserving the need to design for workload fit, scaling limits, security, reliability, and cost.

01
Provider-managed infrastructure

The provider provisions and maintains the underlying servers. Engineers configure application-level resources instead of managing host operating systems and instance fleets.

02
Multiple execution models

Serverless includes functions, managed container execution, and supporting application services. Choose the model according to execution duration, packaging, runtime requirements, and operational needs.

03
Service-specific elasticity

Many serverless services adjust capacity to demand, but scaling remains subject to quotas and configuration. Container workloads may require explicit replica-scaling policies, and downstream systems must tolerate increased traffic.

04
Usage-oriented billing

Charges commonly reflect requests, execution duration, consumed capacity, or allocated resources. Scale-to-zero and zero idle compute charges are not universal properties, so evaluate each service's billing model.

05
Resilient application design

Store durable state outside replaceable execution environments. Use idempotent processing, bounded retries, and failure destinations or dead-letter queues where appropriate.

06
Shared security and operational responsibility

The provider manages infrastructure, but customers remain responsible for application security, permissions, data protection, and configuration. Monitoring, dependency updates, and cost controls are still necessary.

Cloud services for Serverless

Amazon API Gateway can expose an API backed by AWS Lambda, while Amazon DynamoDB stores durable application state. Amazon SQS buffers background work so request handling does not depend on immediate completion of every task. Lambda can process short queue-driven operations, while AWS Fargate can run containerized workers or services that need longer execution or different runtime behavior. These services remove host administration, but engineers still configure permissions, retries, scaling limits, and monitoring. Queue consumers should tolerate duplicate delivery where applicable, and their throughput should be controlled to avoid overwhelming the database or other downstream dependencies.

AWS LambdaAWS Lambda

Runs functions without requiring customers to provision or maintain execution hosts. It suits API handlers, scheduled automation, and event processing, with a maximum execution duration of 15 minutes per invocation.

AWS FargateAWS Fargate

Provides serverless compute for Amazon ECS tasks and Amazon EKS pods. It suits containerized services and jobs that need container-level packaging or longer execution, while customers configure resource requirements and workload scaling.

Amazon API GatewayAmazon API Gateway

Provides managed API endpoints without requiring customers to operate API server infrastructure. It can route requests to Lambda and other backends, with authentication and throttling capabilities depending on the API type.

Amazon DynamoDBAmazon DynamoDB

Provides a serverless NoSQL database for durable application state without database server administration. On-demand capacity accommodates variable request traffic, while provisioned capacity offers explicitly configured throughput with optional automatic scaling.

Serverless exam questions

Real practice exam questions on Serverless, with the correct answer and its explanation. Answer them with every option in the exam simulator.

AIF-C01

A software company is building a documentation assistant using a foundation model in Amazon Bedrock. Each answer must respond to a user's current question, and the application must display portions of the answer as the model generates them rather than wait for the complete answer. Usage varies throughout the day. The company does not want to provision model-serving infrastructure or commit to dedicated model capacity. Assume the selected model supports the required capabilities. Which approach best meets these requirements?

Show answerCORRECT ANSWER

Use Amazon Bedrock on-demand inference with streaming responses for each user question.

On-demand inference supports requests triggered by current user activity without a commitment to dedicated model capacity. Streaming delivers portions of the generated answer incrementally. AWS manages the underlying model-serving infrastructure, combining online inference with a serverless operating model.

DEA-C01

A company runs operational analytics on a provisioned Amazon Redshift cluster. Queries arrive throughout the business day, but unpredictable 10-minute bursts require several times the normal query-processing capacity. The current cluster is sized for normal demand, so queries queue during these bursts.

The company is willing to migrate the warehouse. A data engineer must select a configuration that automatically increases compute capacity during bursts and reduces it afterward, without custom scaling automation. The normal operating capacity must not be sized for peak demand. Testing has established the compute capacity needed for both normal and peak workloads, and the necessary service quotas are available.

Which solution meets these requirements?

Show answerCORRECT ANSWER

Migrate to Amazon Redshift Serverless. Set base capacity for normal demand and maximum capacity high enough to accommodate the tested peak workload.

Redshift Serverless can automatically increase compute capacity as workload demand rises and reduce it as demand falls. A normal-demand base capacity and a sufficiently high maximum capacity allow this elasticity without sizing the normal operating capacity for peaks or implementing custom scaling automation.

SAP-C03

An insurer is refactoring the claims-review capability of a monolithic application. Other capabilities will remain unchanged. The replacement must validate a claim, request an external assessment, wait for the assessor's HTTPS callback, and then calculate a settlement. Assessments typically take 6–48 hours. Each validation or calculation operation requires less than 30 seconds of compute time.

The assessor immediately acknowledges each assessment request and later sends the result with a correlation identifier. The insurer can modify this integration to include an opaque callback token. The replacement must persist workflow progress, retry transient failures in individual processing steps, and route overdue assessments to manual review after 72 hours. Retried processing steps must not create duplicate business effects. The insurer does not want to manage compute hosts or pay for application compute that remains running while an assessment is pending.

Which design meets these requirements with the LEAST custom orchestration code?

Show answerCORRECT ANSWER

Use an AWS Step Functions Standard Workflow with AWS Lambda functions for processing. Request the assessment through a Lambda task that uses the wait-for-task-token integration pattern, and pass the task token to the assessor. Have an authenticated callback handler complete the task when the result arrives. Configure task timeouts, Retry and Catch rules, and idempotency checks based on the claim and operation identifiers.

A Standard Workflow durably maintains progress across a multi-day wait without keeping application compute running. The callback task remains pending until the assessor's result completes it. A task timeout and Catch path can route overdue assessments to manual review. Retry rules handle transient errors, while application-level idempotency checks prevent repeated task attempts from duplicating business effects.

Practice Serverless in a full exam

Questions on Serverless in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Serverless

3 min read

Serverless describes how infrastructure is operated, not the absence of servers. Physical and virtual servers still execute the workload, but the cloud provider manages their provisioning, maintenance, and replacement. Customers work with higher-level resources such as functions, container tasks, APIs, queues, and databases instead of administering individual hosts. The practical benefit is less infrastructure management, particularly for teams building applications with variable demand.

Serverless is broader than function as a service. Functions are one implementation, but managed container execution and services for messaging, storage, and workflow orchestration also apply the model. Conversely, running an application in a container does not automatically make it serverless. If the team must provision and patch the container hosts, it still manages server infrastructure.

AWS Lambda is appropriate for event-driven functions, such as processing an uploaded image, responding to an API request, or handling messages from a queue. AWS provisions execution environments and scales function execution within configured limits and service quotas. Each invocation has a maximum execution duration of 15 minutes, making Lambda unsuitable for a single uninterrupted job that must run longer. Functions can be packaged as container images, but they still follow Lambda's execution model rather than behaving like continuously running container services.

AWS Fargate is appropriate when an application should run as containers without managing the underlying compute instances. It supplies compute for Amazon ECS tasks and Amazon EKS pods. Examples include a continuously running web service, an existing containerized application, or a batch worker that needs longer execution than a function allows. Engineers still define container images, CPU and memory requirements, networking, permissions, and workload scaling. Fargate does not automatically determine how many application replicas are needed; scaling must be configured through the relevant orchestration mechanisms.

Consider an order-processing application. An API accepts an order and places a message on a managed queue. A Lambda function processes short tasks, while a Fargate task handles a lengthy document-generation job. A managed database stores order status. Durable state belongs in external storage because execution environments can be replaced, and local files should not be treated as durable shared storage. Where event delivery or retries can produce duplicates, handlers should be idempotent so repeated processing does not create duplicate charges or orders.

Serverless does not mean unlimited scaling, guaranteed zero idle cost, or automatic cost savings. Quotas, concurrency settings, database capacity, and downstream dependencies can restrict throughput. Some services can scale to zero, while continuously running containers and reserved execution capacity still incur charges. Compare total costs, including requests, execution time, provisioned resources, networking, logs, and supporting services. Steady, highly utilized workloads may be less expensive on other compute models.

The trade-offs include reduced host-level control, service-specific interfaces, startup latency, and more distributed troubleshooting. Teams must still secure application code, dependencies, identities, data, and configuration. They also need monitoring, retry policies, failure handling, and deployment controls. For exam scenarios, choose Lambda for short event-driven function execution and Fargate for container workloads that need managed compute without host administration; do not assume that every serverless option has the same scaling or billing behavior.

Learn Serverless in lessons

13 short lessons on Serverless in 6 certification courses.

and 7 more lessons

Open the lessons