| Feature | Limit | Notes |
|---|---|---|
| Max Request Payload Size | 10 MB | Larger payloads require direct integrations (e.g., S3 Pre-Signed URLs). |
| Max Response Payload Size | 10 MB | Consider compression techniques to optimize responses. |
| Max Concurrent Requests | 10,000 per region | Requests beyond this require throttling or API throttling policies. |
| Max API Stages per Gateway | 10 | Use separate API Gateways if more stages are needed. |
| Max Routes per API (HTTP/WebSocket) | 300 | Applies to HTTP and WebSocket APIs, not REST APIs. |
| Max Cache TTL | 3600 seconds (1 hour) | Lower TTL values increase backend load but ensure fresher data. |
| Max API Keys per Account | 10,000 | Use Cognito or Lambda Authorizers for large-scale authentication needs. |
| Max Integration Timeout | 29 seconds | Long-running operations should be handled asynchronously. |
| Max Custom Domain Names | 60 per account | Consider using API Gateway mappings for better domain organization. |
| Max Deployment History per Stage | 10 | Older deployments are deleted automatically. Use backups if needed. |
| Max WebSocket Connection Lifetime | Unlimited (client-side controlled) | Connections rely on client heartbeat messages. |
| Feature | REST API | HTTP API | WebSocket API | Best Use Case |
|---|---|---|---|---|
| Use Case | Traditional RESTful services | Lower-cost REST API alternative | Real-time bidirectional communication | Microservices, IoT, Chat apps |
| Latency | Slightly higher | Lower | Low | Faster response times required |
| AWS Service Integration | Full support | Limited | Limited | Serverless & AWS-native services |
| Streaming Support | No | No | Yes | Data streaming and real-time updates |
| Authentication | IAM, Cognito, Lambda | IAM, JWT | IAM, JWT | Secure API access control |
| Caching Support | Yes | No | No | Optimizing performance and cost |
| WebSockets | No | No | Yes | Live chat, notifications, and gaming APIs |
| Cost Efficiency | Higher | Lower | Based on connection time | Budget-conscious API deployment |
| Supports Private APIs | Yes | Yes | No | Internal API access within VPC |
| Rate Limiting & Throttling | Yes | Yes | Yes | Managing high-traffic APIs |
πΉ Use CloudFront with API Gateway β Distribute API traffic globally and reduce latency.
πΉ Enable Caching β Reduce backend load and improve response times.
πΉ Leverage Lambda Authorizers β Secure APIs without maintaining API keys.
πΉ Optimize WebSocket API Costs β Close inactive connections and use DynamoDB for state management.
πΉ Monitor API Performance with CloudWatch & X-Ray β Debug bottlenecks and optimize API responses.
π‘ API Gateway helps optimize API performance, scalability, and security. Understanding these limits ensures effective API design! π