AWS Certified Solutions Architect – Associate (SAA-C03) — Question 907
A company is migrating from a monolithic architecture for a web application that is hosted on Amazon EC2 to a serverless microservices architecture. The company wants to use AWS services that support an event-driven, loosely coupled architecture. The company wants to use the publish/subscribe (pub/sub) pattern.
Which solution will meet these requirements MOST cost-effectively?
Answer options
- A. Configure an Amazon API Gateway REST API to invoke an AWS Lambda function that publishes events to an Amazon Simple Queue Service (Amazon SQS) queue. Configure one or more subscribers to read events from the SQS queue.
- B. Configure an Amazon API Gateway REST API to invoke an AWS Lambda function that publishes events to an Amazon Simple Notification Service (Amazon SNS) topic. Configure one or more subscribers to receive events from the SNS topic.
- C. Configure an Amazon API Gateway WebSocket API to write to a data stream in Amazon Kinesis Data Streams with enhanced fan-out. Configure one or more subscribers to receive events from the data stream.
- D. Configure an Amazon API Gateway HTTP API to invoke an AWS Lambda function that publishes events to an Amazon Simple Notification Service (Amazon SNS) topic. Configure one or more subscribers to receive events from the topic.
Correct answer: D
Explanation
Amazon SNS is the ideal AWS service for implementing a publish/subscribe (pub/sub) pattern to decouple microservices. When comparing the SNS options, Amazon API Gateway HTTP APIs are significantly more cost-effective and offer lower latency than REST APIs, making Option D the most budget-friendly choice. SQS (Option A) is a message queuing service rather than a pub/sub service, and Kinesis (Option C) is designed for data streaming and is more expensive.