Bitzu

SAA-C03 ยท Decoupling and serverless patterns

Amazon API Gateway

REST versus HTTP versus WebSocket APIs, Lambda and HTTP integrations, throttling, usage plans and response caching.

Key points

  • API Gateway: APIs in front of Lambda, HTTP endpoints, AWS services.
  • REST API: API keys and usage plans (per-client throttling, quotas), response caching, AWS WAF, private endpoints.
  • HTTP API: leaner, cheaper, native JWT authorizers.
  • WebSocket API: two-way connection for chat, live updates.
  • Throttling: token bucket (rate plus burst), over limit 429 Too Many Requests.
  • Stage cache (REST): GET responses, TTL 300 s default, max 3,600 s.

Source: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html

Practice questions

Single choice

A chat app needs the server to push new messages to connected clients over a long-lived two-way connection. Which API Gateway API type fits?

  1. REST API
  2. HTTP API
  3. WebSocket API
  4. Edge-optimized endpoint
Show answer

Answer: C. WebSocket API

WebSocket APIs keep a persistent bidirectional connection so the backend can push messages to clients. REST and HTTP APIs follow a request/response model, and an edge-optimized endpoint is a REST endpoint type, not a connection model.

Select all that apply

Which features require a REST API rather than an HTTP API?

  1. Caching integration responses at the stage
  2. Integration with AWS Lambda functions
  3. Protecting the API with AWS WAF
  4. API keys combined with usage plans
  5. A native JWT authorizer
Show answer

Answer: A. Caching integration responses at the stage, C. Protecting the API with AWS WAF, D. API keys combined with usage plans

Response caching, AWS WAF integration and API keys with usage plans are REST API features. Lambda integrations work with both types, and native JWT authorizers are an HTTP API feature.

True or false

When you enable caching on a REST API stage, responses of every method, including POST and PUT, are cached by default.

Show answer

Answer: False

False. Enabling the stage cache turns on caching only for GET methods by default; other methods need an explicit method-level override, which is rarely wise for writes.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More SAA-C03 topics in this module