AWS API Gateway: HTTP vs REST
Summary
HTTP is 70% faster, and way cheaper, but lacks most of features from REST and WebSockets, therefore, choose HTTP if WebSockets were not required, nor REST API features.
Context: AWS API Gateway
API Gateway is a managed service that makes it easier to manage the APIs (creating, publishing, and maintaining secure APIs). API gateway has become one of the pillars of the microservices and serverless architectures. It comes in 3 flavors:
WebSocket API
Build a WebSocket API using persistent connections for real-time use cases such as chat applications or dashboards. Works with the following: Lambda, HTTP, AWS Services
HTTP API
Build low-latency and cost-effective REST APIs with built-in features such as OIDC and OAuth2, and native CORS support. Works with the following: Lambda, HTTP backends
REST API
Develop a REST API where you gain complete control over the request and response along with API management capabilities. Works with the following: Lambda, HTTP, AWS Services
Monthly costs
REST
Requests | Price |
---|---|
0 - 333 | $3.50 |
334 - 1M | $2.80 |
HTTP
Requests | Price |
---|---|
0 - 300 | $1.00 |
301 - 1M | $0.90 |