Lambda & Serverless

AWS SAA SAA-C03 · Design High-Performing Architectures

By Abu Anns · Last updated 20 November 2026Exam version: SAA-C03 (current)

AWS Lambda: functions without servers

AWS Lambda runs your code in response to events without you provisioning or managing any servers. You upload code (or a container image), define a trigger, and Lambda runs it, scales it automatically, and charges you only for the requests and the compute time consumed. Each invocation is independent: Lambda can run thousands of copies of your function in parallel when events spike, and scale to zero when there is nothing to do. That makes it ideal for event-driven work — processing files uploaded to S3, responding to API calls, reacting to database changes, running scheduled tasks.

Lambda has limits the exam tests. A single invocation can run for at most 15 minutes, so Lambda is the wrong choice for long-running jobs (those belong on EC2, ECS, or AWS Batch). Memory is configurable from 128 MB to 10 GB, and CPU scales proportionally with memory — doubling memory doubles CPU, which is also how you buy more performance. Functions get 512 MB of ephemeral storage at /tmp by default (configurable up to 10 GB), and can mount an EFS file system for shared or persistent data. A function's execution role (an IAM role) determines what AWS resources it can touch. Lambda runs in the AWS-managed network by default; if a function needs to reach resources inside your VPC (such as an RDS database), you configure VPC access, and the function then uses elastic network interfaces in your subnets.

Cold starts are the startup delay when Lambda has to initialize a new execution environment for a function that has not run recently. For most workloads the delay is negligible, but for latency-sensitive APIs it matters. Provisioned concurrency keeps a number of execution environments warm and ready, eliminating cold starts at an extra cost. The exam's rule: provisioned concurrency is the answer when a question explicitly requires consistent low latency from Lambda.

Building serverless applications: API Gateway, Step Functions, and EventBridge

Lambda rarely stands alone. Amazon API Gateway exposes Lambda functions (and other backends) as HTTP APIs, handling request routing, authentication, throttling, request validation, and caching. It offers REST APIs (full-featured) and HTTP APIs (cheaper, lower latency, fewer features). API Gateway can also throttle requests to protect a backend from being overwhelmed, and it integrates with Cognito and Lambda authorizers for authentication.

AWS Step Functions orchestrate multi-step workflows: a sequence of Lambda functions, with branching, retries, parallel steps, and error handling, expressed as a state machine. When a question describes a workflow where step B depends on step A, with error handling and human approval steps, Step Functions is the answer — not a single giant Lambda function, and not a chain of functions calling each other directly. Amazon EventBridge is the serverless event bus: it routes events between AWS services, SaaS applications, and your own applications based on rules, and it can trigger targets on a schedule (replacing the older CloudWatch Events scheduled rules).

Decoupling: SQS and SNS

Two messaging services appear constantly in the exam, and the distinction between them is fundamental. Amazon SQS (Simple Queue Service) is a message queue: producers send messages, consumers pull them and process them at their own pace. Queues decouple components, so a slow consumer does not block a fast producer, and messages are buffered during traffic spikes instead of being lost. SQS offers standard queues (at-least-once delivery, best-effort ordering, nearly unlimited throughput) and FIFO queues (exactly-once processing, strict ordering, lower throughput). A message that fails processing repeatedly can be moved to a dead-letter queue (DLQ) after a configured number of receives, so poison messages do not block the queue forever. The visibility timeout is the period during which a message being processed is hidden from other consumers; it should be longer than the time processing takes, or the message will be processed twice.

Amazon SNS (Simple Notification Service) is a publish/subscribe service: a publisher sends one message to a topic, and SNS delivers it to all subscribers — which can be SQS queues, Lambda functions, HTTP endpoints, email addresses, or mobile push notifications. SNS is for fan-out: one event, many consumers. The classic exam pattern combines them: SNS fans a message out to multiple SQS queues, one per consumer type, so each consumer processes at its own pace. The rule of thumb: SQS is one-to-one (a message is processed by one consumer), SNS is one-to-many (a message goes to all subscribers). When a question says several independent systems must all react to the same event, the answer is SNS; when it says work must be queued and processed reliably at the consumer's pace, the answer is SQS.

