Which solution will meet these requirements?
Create an Amazon Simple Queue Service (Amazon SQS) queue for each validation step. Create a new Lambda function to transform the order data to the format that each validation step requires and to publish the messages to the appropriate SQS queues. Subscribe each validation step Lambda function to its corresponding SQS queue.
Create an Amazon Simple Notification Service (Amazon SNS) topic. Subscribe the validation step Lambda functions to the SNS topic. Use message body filtering to send only the required data to each subscribed Lambda function.
Create an Amazon EventBridge event bus. Create an event rule for each validation step. Configure the input transformer to send only the required data to each target validation step Lambda function.
Create an Amazon Simple Queue Service (Amazon SQS) queue. Create a new Lambda function to subscribe to the SQS queue and to transform the order data to the format that each validation step requires. Use the new Lambda function to perform synchronous invocations of the validation step Lambda functions in parallel on separate threads.
Explanations:
This solution uses multiple SQS queues and a new Lambda function to transform data before sending it to each validation step. While this approach can work, it adds unnecessary complexity and tight coupling due to the extra Lambda transformation step. This approach is not as loosely coupled as needed.
SNS message body filtering can limit the data sent to each Lambda function. However, SNS is typically used for broadcasting messages to many recipients, and using it here can lead to complexity when trying to selectively send only the necessary data to each validation function. It’s not the most efficient or flexible approach for this scenario.
EventBridge is an event-driven service designed to handle such scenarios. Using EventBridge with input transformers allows the system to send only the required data to each Lambda function. This approach is decoupled, scalable, and efficient, meeting the requirement of loosely coupled components while ensuring each Lambda gets only the data it needs.
This solution introduces unnecessary complexity by creating a new Lambda to transform data and invoking each validation step Lambda function synchronously in parallel. This adds unnecessary management and performance overhead, making it a less efficient and flexible solution than EventBridge.