Q59 — AWS SAA-C03 Ch.12
Question 59 of 100 | ← Chapter 12
Q859. A company is designing an event-driven order processing system. Each order requires multiple validation steps after the order is created. An idempotent AWS Lambda function performs each validation step. Each validation step is independent from the other validation steps. Individual validation steps need only a subset of the order event information.The company wants to ensure that each validation step Lambda function has access to only the information from the order event that the function requires. The components of the order processing system should be loosely coupled to accommodate future business changes.Which solution will meet these requirements?
- A. 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.
- B. 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.
- C. 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. ✓
- D. 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.
Correct Answer: C. 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.
Explanation
To meet the requirements of designing an event-driven order processing system with loosely coupled components and ensuring that each validation step Lambda function has access to only the required information from the order event, the recommended solution is:C. 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.Here's why:Option C suggests creating an Amazon EventBridge event bus and configuring event rules for each validation step. By using EventBridge, you can decouple the components of the order processing system and ensure that each validation step Lambda function receives only the necessary information from the order event.With this solution, you can define separate event rules for each validation step, specifying the required data transformation and filtering using the input transformer. This allows you to customize and send only the relevant subset of data from the order event to each target Lambda function. By providing selective access to the required information, you can optimize the performance and resource usage of each validation step.EventBridge provides a flexible and scalable event-routing capability, allowing you to integrate multiple event sources and targets. It enables you to connect and coordinate disparate services and components with ease, making it suitable for building loosely coupled systems that can accommodate future business changes.Option A suggests creating an Amazon Simple Queue Service (Amazon SQS) queue for each validation step and using a new Lambda function to transform the order data and publish messages to the appropriate SQS queues. While this approach provides decoupling, it introduces additional complexity by requiring separate queues and a transformation Lambda function.Option B suggests using Amazon Simple Notification Service (Amazon SNS) with message body filtering to send only the required data to each subscribed Lambda function. While SNS provides fan-out messaging, it is primarily designed for pub/sub scenarios and may not provide the fine-grained control over data transformation and filtering that is required for this use case.Option D suggests using Amazon SQS with a transformation Lambda function to perform synchronous invocations of the validation step Lambda functions in parallel. This approach tightly couples the processing steps and introduces synchronous behavior, which may not be ideal for an event-driven system. It also adds complexity by requiring separate threads and managing parallel invocations.In summary, the recommended solution is to create an Amazon EventBridge event bus, define event rules for each validation step, and configure the input transformer to send only the required data to each target validation step Lambda function. This solution provides loose coupling, selective data access, and flexibility for future changes in the order processing system.