API Gateway Pricing: Open-Source Gateway vs Amazon API Gateway

March 11, 2024

Technology

Choosing Between Open-Source API Gateway and Amazon API Gateway Pricing

API gateway pricing depends on more than the listed price per request. Teams comparing Amazon API Gateway with an open-source API gateway on AWS should consider traffic volume, request and response size, high availability, observability, support, operational effort, and how much control they need over the data plane and control plane.

This article explains the major API gateway price drivers and uses an illustrative high-volume example to compare a managed AWS service with an open-source gateway deployment. The numbers below should be treated as a model to adapt, not a substitute for current AWS pricing pages, your own traffic profile, or a production benchmark.

When developers are faced with the decision of whether to use a fully managed service like Amazon API Gateway or an open-source API gateway solution, several crucial factors come into play. This article examines these considerations to assist engineering professionals in making an informed choice.

  • Multi-Cloud and Hybrid Environments: Amazon API Gateway excels in integrating with other AWS services like Lambda but is tightly coupled with the AWS ecosystem. Conversely, open-source gateways offer greater flexibility, enabling deployment across GCP, Azure, private clouds, or hybrid environments of these environments.

  • Extensive Customization Needs: For projects requiring highly customized API functionality beyond the scope of Amazon API Gateway, open-source solutions provide greater control and the ability to customize gateways to meet specific requirements.

  • High API Request Volume and Cost: As API traffic grows, the cost of Amazon API Gateway may become significant. In contrast, open-source gateways can be a more cost-effective option, especially for high-traffic scenarios.

  • Optimizing Performance and Latency: Open-source options provide greater control over performance and latency. Engineers can directly benchmark and select optimized open-source gateways (e.g., Apache APISIX, Kong, Envoy, Tyk) to suit their applications.

While Amazon API Gateway offers a convenient and well-integrated solution within the AWS ecosystem, open-source alternatives provide greater flexibility, customization, and lower costs, particularly suitable for complex or high-traffic use cases.

API Gateway Pricing Factors to Compare

Before choosing a gateway model, map the pricing structure to your real operating model:

Pricing FactorManaged API GatewayOpen-Source Gateway on AWS
Request volumeOften priced by request count and feature tierMostly driven by compute, networking, and scaling design
Data transferDepends on cloud networking and regional usageDepends on AWS networking, load balancers, and architecture
High availabilityBuilt into the managed service modelYou design and pay for redundant nodes and failover
ObservabilityCloud-native logs and metrics may add costPrometheus, Grafana, log storage, or managed observability tools
OperationsLower infrastructure maintenance burdenRequires upgrades, monitoring, backup, and incident response
CustomizationLimited by service capabilitiesMore control over plugins, routing, policies, and deployment

For teams that need enterprise support around Apache APISIX, API7 Enterprise can provide a managed control plane and commercial support while preserving flexible gateway deployment options.

Factors to Consider in Calculating Costs

API gateway plays a crucial role in managing traffic between client applications and backend services, serving as middleware with two main components: the data plane and the control plane.

Data Plane: Scaling with Traffic

The data plane, responsible for handling incoming API requests, performs tasks like routing, authentication, and data transformation critical for ensuring smooth system operation. As API call volumes increase, the data plane requires more computing resources to maintain optimal performance. Therefore, accurately estimating API call volume is crucial for determining the number of data plane instances needed to ensure the system can effectively handle requests and maintain high availability.

Control Plane: Planning for High Availability

The control plane acts as the central hub of the API gateway, managing configurations and policies, and guiding how the data plane processes requests. Unlike the data plane, the resource requirements of the control plane are not directly related to API call volume. However, ensuring the high availability of the control plane is crucial. Therefore, users need to plan control plane resource allocation based on desired redundancy levels and uptime requirements.

Monitoring and Logging costs

  • Amazon API Gateway: Integrated with AWS CloudWatch, providing monitoring and logging functionalities incurring additional costs. When considering the overall cost of Amazon API Gateway, evaluating monitoring and logging requirements is essential.

  • Open-Source API Gateway: Monitoring and logging solutions typically need separate consideration. Cost-effective options like Prometheus and Grafana can be considered, or users can opt for managed log management services offered by cloud providers.

Cost Estimation Example: Estimating Costs for Handling 10 Billion API Requests

Using Amazon API Gateway

Let's estimate the monthly cost of handling 10 billion API requests with Amazon API Gateway. Please note that the following are estimations, and actual costs may vary based on specific configurations and usage patterns.

Assumptions:

  • Number of API requests per month: 10 billion
  • Average request/response payload size: 1 KB (1,024 bytes)

Handling 10-bilion API requests with Amazon API Gateway

In the above scenario, the monthly cost is $9,030.

Using Open Source API Gateway Apache APISIX

Assuming 20 days per month, with 12 hours of runtime per day, let's calculate the number of requests the API gateway needs to handle these 10 billion API calls.

10000000000 / 20.0 / 12 / 3600 = 11574.074074074073

The calculation shows that approximately 11,000 API requests need to be processed per second. We can employ two data planes, each configured with 4 vCPUs.

11574.074074074073 / 4 / 2 = 1446.7592592592591

In this scenario, each CPU processes approximately 1400 API requests per second, which is an effortless task for an API gateway like Apache APISIX that can handle tens of thousands of requests per second.

In addition, the same computing resources are allocated to the control plane.

Handling 10-bilion API requests with APISIX

The monthly cost is $195.06.

By comparing the costs of handling 10 billion requests between Amazon API Gateway and open-source API gateway, the ratio is 9030 / 195.06 = 46.29344816979391, indicating that Amazon API Gateway's cloud resource cost is approximately 46 times higher than that of the open-source API gateway.

However, using an open-source API gateway does not eliminate software costs. Engineers also need to consider the costs of upgrades, and maintenance, as well as purchasing technical support and commercial products.

When Each Pricing Model Makes Sense

Choose a managed API gateway when your team values AWS-native integration, lower infrastructure ownership, and predictable service management more than deep gateway customization. This can be a strong fit for serverless applications, moderate traffic, and teams already standardized on AWS services.

Choose an open-source API gateway such as Apache APISIX when you need more control over deployment topology, plugins, traffic policies, hybrid or multi-cloud environments, or high-volume traffic economics. The gateway software may be open source, but the total API gateway price still includes cloud resources, engineering time, observability, upgrades, and support.

Conclusion

By comparing Amazon API Gateway and open-source API gateway Apache APISIX through practical examples, we find that open-source API gateways may reduce infrastructure costs in high-traffic scenarios when teams can operate the deployment effectively. Although Amazon API Gateway offers a convenient and well-integrated solution within the AWS ecosystem, open-source alternatives provide flexibility, customization, and cost-control options that can be suitable for complex or high-traffic use cases.

FAQ

How is API gateway pricing calculated?

API gateway pricing is usually based on a mix of request volume, data transfer, feature tier, compute resources, high availability requirements, observability, support, and the operational model behind the gateway.

Is an open-source API gateway free to run?

No. Open-source software can reduce license costs, but you still pay for cloud compute, load balancers, networking, monitoring, upgrades, and the engineering effort needed to operate the gateway reliably.

When does API gateway price become a major decision factor?

Pricing becomes important when request volume grows, when traffic spans multiple regions or clouds, when observability retention is high, or when advanced policies and support requirements change the total cost of ownership.

Tags: