CloudGuild · Blog · Cheat sheets · Lessons · Certifications
Amazon API Gateway — Managed API service
Amazon API Gateway simplifies the creation, publication, and management of APIs at scale.
What it is
- A fully managed service that facilitates the creation, deployment, and management of RESTful APIs and WebSocket APIs.
- Handles tasks like traffic management, authorization, access control, monitoring, and API version management.
When I reach for it
- When building serverless applications using AWS Lambda.
- To expose backend services to external consumers securely.
- When needing to manage multiple API versions or stages efficiently.
Key architectural decisions
- Choose between REST APIs and WebSocket APIs based on use case.
- Decide on regional or edge-optimized endpoints based on latency requirements.
- Configure throttling and caching settings to optimize performance and cost.
- Implement security measures like AWS IAM, API keys, or Cognito for authorization.
Gotchas & exam traps
- Be aware of the different pricing models (e.g., requests, data transfer).
- Understand the limit on the number of API keys and usage plans.
- Remember to account for CORS configuration when exposing APIs to web browsers.
- Misconfiguring Lambda integrations can lead to unexpected errors or performance issues.
The architect view
- API Gateway is essential for decoupling frontend and backend services.
- Focus on designing APIs that are intuitive and follow RESTful principles.
- Always monitor API usage and performance to iterate and improve.