Which solution will meet these requirements?
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.
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.
Publish the sale event from the application to an Application Load Balancer (ALB). Add the three Lambda functions as ALB targets.
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.
Explanations:
While using Amazon SQS would decouple the Lambda functions and allow them to process messages independently, it would require the functions to poll the queue, which may introduce delays in execution and does not guarantee immediate invocation upon event publication.
Using Amazon SNS allows the application to publish a sale event to a topic, which then triggers all subscribed Lambda functions concurrently. Each function runs independently, ensuring that the success or failure of one does not affect the others. This meets the requirement for concurrent execution regardless of others’ outcomes.
An Application Load Balancer (ALB) is not designed for directly invoking Lambda functions upon publishing an event. This approach does not support concurrent execution of the three Lambda functions based on a single event, and the integration is not suitable for asynchronous events like sales.
AWS Step Functions orchestrate the execution of Lambda functions in a defined sequence or parallel paths, but they introduce dependency between the functions. If one function fails, it could affect the execution flow, contrary to the requirement that each function should run independently of the others.