SAP-C02 Question 402
Select 4An organization needs to ensure that their newly developed serverless application, deployed using AWS Lambda, follows best practices for monitoring, logging, and error handling. Their application processes high-throughput data streams from Amazon Kinesis Data Streams. The team also wants to minimize operational overhead while ensuring the application is resilient to failures. Which combination of actions should the organization take to achieve this?
- A
Enable AWS X-Ray tracing for the Lambda functions to monitor performance and trace execution.
- B
Configure the Lambda function to use reserved concurrency to prevent overloading downstream services.
- C
Use Amazon CloudTrail to capture and store detailed application logs.
- D
Implement a dead-letter queue (DLQ) for the Lambda function to capture failed events.
- E
Directly log all application errors to Amazon S3 using the Lambda function's built-in logging capabilities.
- F
Enable enhanced fan-out for the Kinesis Data Stream to improve data processing throughput.
Show answer and explanation
Correct answers: A, B, D, F
Explanation
To follow best practices for monitoring, logging, and error handling in a high-throughput serverless application, enabling AWS X-Ray provides visibility into performance. Configuring reserved concurrency prevents downstream service overload. Using a dead-letter queue ensures failed events are captured for analysis and reprocessing. Finally, enabling enhanced fan-out for Kinesis Data Streams improves data processing throughput, supporting the application's scalability and performance requirements. CloudTrail and Amazon S3 are not suitable for detailed application monitoring or logging in this scenario.
- A. Correct.
Enabling AWS X-Ray tracing is a best practice for monitoring and troubleshooting Lambda functions. It provides insights into performance and execution traces, making it easier to debug and optimize the application.
- B. Correct.
Configuring reserved concurrency for the Lambda function ensures that the application does not overwhelm downstream services during high traffic, maintaining system stability.
- C. Incorrect.
While Amazon CloudTrail captures API activity, it is not intended for detailed application logging. Amazon CloudWatch Logs is the appropriate service for Lambda function logs.
- D. Correct.
A dead-letter queue (DLQ) captures events that fail to process, allowing for debugging and reprocessing, which is a crucial component of error handling and resilience.
- E. Incorrect.
Amazon S3 is not a logging service. Lambda function logs should be sent to Amazon CloudWatch Logs by default, and additional custom logging can be implemented if needed.
- F. Correct.
Enhanced fan-out for Kinesis Data Streams allows dedicated throughput for consumers, reducing latency and improving performance for high-throughput applications.