AWS Certified Developer – Associate (DVA-C02) — Question 368
A developer is building an ecommerce application. When there is a sale event, the application needs to concurrently call three third-party systems to record the sale. The developer wrote three AWS Lambda functions. There is one Lambda function for each third-party system, which contains complex integration logic.
These Lambda functions are all independent. The developer needs to design the application so each Lambda function will run regardless of others' success or failure.
Which solution will meet these requirements?
Answer options
- A. Publish the sale event from the application to an Amazon Simple Queue Service (Amazon SQS) queue. Configure the three Lambda functions to poll the queue.
- B. Publish the sale event from the application to an Amazon Simple Notification Service (Amazon SNS) topic. Subscribe the three Lambda functions to be triggered by the SNS topic.
- C. Publish the sale event from the application to an Application Load Balancer (ALB). Add the three Lambda functions as ALB targets.
- D. Publish the sale event from the application to an AWS Step Functions state machine. Move the logic from the three Lambda functions into the Step Functions state machine.
Correct answer: B
Explanation
Amazon SNS supports a publish/subscribe (pub/sub) pattern that enables a single event message to be fanned out to multiple subscribers concurrently, ensuring each Lambda function runs independently. Amazon SQS is a point-to-point queuing service where consumers compete for messages, meaning only one Lambda would process each event. Application Load Balancer and AWS Step Functions are not designed for simple pub/sub fan-out of independent Lambda invocations without unnecessary complexity or architectural misalignment.