Which API Gateway Type Is Most Cost-Effective for SNS Pub/Sub?

SAA-C03 By islever Editorial Last updated

Short answer

D Configure an API Gateway HTTP API to invoke Lambda to publish to an SNS topic, because HTTP APIs cost less than REST APIs for this pub/sub design.

Question

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?
  1. 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.
  2. 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.
  3. 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.
  4. 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

Key Takeaways

Tests whether you can distinguish API Gateway HTTP API from REST API when a pure SNS pub/sub workload has no REST-only feature requirements; the common trap is choosing REST out of habit despite higher cost.

A serverless migration that needs event-driven pub/sub can use API Gateway, Lambda, and SNS. This page establishes why option D, the HTTP API variant, is the most cost-effective implementation of that pattern.

Common mistake: Many candidates pick B because REST APIs are the familiar default for Lambda integration, but it costs more and adds features not required by the pub/sub requirement.

Expert Analysis

Why the Answer Is Correct

Option D satisfies every stated requirement: API Gateway HTTP API invokes Lambda, Lambda publishes events to an SNS topic, and subscribers receive them in a pub/sub pattern. HTTP APIs were designed as a lower-cost, lower-latency alternative to REST APIs for exactly this kind of straightforward proxy and event use case. Because the question asks for the MOST cost-effective solution and does not request REST-only capabilities, D is preferred over B. The community pricing discussion reinforces that the per-request gap is material.

Why the Other Options Are Wrong

Option B is functionally valid—REST API → Lambda → SNS also implements pub/sub—but it uses the more expensive API Gateway REST API without a requirement that justifies it. Option A uses SQS, which is a queue (point-to-point) rather than pub/sub; multiple subscribers reading the same queue is competing-consumer behavior, not independent pub/sub delivery. Option C uses API Gateway WebSocket API and Kinesis Data Streams with enhanced fan-out, adding unnecessary streaming complexity and cost for simple event fan-out to subscribers. None of these matches the combination of pub/sub semantics and lowest cost as directly as D.

Community Comment Notes

Commenters split mainly between B and D, with the cost argument favoring D. tomasmolinari noted that HTTP APIs offer "lower latency and lower cost than REST APIs", and 78b9037 stated bluntly that "HTTP API is cheaper." jingen11 emphasized that "Http api offers everything the requirements asked for" including Lambda and event-driven behavior. LeonSauveterre agreed SNS fits pub/sub and saw D as plausible, though he called REST API more conventional; Denise123 countered that REST may be more cost-effective for complex apps with extra requirements, which this question does not describe. Taken together, the comments support D when the only differentiator is price and no REST-only features are needed.

Official Reference

Exam Strategy

When "MOST cost-effectively" appears with no REST-only API Gateway feature called out, compare HTTP API against REST API and favor HTTP API. Confirm the functional pattern is satisfied—here SNS pub/sub—before optimizing on API Gateway price.

Frequently Asked Questions

Why is HTTP API cheaper than REST API for SNS pub/sub?

AWS designed HTTP APIs with fewer features and lower per-request pricing; this scenario needs only Lambda invocation and SNS delivery, so those REST-only features add cost without value.

Does option B become correct if the app needs REST-only features?

Yes; REST APIs support API keys, per-client throttling, request validation, AWS WAF, and private endpoints. The question specifies none of those, so HTTP API remains the most cost-effective answer.

More SAA-C03 FAQ →

Community Votes

D
64%
B
36%

64% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 12 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 12

  1. 78b9037 👍 2 Answered D
    HTTP API is cheaper. The difference in pricing is steep. REST APIs will run you USD $3.50 per one million requests plus charges for data transferred out. By contrast, HTTP APIs cost a mere $1.00 per request for the first million requests and then $0.90 per million requests after that.
  2. tomasmolinari 👍 2 Answered D
    "HTTP APIs enable you to create RESTful APIs with lower latency and lower cost than REST APIs." HTTP APIs are more cost-effective than REST APIs
  3. jingen11 👍 2 Answered D
    Question ask for cheapest. Http api offers everything the requirements asked for. i.e Lambda function for serverless, event driven.
  4. dhewa 👍 2 Answered B
    An HTTP API instead might not be necessary for this use case.
  5. Denise123 👍 1 Answered B
    While the Amazon API Gateway HTTP API (Option D) can be more cost-effective for simple APIs with low data transfer and minimal feature requirements, the Amazon API Gateway REST API (Option B) may still be more cost-effective in many real-world scenarios, especially for more complex web applications with additional requirements. The choice between Options B and D should be based on a careful evaluation of your specific requirements, existing infrastructure, and potential cost savings or trade-offs involved.
Show 7 more comments
  1. LeonSauveterre 👍 1 Answered B
    Amazon SNS is perfectly designed to support the pub/sub pattern efficiently. So B or D. About option D: Using an HTTP API instead of a REST API is less common when using SNS for event publishing. Typically, REST APIs in API Gateway are used for interacting with Lambda functions, making option B a more conventional choice. That said, scenarios vary based on your actual, detailed needs, like predicted frequencies and costs. For the SAA exam, I'll definitely go with B.
  2. tch 👍 1
    REST APIs and HTTP APIs are both RESTful API products. REST APIs support more features than HTTP APIs, while HTTP APIs are designed with minimal features so that they can be offered at a lower price. Choose REST APIs if you need features such as API keys, per-client throttling, request validation, AWS WAF integration, or private API endpoints. Choose HTTP APIs if you don't need the features included with REST APIs.
  3. fis_examtopic 👍 1
    HTTP APIs with Lambda. I'm go with D
  4. pujithacg8 👍 2
    B or D, Will go with B
  5. muhammadahmer36 👍 2 Answered D
    D is the right answer
  6. progounick 👍 1 Answered B
    rest is cheaper than http
  7. jfedotov 👍 1 Answered D
    Http api

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Practice All SAA-C03 Questions

Access 120 questions with complete answers and detailed explanations.

View Full SAA-C03 Practice Test →

← Back to SAA-C03 Study Guide