Serverless design judgment

The exam tests serverless as a design choice, not just as a list of services. Lambda wins when workloads are event-driven, short-lived, spiky, or idle much of the time. EC2 or containers win when workloads run continuously, need more than 15 minutes per task, or need specific operating-system-level control. Decoupling with SQS or SNS wins whenever two components have different speeds or availability requirements — the queue absorbs the difference. And the serverless cost model (pay per use) usually beats paying for idle servers, except for sustained high-volume workloads where reserved capacity is cheaper.

Operating Lambda functions

Running Lambda in production involves a few more concepts. Versions and aliases let you publish immutable snapshots of a function and point an alias (such as “production”) at a specific version, so you can roll back instantly and shift traffic gradually between versions for safe deployments. Environment variables hold configuration, and sensitive values should be encrypted with KMS or, better, fetched from Secrets Manager or Parameter Store at runtime rather than stored in the function configuration. Layers package shared libraries and dependencies separately from function code, so many functions can reuse the same layer without duplicating it. Destinations route the result of an asynchronous invocation — success or failure — to another service such as an SQS queue, an SNS topic, an EventBridge event bus, or another Lambda function, which makes it easy to build reliable pipelines that handle failures explicitly instead of silently dropping them.

Lambda also has concurrency controls worth knowing. Each Region has a default concurrency limit (1,000 concurrent executions), and you can set reserved concurrency for a function to guarantee it capacity or to cap how much it can consume — useful both to protect a critical function from being starved and to prevent a runaway function from exhausting the account's capacity or overwhelming a downstream database. Failed asynchronous invocations are retried automatically (twice, by default) before being discarded, which is why a dead-letter queue or a failure destination matters for important workloads. Monitoring comes from CloudWatch: every function automatically reports invocations, errors, duration, and throttles, and CloudWatch Logs captures the function's output. For distributed tracing across functions and services, AWS X-Ray integrates with Lambda with minimal configuration.

Advertisement

Exam traps to watch for

Practice questions

Test yourself on this guide. Answers are checked instantly, with a full explanation for each question.

Q1.A company processes images uploaded to S3. Each image takes about 30 seconds to resize, uploads arrive in unpredictable bursts, and there are long idle periods with no uploads. Which compute solution is MOST cost-effective?

Report an error

Q2.A video processing job runs for 45 minutes per file and must run to completion without interruption. The company is considering AWS Lambda for this workload. What should the solutions architect recommend?

Report an error

Q3.An order-processing system receives orders through an API. Order volume spikes unpredictably, and the processing service is slower than the API. Orders must not be lost during spikes, and the API must respond quickly even when processing is backed up. Which design meets these requirements?

Report an error

Q4.A company wants a single event — a new customer sign-up — to trigger three independent actions: send a welcome email, create a record in a CRM system, and notify an analytics service. Each action is handled by a different system. Which AWS service BEST delivers the event to all three systems?

Report an error

Q5.A Lambda function processes messages from an SQS queue. Processing takes about 90 seconds per message, but the queue's visibility timeout is set to 30 seconds. What problem will occur?

Report an error

Q6.A company is building an order workflow: validate the order, charge the payment, then ship the product. Each step depends on the previous one, failed steps must be retried, and a failed payment must stop the workflow. Which service BEST orchestrates this workflow?

Report an error

Q7.A latency-sensitive API is backed by Lambda functions. Users report occasional slow responses of several seconds when the API has been idle. The slowness disappears under steady traffic. What is the MOST likely cause, and what is the BEST fix?

Report an error

Q8.A Lambda function needs to query a private RDS database inside a VPC and also call an external payment API over the internet. What must the solutions architect configure for the function to reach both?

Report an error