10.3 Amazon API Gateway: REST APIs vs HTTP APIs vs WebSocket APIs (Week 10 โข Serverless Architecture (D3: High-Performing 24%))
Core AWS Services: Amazon API Gateway, Amazon Cognito, AWS WAF
1. AWS Architectural Concept & Mechanics
Amazon API Gateway: REST APIs vs HTTP APIs vs WebSocket APIs (Serverless Architecture (D3: High-Performing 24%) โข AWS Services: Amazon API Gateway, Amazon Cognito, AWS WAF) covers HTTP API (v2: low latency, ~70% cheaper, native OIDC/JWT & CORS, ideal simple Lambda/HTTP proxy) vs REST API (v1: full enterprise features โ API Keys & Usage Plans, Response Caching 0.5โ237 GB TTL 0โ3600s, AWS WAF integration, Private VPC Endpoint APIs, Request Schema Validation, VTL mapping, Canary release!) vs WebSocket API (stateful bidirectional chat/dashboards), plus Security (IAM SigV4 for internal AWS services, Cognito User Pools for mobile/web users, Lambda Authorizer for custom 3rd-party OAuth/Bearer tokens with cached policy!). In real-world AWS Solutions Architecture and on the SAA-C03 exam, architects apply this pattern for: Choosing **API Gateway REST API** when B2B partners require **per-tier API Keys + Usage Plans (quotas/throttling) + AWS WAF + Response Caching**, vs choosing **HTTP API** to cut API Gateway spend by 70% for a simple JWT-authenticated Lambda backend! Evaluating security least-privilege, Multi-AZ fault isolation, performance scaling, and monthly FinOps cost side-by-side ensures every design decision is defensible.
2. Real-World AWS & SAA-C03 Scenario Use Case
Choosing API Gateway REST API when B2B partners require per-tier API Keys + Usage Plans (quotas/throttling) + AWS WAF + Response Caching, vs choosing HTTP API to cut API Gateway spend by 70% for a simple JWT-authenticated Lambda backend!
3. Granular Subtopics & Architecture Checkpoints
- HTTP API (v2: low latency: Core AWS architecture capability of Amazon API Gateway: REST APIs vs HTTP APIs vs WebSocket APIs: Choosing API Gateway REST API when B2B partners require per-tier API Keys + Usage Plans (quotas/throttling) + AWS WAF + Response Caching, vs choosing HTTP API to cut API Gateway spend by 70% for a simple JWT-authenticated Lambda backend!
- ~70% cheaper: Understand how '~70% cheaper' impacts Multi-AZ resilience, security, performance, and cost in Amazon API Gateway: REST APIs vs HTTP APIs vs WebSocket APIs.
- Native OIDC/JWT & CORS: Understand how 'Native OIDC/JWT & CORS' impacts Multi-AZ resilience, security, performance, and cost in Amazon API Gateway: REST APIs vs HTTP APIs vs WebSocket APIs.
- SAA-C03 Exam Trap & Architecture Guardrail (Amazon API Gateway: REST APIs vs HTTP APIs vs WebSocket APIs): Avoid high-frequency exam & production mistake: Choosing HTTP API when the SAA-C03 requirement explicitly asks for Usage Plans with API Keys, built-in Response Caching, Private VPC-only API, or AWS WAF attachment โ those require API Gateway REST API!
- Guided AWS Practical Lab (Amazon API Gateway: REST APIs vs HTTP APIs vs WebSocket APIs): Build an API Gateway endpoint integrated via AWS_PROXY with your Python 3.12 Lambda function and test 429 Too Many Requests throttling.
- Cost Control & Mandatory Post-Lab Resource Cleanup: Do NOT enable API Gateway Stage Cache ($0.02+/hr) in Free Tier; delete test API stage if unused.
4. Reference Secret-Free AWS CLI / Policy / IaC Blueprint
# Need API Keys/Usage Plans, Response Caching, Private API, or AWS WAF? -> REST API | Need 70% cheaper simple JWT+Lambda proxy? -> HTTP API
5. Common SAA-C03 Exam Traps & Production Anti-Patterns
- Choosing HTTP API when the SAA-C03 requirement explicitly asks for Usage Plans with API Keys, built-in Response Caching, Private VPC-only API, or AWS WAF attachment โ those require API Gateway REST API!
- Leaving billable AWS lab resources running instead of executing post-lab cleanup: Do NOT enable API Gateway Stage Cache ($0.02+/hr) in Free Tier; delete test API stage if unused.
- Hardcoding static IAM access keys or ignoring Multi-AZ / KMS / Least-Privilege boundaries when designing Amazon API Gateway: REST APIs vs HTTP APIs vs WebSocket APIs.
6. Guided AWS Practical Lab & Mandatory Cost Cleanup
Hands-On Lab: Build an API Gateway endpoint integrated via AWS_PROXY with your Python 3.12 Lambda function and test 429 Too Many Requests throttling.
Cost & Post-Lab Cleanup Warning: Do NOT enable API Gateway Stage Cache ($0.02+/hr) in Free Tier; delete test API stage if unused.
7. Cloud Architect Interview & Scenario Viva Questions
- Q: In an AWS SAA-C03 scenario or Cloud Architect interview, when do you choose Amazon API Gateway: REST APIs vs HTTP APIs vs WebSocket APIs (Amazon API Gateway, Amazon Cognito, AWS WAF), and what problem does it solve?
Architect Focus: Choosing API Gateway REST API when B2B partners require per-tier API Keys + Usage Plans (quotas/throttling) + AWS WAF + Response Caching, vs choosing HTTP API to cut API Gateway spend by 70% for a simple JWT-authenticated Lambda backend! Avoid classic SAA-C03 trap: Choosing HTTP API when the SAA-C03 requirement explicitly asks for Usage Plans with API Keys, built-in Response Caching, Private VPC-only API, or AWS WAF attachment โ those require API Gateway REST API! - Q: Walk through the architectural mechanics, security boundaries, and pricing trade-offs of Amazon API Gateway: REST APIs vs HTTP APIs vs WebSocket APIs.
Architect Focus: Explain HTTP API (v2: low latency, ~70% cheaper, native OIDC/JWT & CORS, ideal simple Lambda/HTTP proxy) vs REST API (v1: full enterprise features โ API Keys & Usage Plans, Response Caching 0.5โ237 GB TTL 0โ3600s, AWS WAF integration, Private VPC Endpoint APIs, Request Schema Validation, VTL mapping, Canary release!) vs WebSocket API (stateful bidirectional chat/dashboards), plus Security (IAM SigV4 for internal AWS services, Cognito User Pools for mobile/web users, Lambda Authorizer for custom 3rd-party OAuth/Bearer tokens with cached policy!) across availability, performance, security, and cost pillars. - Q: How did you verify Amazon API Gateway: REST APIs vs HTTP APIs vs WebSocket APIs hands-on in AWS and ensure zero unexpected billing afterward?
Architect Focus: Lab verification: Build an API Gateway endpoint integrated via AWS_PROXY with your Python 3.12 Lambda function and test 429 Too Many Requests throttling. | Cost & Cleanup Guardrail: Do NOT enable API Gateway Stage Cache ($0.02+/hr) in Free Tier; delete test API stage if unused.