API Gateway Apache APISIX and Kong Selection Comparison

API7.ai

January 18, 2020

Products

Apache APISIX and Kong are both open-source microservice API gateways, so how do you compare and choose between them?

These two projects are covered by complete documentation and tests, and many production users are using them, so don’t worry about stability and their sustainable development. This article will focus on the most direct and verifiable functions and performance. To make a comparison from a different perspective.

These two projects are covered by complete documentation and tests, and many production users are using them, so don’t worry about stability and their sustainable development. This article will focus on the most direct and verifiable functions and performance. To make a comparison from a different perspective.

FeaturesApache APISIXKONG
Dynamic upstreamYesYes
Dynamic routerYesYes
Health checkYesYes
Dynamic SSLYesYes
L4 and L7 proxyYesYes
OpentracingYesYes
Custom pluginYesYes
REST APIYesYes
CLIYesYes

For a more detailed comparison.

FeaturesApache APISIXKong
Belongs toApache Software FoundationKong Inc.
Tech ArchitectureNginx + etcdNginx + postgres
Communication channelsMail list, Wechat group, QQ group, GitHub, meetupGitHub, freenode, forum
Single-core CPU, QPS(enable limit-count and prometheus plugins)180001700
Latency0.2 ms2 ms
DubboYesNo
Configuration rollbackYesNo
Route with TTLYesNo
Plugin hot loadingYesNo
Custom LB and routeYesNo
REST API <--> gRPC transcodingYesNo
TengineYesNo
MQTTYesNo
Configuration effective timeEvent driven, < 1mspolling, 5 seconds
DashboardYesNo
IdPYesNo
Configuration Center HAYesNo
Speed limit for a specified time windowYesNo
Support any Nginx variable as routing conditionYesNo

Performance

After enabling the limit-count and prometheus plugins, the performance of Apache APISIX is ten times that of Kong.

Here are more detailed steps: https://gist.github.com/membphis/137db97a4bf64d3653aa42f3e016bd01, Interested developers can follow the picture to verify.

Why Is Apache APISIX Outperformed?

Here, we discuss the reasons behind the differences in functionality and performance:

  1. The routing complexity of Apache APISIX is O(k), which is only related to the length of uri and has nothing to do with the number of routes; the routing time complexity of kong is O(n), which increases linearly with the number of routes.

  2. The time complexity of IP matching of Apache APISIX is O(1), which will not cause CPU resources to run out with a large number of IP judgments.

  3. The route matching of Apache APISIX accepts all the variables of Nginx as conditions and supports custom functions; other gateways have several built-in conditions.

  4. Apache APISIX uses etcd as the configuration center. There is no single point. If a machine is down arbitrarily, the gateway cluster can still operate normally. Other gateways based on relational databases will have a single point of problem.

  5. Apache APISIX configuration can reach all gateway nodes within 1 millisecond, using etcd watch; other gateways poll the database regularly, and it usually takes 5 seconds to get the latest configuration.

  6. Apache APISIX plugins have been carefully tuned to maintain millisecond-level latency under high pressure.

  7. Apache APISIX's unique plugin arrangement and low-code feature can greatly reduce the threshold of secondary development.

Further Read

Tags:
API Gateway ConceptAlternatives to KongComparison to Competitors