How can the developer inspect the timing of the DynamoDB API calls?
Add DynamoDB as an event source to the Lambda function. View the performance with Amazon CloudWatch metrics
Place an Application Load Balancer (ALB) in front of the two DynamoDB tables. Inspect the ALB logs
Limit Lambda to no more than five concurrent invocations. Monitor from the Lambda console.
Enable AWS X-Ray tracing for the function. View the traces from the X-Ray service.
Explanations:
Adding DynamoDB as an event source for Lambda triggers the function on DynamoDB events, but does not provide insights into the timing of API calls or performance metrics. CloudWatch metrics alone do not offer detailed tracing of individual API call times.
An Application Load Balancer (ALB) cannot be placed in front of DynamoDB tables. ALBs are used to route HTTP/HTTPS traffic, not to interact with DynamoDB tables, so this option is not feasible.
Limiting Lambda concurrency might control function execution rate but does not provide detailed performance data on DynamoDB API calls or timing information. The Lambda console offers basic metrics but lacks detailed tracing for API calls.
AWS X-Ray provides tracing and performance data, including detailed timing for DynamoDB API calls, allowing the developer to identify bottlenecks in the function’s execution.