0%
AWS Developer Associate (DVA-C03) Exam Prep: Development, Security, Testing, Deployment and Troubleshooting
How the Exam Works
Domain 1: Development with AWS Services
Domain 2: Security
Domain 3: Testing and Deployment
New in DVA-C03: Containers and AI
Final Review and Mock Exams
Troubleshooting and Optimizing AWS Applications
The troubleshooting domain carries about 22 percent of DVA-C03, and much of the security and development content is tested through broken scenarios as well. A typical stem describes something that worked yesterday and fails today, or something that works in a test account and fails under load. Your job is to read the symptom, locate the component that produced it and choose the smallest change that fixes the cause rather than hiding it. This lesson builds that habit. It leans on the monitoring and tracing tools from the previous lesson, which owns CloudWatch metrics, alarms and X-Ray in detail, and uses them here as instruments rather than topics.
Start with who returned the error
Most AWS applications are chains: a client calls API Gateway, which invokes a Lambda function, which calls DynamoDB, S3 or another service through the SDK. An error at the end of the chain is usually reported to the client as something different. A DynamoDB throttle inside a Lambda function becomes an unhandled exception, which becomes a 502 from API Gateway, which the browser shows as a failed request. If you look only at the status code the client received, you will tune the wrong component.
The working method is to walk the chain from the deepest component outward. Check the downstream service metrics first (throttled requests on the table, errors on the function), then the function's logs, then the API Gateway execution or access logs. X-Ray, if it is enabled, shows the same chain as a trace with the failing segment marked, which is why exam answers about finding where latency or errors come from in a distributed application usually point to X-Ray.
What the status code tells you
AWS service APIs follow HTTP conventions, and the SDK maps the response to an exception with a name and a status code. The family of the code tells you who has to change something.
- A 4xx code means the request itself was rejected.
AccessDeniedException(403) means the caller's credentials lack permission.ValidationException(400) means a parameter is malformed, such as a missing key attribute.ResourceNotFoundExceptionmeans the table, function or queue does not exist in that Region or account, which is very often a Region mismatch in the client configuration.ConditionalCheckFailedExceptionis a 400 that your code asked for with a condition expression, so it is a business outcome, not a fault. - A 5xx code means the service failed to process a valid request. These are rare from AWS services themselves and are safe to retry for idempotent operations.
- Throttling sits in between. Depending on the service it arrives as a 400 with an exception name such as
ThrottlingException,ProvisionedThroughputExceededExceptionorRequestLimitExceeded, or as a 429TooManyRequestsException, which is what Lambda returns when a synchronous invoke exceeds available concurrency and what API Gateway returns when a stage or usage plan limit is hit.
The practical rule: retry throttles and 5xx errors with backoff; do not retry other 4xx errors, because the same request will fail the same way. Fix the policy, the parameter or the Region instead.
Throttling exceptions by service
Every AWS API has rate limits, and many developer questions describe an application that fails only at peak. The common sources are worth knowing by name.
- DynamoDB returns
ProvisionedThroughputExceededExceptionwhen a provisioned table or index exceeds its capacity, or when a single partition exceeds its own limit even though the table total is fine. On demand tables can also throttle when traffic jumps far past the previous peak very quickly or concentrates on one key. - Lambda throttles when the Region's concurrency limit or a function's reserved concurrency is exhausted. Synchronous callers get a 429. Asynchronous events are queued internally and retried, so throttling shows up as rising event age rather than an error to the caller.
- API Gateway applies account level limits per Region, stage and method throttling settings, and usage plan limits per API key, all returning 429.
- KMS has request quotas for cryptographic operations such as
DecryptandGenerateDataKey. An application that decrypts on every request at high volume can be throttled by KMS, and the usual fix is caching data keys or using an S3 Bucket Key to reduce calls. - Secrets Manager and SSM Parameter Store have API rate limits too, which is one reason to fetch secrets once per execution environment and cache them rather than on every invocation.
When the exam says requests fail intermittently with a throttling error and asks for the change that requires the least code, the answer is often an SDK retry setting or a cache, not a redesign.
How the SDK retries
The AWS SDKs retry throttling errors, transient network failures and most 5xx responses automatically. Current SDKs support retry modes: legacy, standard and adaptive. Standard mode uses exponential backoff with jitter and a default of three total attempts in most SDKs, and it uses a retry quota so a client facing a widespread outage stops retrying instead of multiplying the load. Adaptive mode adds client side rate limiting that slows the client down when it sees throttles, which suits a single process that is the main source of load on a resource.
You can set the mode and the number of attempts in code, in the shared config file or through environment variables, which makes it a configuration change rather than a code change.
Notice the timeouts in that example. The default SDK read timeout can be much longer than the time your function has left, so a slow downstream call can consume the whole Lambda timeout before the SDK gives up and retries. Setting explicit, short client timeouts lets the retry logic work inside your function's budget.
Backoff with jitter and idempotency
When you write your own retry loop, for example around a batch operation that returns UnprocessedItems or around a call to a third party API, use exponential backoff with jitter. The wait doubles after each failure up to a cap, and a random amount is added or the wait is drawn at random up to the computed value. Jitter matters because many clients throttled at the same moment would otherwise retry at the same moment, recreating the spike that caused the throttle.
Retries are only safe when the operation is idempotent: running it twice has the same effect as running it once. Reads are naturally idempotent. A PutItem with the full item is idempotent. An UpdateItem that adds 1 to a counter is not, and neither is "charge the card". For those, pass a client token where the API supports one (many AWS create calls accept ClientRequestToken or similar), use a DynamoDB condition expression that fails if the work was already recorded, or store an idempotency key and check it before doing the work. Lambda Powertools provides an idempotency utility built on a DynamoDB table for this purpose.
When retries make things worse
Retries are a cure for transient faults and a poison for sustained overload. If a table is under provisioned by half, retrying every throttled write doubles the request rate and the throttling gets worse. Signs that you are past what retries can fix: the throttle metric is flat and high rather than spiky, latency rises steadily, and retry counts grow over minutes. The fix then is capacity (switch to on demand, raise provisioned capacity, raise reserved concurrency), smoothing (put an SQS queue in front of the writer and control the consumer rate) or less demand (cache reads, batch writes).
A worked example ties this together. An order API works in testing, but during a flash sale about 3 percent of requests return 502. The Lambda logs show ProvisionedThroughputExceededException from DynamoDB, the table's consumed write capacity sits at its provisioned value for twenty minutes, and the SDK is already retrying. The right first change is capacity: on demand mode or auto scaling with enough headroom, followed by a queue if the writes can be asynchronous. Raising the API Gateway timeout, adding Lambda memory or increasing retry attempts would not address a table that is simply full.
One more signal helps here. If the throttle errors are concentrated in one function, one table or one API key while everything else is healthy, the problem is local and a targeted change to that resource is the answer. If every service in the account starts throttling at once, look for an account level quota or a runaway client, such as a retry loop with no backoff, before changing any single resource.
Throttling questions test whether you can separate a transient spike, which retries with backoff fix, from sustained overload, which only more capacity, a queue or less demand can fix.