DOP-C02 Question 179
Select 2A company is building a serverless application on AWS to process images uploaded to an Amazon S3 bucket. The architecture involves the following steps: 1) Image files are uploaded to an S3 bucket. 2) An AWS Lambda function processes the images and stores the results in an Amazon DynamoDB table. 3) The processed images are then stored in another S3 bucket for further use. The company wants to ensure the solution is cost-effective, scalable, and follows AWS best practices. Which of the following configurations should you implement to meet the requirements?
- A
Configure the S3 bucket to trigger the Lambda function using S3 Event Notifications when an object is created.
- B
Use the Lambda function to directly write the processed images back to the destination S3 bucket.
- C
Enable DynamoDB Auto Scaling to handle variable workloads for storing metadata.
- D
Provision a fixed number of Lambda function instances to handle peak traffic.
- E
Leverage Amazon SQS as a decoupling mechanism between S3 and the Lambda function.
Show answer and explanation
Correct answers: A, C
Explanation
In a serverless architecture, it is best practice to use S3 Event Notifications to trigger Lambda functions for event-driven processing. Additionally, enabling DynamoDB Auto Scaling ensures the architecture is scalable to handle variable workloads. This combination adheres to AWS best practices for serverless applications, ensuring cost-effectiveness and scalability.
- A. Correct.
Configuring S3 Event Notifications is a cost-effective and scalable solution to trigger the Lambda function automatically when an object is created in the S3 bucket.
- B. Incorrect.
Directly writing processed images back to the destination S3 bucket using the Lambda function is not recommended as it can lead to bottlenecks if the function is handling multiple tasks.
- C. Correct.
Enabling DynamoDB Auto Scaling ensures that the database can handle variable workloads efficiently, which aligns with scalability requirements.
- D. Incorrect.
Provisioning a fixed number of Lambda function instances goes against the serverless model's core principle of automatic scaling.
- E. Incorrect.
Using Amazon SQS as a decoupling mechanism is unnecessary in this specific scenario because S3 Event Notifications can directly trigger the Lambda function efficiently.