SOA-C02 Question 70
Select 3You are designing an application on AWS that processes customer requests in a scalable and fault-tolerant manner. You need to ensure the architecture follows a loosely coupled design so that components can function independently and handle partial failures gracefully. Which of the following approaches would best support this requirement?
- A
Use Amazon SQS to decouple the communication between application components.
- B
Directly connect the frontend application to the backend database using tightly integrated APIs.
- C
Leverage Amazon SNS to fan out messages to multiple subscribing services.
- D
Deploy the application components in a single Amazon EC2 instance to reduce latency.
- E
Use AWS Lambda to process messages from an Amazon SQS queue.
Show answer and explanation
Correct answers: A, C, E
Explanation
To implement a loosely coupled architecture, it is essential to decouple components so they can operate independently and handle partial failures gracefully. Amazon SQS is a key service for asynchronous message communication, while Amazon SNS provides a publish/subscribe mechanism for distributing messages to multiple systems. AWS Lambda can further enhance loose coupling by processing messages from SQS without requiring a dedicated server, ensuring scalability and fault tolerance. Avoid tightly integrating components or deploying them in a monolithic manner, as these approaches contradict the principles of loose coupling.
- A. Correct.
Using Amazon SQS is a best practice for creating loosely coupled architectures. It decouples components by allowing them to communicate asynchronously through a message queue, ensuring scalability and fault tolerance.
- B. Incorrect.
Directly connecting the frontend application to the backend database using tightly integrated APIs creates a tightly coupled design, which is the opposite of a loosely coupled architecture.
- C. Correct.
Amazon SNS enables a publish/subscribe model that fans out messages to multiple services, promoting loose coupling by allowing subscribers to act independently.
- D. Incorrect.
Deploying all application components in a single Amazon EC2 instance creates a monolithic architecture, which introduces tight coupling and a single point of failure.
- E. Correct.
AWS Lambda integrates well with Amazon SQS and can process messages from the queue, promoting loose coupling by separating the message producer from the message consumer.