0%
AWS Solutions Architect Associate (SAA-C03) Exam Prep: Secure, Resilient, High-Performing and Cost-Optimized Architectures
Domain 1: Design Secure Architectures
Domain 3: Design High-Performing Architectures
Domain 4: Design Cost-Optimized Architectures
Final Review and Mock Exams
Serverless and Containers
Serverless and container services let architects run code without managing servers, or with far less server management than plain EC2. The exam tests when each fits: whether a workload is short enough for Lambda, how Lambda scales and fails, how API Gateway fronts it and when containers on ECS, EKS or Fargate are the better answer. The hands on detail is in the Lambda Execution Model and Cold Starts and ECS, EKS and Fargate Compared in the AWS in Practice course.
What Lambda is
AWS Lambda runs functions in response to events and charges for the number of requests and the duration of each, measured in milliseconds and scaled by the memory configured. There are no servers to patch, no capacity to plan and no cost when nothing runs. Functions are triggered by many sources: API Gateway and ALB requests, S3 events, SQS messages, SNS notifications, EventBridge rules and schedules, DynamoDB and Kinesis streams, Cognito triggers and direct invocations from code.
The limits that decide whether Lambda fits
Several hard limits rule Lambda in or out, and questions often depend on them. A single invocation can run for at most 15 minutes. Memory can be set from 128 MB to 10,240 MB, and CPU is allocated in proportion to memory, so raising memory also makes CPU bound functions faster. Ephemeral storage in /tmp can be configured up to 10 GB. The deployment package is limited to 50 MB zipped for direct upload and 250 MB unzipped including layers, while container images can be up to 10 GB. Synchronous request and response payloads are limited to 6 MB, and asynchronous event payloads to 256 KB in the classic limit, with larger payloads usually passed as S3 references.
If a job needs more than 15 minutes, such as a long video transcode or a large batch export, Lambda alone is the wrong answer; options are breaking the work into steps coordinated by Step Functions, running it on Fargate or AWS Batch, or using EC2. If a workload needs a GPU or specialised hardware, Lambda cannot provide it.
Concurrency and scaling
Lambda runs each concurrent request in a separate execution environment. Concurrency is the number of requests being handled at the same moment, roughly the request rate multiplied by the average duration. A function that takes 200 milliseconds and receives 500 requests per second needs about 100 concurrent environments. Lambda scales by creating environments as needed, up to the account's concurrency quota per Region, which is 1,000 by default and can be raised.
When the quota is reached, further synchronous invocations are throttled with a 429 error, and asynchronous ones are retried for a while. Because concurrency is shared by all functions in the account and Region, one runaway function can starve the others. Reserved concurrency sets aside part of the pool for a function and also caps it at that value, which protects both critical functions and downstream systems: a function with reserved concurrency of 50 never runs more than 50 copies, so it cannot open more than 50 database connections. Setting reserved concurrency to zero stops a function from running at all, a quick way to halt a misbehaving function.
Cold starts
When Lambda creates a new execution environment, it downloads the code, starts the runtime and runs the function's initialisation code outside the handler. This cold start adds latency, from under a hundred milliseconds for small functions to several seconds for large packages, heavy frameworks or some runtimes. Later requests reuse the warm environment and skip initialisation, which is why database connections and SDK clients should be created outside the handler.
Provisioned concurrency keeps a chosen number of environments initialised and ready, removing cold starts for that many concurrent requests at an hourly cost. It can be scheduled or scaled with Application Auto Scaling, for example raised during business hours. Lambda SnapStart, for supported runtimes, takes a snapshot of an initialised environment and restores from it, greatly reducing cold start time for heavy runtimes. When a question describes an API with strict latency requirements that suffers occasional slow responses from Lambda, provisioned concurrency is the usual answer.
Lambda in a VPC
By default, functions run in a Lambda managed network with internet access but no access to private resources in your VPC. Configuring a function with VPC subnets and security groups lets it reach private resources such as RDS databases or ElastiCache clusters. A function attached to a VPC loses default internet access; to call public APIs it needs a route through a NAT gateway, or VPC endpoints for AWS services such as S3, DynamoDB and Secrets Manager. When a question says a Lambda function moved into a VPC can no longer reach an external API or AWS service, the missing NAT gateway or endpoint is the answer.
Permissions
Each function has an execution role that grants what the function's code can do, such as reading a DynamoDB table or writing to a queue. Separately, a resource based policy on the function controls who may invoke it, such as API Gateway, S3 or another account. Questions that describe an S3 event that never invokes a function, or a function that gets AccessDenied when calling a service, are testing which of these two policies is missing.
Memory, CPU and performance tuning
Because Lambda allocates CPU in proportion to memory, a function that is slow at 128 MB may become several times faster at 1,024 MB, and because billing is memory multiplied by duration, the faster run can cost the same or less. At about 1,769 MB a function receives the equivalent of one full vCPU, and above that it gets more cores, which only helps code that uses several threads. Tools such as Lambda Power Tuning run a function at several memory sizes and show the cost and speed of each, which is the usual way to find the best setting. When a question asks how to make a CPU bound function faster with no code change, increasing memory is the answer.
Packaging, layers and container images
Layers hold shared libraries, runtimes or configuration that several functions use, so each function's own package stays small and updates to shared code happen in one place. A function can use up to five layers, and the total unzipped size, including layers, must stay within 250 MB. When dependencies are larger, such as machine learning libraries, packaging the function as a container image of up to 10 GB removes the limit while keeping the Lambda execution model. Container image functions must implement the Lambda runtime interface, which the AWS base images already include.
Versions, aliases and safe deployments
Publishing a version freezes a function's code and configuration under a number. An alias, such as prod, points to a version and can split traffic between two versions with weights, so a new version receives ten percent of invocations before it receives all of them. CodeDeploy automates this with canary or linear traffic shifting and rolls back automatically if CloudWatch alarms fire. Event sources and API Gateway integrations should point to aliases rather than to unqualified function names, so a deployment changes the alias and nothing else.
Graviton and architecture choice
Functions can run on x86 or on arm64 processors based on AWS Graviton. Arm64 functions cost less per unit of duration and often run faster for the same memory, so switching interpreted code such as Python or Node.js is usually a free saving. Compiled dependencies must be built for arm64, which is the main reason a team might stay on x86.
Account quotas and bursts
Besides the concurrency quota, Lambda limits how quickly concurrency can grow for each function, adding up to a thousand environments every ten seconds. Very sudden bursts beyond that are throttled briefly even when the account quota has room. For predictable bursts, provisioned concurrency arranged in advance avoids this, and an SQS queue in front of the function smooths bursts that do not need an immediate response.
A Lambda invocation cannot run longer than 15 minutes. For longer jobs, split the work with Step Functions or run it on Fargate, AWS Batch or EC2.