A company is migrating a monolithic web application on Amazon EC2 to a serverless microservices architecture and wants an event-driven, loosely coupled design using the publish/subscribe pattern. Which solution is the most cost-effective?
Choose an answer
Tap an option to check your answer.
Correct answer: 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..
Why this is the answer
The most cost-effective solution uses Amazon API Gateway HTTP API, which is cheaper than REST API, and Amazon SNS for the publish/subscribe pattern. HTTP API offers lower latency and cost compared to REST API for simple proxy integrations. AWS Lambda processes the API request and publishes messages to an SNS topic. SNS is a fully managed pub/sub messaging service, ideal for fan-out to multiple subscribers, and is generally more cost-effective for this pattern than SQS for direct fan-out or Kinesis Data Streams for event delivery. SQS is a queueing service, not a pub/sub service, and would require additional logic for fan-out. Kinesis Data Streams is designed for real-time data processing and analytics, making it overkill and more expensive for a simple event-driven pub/sub pattern.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed