SAA-C03 Question 188
Select 3Your company is designing a distributed e-commerce application that must handle spikes in traffic during sales events. The application consists of multiple microservices responsible for user authentication, inventory management, and order processing. To ensure scalability, fault tolerance, and decoupling between these microservices, which of the following design patterns should you implement?
- A
Use an Amazon SQS queue between the order processing and inventory management microservices to decouple them.
- B
Directly invoke the inventory management microservice from the order processing microservice using synchronous API calls.
- C
Implement an Amazon SNS topic to publish order status updates to multiple subscribers, such as email notifications and a dashboard service.
- D
Use an Amazon RDS database with a single read replica to manage state sharing between the microservices.
- E
Implement AWS Step Functions to coordinate the workflow for order processing across multiple microservices.
Show answer and explanation
Correct answers: A, C, E
Explanation
Distributed design patterns focus on scalability, fault tolerance, and decoupling. By using Amazon SQS, Amazon SNS, and AWS Step Functions, the microservices in the e-commerce application can communicate asynchronously, handle spikes in traffic efficiently, and remain loosely coupled. Synchronous API calls and shared databases are not recommended for distributed architectures as they introduce dependencies and potential failure points.
- A. Correct.
This is correct. Using an Amazon SQS queue allows you to decouple microservices, ensuring scalability and fault tolerance by enabling asynchronous communication.
- B. Incorrect.
This is incorrect. Synchronous API calls create tight coupling between microservices, reducing scalability and increasing the risk of cascading failures.
- C. Correct.
This is correct. Amazon SNS topics are ideal for broadcasting messages to multiple subscribers, ensuring scalability and decoupling for tasks like sending notifications or updating dashboards.
- D. Incorrect.
This is incorrect. Using a shared database for state sharing increases coupling between microservices and introduces potential bottlenecks, which is against distributed design best practices.
- E. Correct.
This is correct. AWS Step Functions help orchestrate workflows across multiple microservices, ensuring fault tolerance and simplifying the coordination of distributed tasks.