A company is building a serverless application using AWS Lambda and Amazon DynamoDB. The Lambda function processes user uploads from Amazon S3 and stores metadata in DynamoDB. The function is experiencing high latency during peak hours. Which action would MOST improve the performance without increasing the function timeout?
Increasing the DynamoDB table's provisioned read and write capacity directly addresses performance bottlenecks caused by insufficient throughput. When a Lambda function attempts to write or read data faster than the table's allocated capacity, DynamoDB throttles these requests, resulting in `ProvisionedThroughputExceededException` errors and increased latency. By raising the provisioned capacity units, the table can handle a higher volume of operations per second, preventing throttling and ensuring consistent, low-latency data access for the serverless application.
Why this answer
Increasing the DynamoDB table's provisioned read and write capacity directly addresses the root cause of high latency during peak hours: throttling due to insufficient throughput. When the Lambda function's write requests exceed the table's capacity, DynamoDB throttles them, causing retries and increased latency. Raising the capacity allows DynamoDB to handle the burst of metadata writes without throttling, reducing response times without requiring a longer function timeout.
Exam trap
The trap here is that candidates often confuse read optimization (DAX) with write optimization, or assume that increasing concurrency or improving network connectivity will fix a throughput bottleneck, when the actual issue is insufficient DynamoDB write capacity.
How to eliminate wrong answers
Option B is wrong because increasing Lambda reserved concurrency only ensures more concurrent function executions, but it does not resolve the bottleneck at the DynamoDB layer; if the table is throttling, more concurrent invocations will only increase the number of throttled requests and worsen latency. Option C is wrong because moving the Lambda function into a VPC with a DynamoDB VPC endpoint reduces network latency and avoids NAT gateway costs, but it does not address the throughput capacity of the DynamoDB table itself; the primary latency issue is throttling, not network path. Option D is wrong because DynamoDB Accelerator (DAX) is an in-memory cache for read-heavy workloads and does not improve write performance; the Lambda function is storing metadata (write operations), so DAX would not reduce write latency.