smaple.tr
Backend & APIs

Kong vs Traefik vs AWS API Gateway: How to Choose

Mehmet Kurtipek
August 1, 2026
16 min read
Backend & APIs
API gateway
Kong
Traefik
AWS

Choose AWS API Gateway if your backend runs on Lambda or other AWS services and you would rather pay per request than operate a proxy. Traefik suits containers on Docker or Kubernetes when you mostly need routing, TLS and a few middlewares, configured from labels that follow your services as they start and stop. Kong is the one for APIs that outside developers consume, where each consumer needs its own key, limits and request transformations, provided you are ready to run it yourself or pay for Kong's commercial offering. With one API and one team, you may not need any of the three.

Two recent changes affect the choice: open-source Kong has had no new minor release since December 2024, and ingress-nginx has been retired, which moves Kubernetes users toward the Gateway API. Versions and prices were checked on 18 October 2026.

What the three have in common, and where they differ

All three are reverse proxies for north-south traffic, meaning requests that come from outside (browsers, mobile apps, partner systems) into your services. Each one terminates TLS, matches the request by host and path, runs policies such as authentication and rate limiting, and forwards it to a backend. None of them is a service mesh. Traffic between your own services, east-west, is a separate problem with separate tools.

The real difference is who runs them and where. AWS API Gateway is a managed service: nothing to patch or scale, you pay per request, and it exists only inside AWS Regions. Its configuration doesn't move to any other platform.

Kong Gateway is software built on NGINX and OpenResty, and almost every feature is a plugin. You run it on VMs, containers or Kubernetes, or let Kong host it through its Konnect platform.

Traefik Proxy is a single Go binary you run yourself. It builds its routing table from Docker labels, Kubernetes resources or files, and changes it as containers start and stop.

Do you need a gateway product at all?

A gateway product earns its place when a few of these are true. You expose several backend services under one domain. Partners or outside developers call your API and need their own keys, quotas or a developer portal. Several teams would otherwise each write their own authentication and rate limiting. Or you are replacing an old system piece by piece and need to move routes without clients noticing.

If none of that applies, a load balancer and some application middleware will do the job. On AWS, an Application Load Balancer already routes by host and path, and since November 2025 it can verify JWTs (signature, expiry and claims) before a request reaches your code. Per-user rate limiting is a small piece of Express or FastAPI middleware backed by Redis. A gateway in front of a single API adds a network hop, a second place where routes are defined and one more component to upgrade, while taking very little work off your hands. The reference setup in our AWS architecture post puts an ALB directly in front of the containers.

Kong vs Traefik vs AWS API Gateway at a glance

AWS API Gateway

Kong Gateway

Traefik Proxy

Who operates it

AWS

You, or Kong through Konnect

You

Where it runs

AWS Regions only

Anywhere

Anywhere

Configuration

Console, CloudFormation, CDK or Terraform, OpenAPI import

Declarative YAML (DB-less), Admin API with PostgreSQL, Kubernetes resources

Docker labels, Kubernetes resources, files

Built-in authentication

IAM, Cognito, Lambda authorizers; JWT on HTTP APIs; API keys on REST APIs (for usage plans, not authentication)

Key, JWT, OAuth 2.0, basic, HMAC and LDAP in the open-source build; OpenID Connect is Enterprise

Basic, digest, ForwardAuth to your own service; JWT, OIDC and API keys need Traefik Hub

Rate limiting

Stage and account throttling; per-client limits (best effort) only on REST APIs with usage plans

Plugin with per-node, database or Redis counters

RateLimit middleware, in memory or shared through Redis

gRPC

Not supported

Yes

Yes

WebSocket

Separate WebSocket API type, billed per message

Proxied

Proxied

Kubernetes Gateway API

Not applicable; AWS Load Balancer Controller is partially conformant

Conformant (Kong Operator)

Conformant

Price

Per request

Free open-source build; Enterprise and Konnect are paid

Free; Traefik Hub is paid

AWS API Gateway: pick HTTP or REST first

"AWS API Gateway" covers three API types: HTTP APIs, REST APIs and WebSocket APIs. For ordinary request-response traffic the first decision is HTTP or REST, and AWS's feature comparison is worth reading line by line.

HTTP APIs are the cheaper type. They include a JWT authorizer for tokens from an OpenID Connect or OAuth 2.0 provider such as Cognito, Auth0, Entra ID or Keycloak, Lambda authorizers, IAM authorization, CORS and private integrations into a VPC. They have no API keys, usage plans, request validation, caching, AWS WAF or X-Ray tracing.

REST APIs cost about three times as much per request and add the API-management features: API keys with per-client usage plans and throttling, request validation, body transformations, caching, AWS WAF, private endpoints reachable only from inside a VPC, canary deployments, response streaming and a hosted developer portal that is billed separately. Before you build a partner API on them, read the warnings in AWS's usage plan documentation. API keys identify a client for its usage plan and are not meant for authentication, so pair them with IAM, Cognito or a Lambda authorizer. Usage-plan throttling and quotas are applied on a best-effort basis: a client can go over them, so they shouldn't be the only thing protecting your backend or your bill.

Timeouts are the other surprise. Integrations time out after 30 seconds on HTTP APIs, and that can't be raised. On REST APIs the default is 29 seconds, which can be raised for Regional and private APIs in exchange for a lower account-level throttle. Payloads are capped at 10 MB on both. Report generation, large exports and slow third-party calls need an asynchronous pattern (accept the job, return an ID, let the client poll or notify it) whichever type you choose.

On the price list for Frankfurt (eu-central-1), HTTP APIs cost $1.20 per million requests for the first 300 million a month, so 100 million requests come to $120 ($100 in N. Virginia). Requests are metered in 512 KB increments, which means a 2 MB upload counts as four. REST APIs cost $3.70 per million for the first 333 million, so the same 100 million come to $370 ($350 in N. Virginia), before caching, WAF and data transfer.

WebSocket APIs are billed per message, and that changes the arithmetic for live feeds. In Frankfurt a million messages cost $1.14 (every 32 KB of a message counts as one) and a million connection minutes cost $0.285. Keeping 2,000 clients connected for a 30-day month is 86.4 million connection minutes, about $25. Pushing each of them one update per second is 5.18 billion messages, about $5,070 after the discount above one billion. AWS also closes every connection after two hours, or after 10 minutes without traffic, so clients need reconnect logic. For a push-heavy product, price it on messages before you choose; our post on WebSocket vs SSE covers the protocol side.

AWS API Gateway fits when the backend is Lambda, traffic is modest or spiky, and you want nothing to operate. It fits less well when you need gRPC, which it doesn't proxy (on AWS that is a job for an ALB), or when you might leave AWS later: authorizers, mapping templates and usage plans are AWS-specific and get rewritten on the way out.

Kong: the most built-in features, and a licensing question

Kong is the pick when the gateway itself has to do a lot. The open-source build bundles plugins for key, JWT, OAuth 2.0, HMAC, LDAP and basic authentication, ACLs, rate limiting, request and response transformation, proxy caching, CORS, and Prometheus and OpenTelemetry export. A few plugins, OpenID Connect among them, exist only in the Enterprise edition.

The licensing question is about versions. The open-source Kong/kong repository has shipped only 3.9.x patch releases since 3.9.0 in December 2024. The latest, 3.9.4, came out on 12 October 2026, and the official kong image on Docker Hub tracks it. Kong Gateway Enterprise has moved on to 3.16, and the unlicensed "free mode" of the Enterprise build was deprecated in 3.10. So if you choose Kong because it is open source, plan for a line that gets fixes but no new minor versions, or budget for Enterprise or Konnect. Konnect is priced per gateway and by request volume; get a quote before assuming it is cheaper than running Kong yourself.

You can run Kong yourself in two modes. In DB-less mode the whole configuration is one declarative YAML or JSON file, loaded at startup or posted to the /config endpoint. The Admin API becomes read-only, each node keeps the full configuration in memory, and the file lives in Git next to your code. That is where we would start. Traditional mode stores configuration in PostgreSQL, so you can change routes and consumers live through the Admin API or Kong Manager, at the cost of running a database for your gateway.

Here is a minimal DB-less file. Start Kong with KONG_DATABASE=off and KONG_DECLARATIVE_CONFIG=/kong/kong.yml and it loads this configuration:

_format_version: "3.0"
services:
  - name: orders
    url: http://orders:8080
    routes:
      - name: orders-route
        paths:
          - /orders
        strip_path: false
    plugins:
      - name: key-auth
      - name: rate-limiting
        config:
          minute: 100
          policy: local
consumers:
  - username: partner-acme
    keyauth_credentials:
      - key: replace-with-a-generated-key

With this file, every request under /orders needs an apikey header, and each consumer gets 100 requests a minute per Kong node. Keep the strip_path: false line: by default Kong removes the matched prefix, so the orders service would receive /42 instead of /orders/42. If you run several nodes and the limit has to be exact, switch the policy to redis so the nodes share one set of counters. Real keys don't belong in Git; commit the file with placeholders and fill the keys in at deploy time.

Traefik: routing that keeps up with your containers

Traefik's strength is discovery. Connect it to Docker or Kubernetes and it builds routes from container labels or cluster resources as services start and stop, and it requests Let's Encrypt certificates by itself. Adding a service means adding labels to that service. There is no central gateway file to edit and redeploy. A Docker Compose sketch (production would add an HTTPS entrypoint, a certificate resolver and a socket proxy in front of the Docker socket, because mounting it :ro doesn't make the Docker API read-only):

services:
  traefik:
    image: traefik:v3.7
    command:
      - --providers.docker=true
      - --providers.docker.exposedbydefault=false
      - --entrypoints.web.address=:80
    ports:
      - "80:80"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro

  orders:
    image: ghcr.io/example/orders:1.4.2
    labels:
      - traefik.enable=true
      - traefik.http.routers.orders.rule=PathPrefix(`/orders`)
      - traefik.http.routers.orders.entrypoints=web
      - traefik.http.routers.orders.middlewares=orders-limit
      - traefik.http.middlewares.orders-limit.ratelimit.average=100
      - traefik.http.middlewares.orders-limit.ratelimit.period=1m
      - traefik.http.middlewares.orders-limit.ratelimit.burst=20
      - traefik.http.services.orders.loadbalancer.server.port=8080

This limits each client IP to 100 requests a minute on /orders. If Traefik sits behind another load balancer, every request appears to come from that balancer's address. Add the balancer's address range to the entrypoint's forwardedHeaders.trustedIPs and set the middleware's sourceCriterion.ipStrategy.depth (1 for a single balancer), so Traefik reads the real client from X-Forwarded-For.

Traefik Proxy (open source, v3.7 at the time of writing) has about two dozen HTTP middlewares, among them RateLimit (in memory, or shared across instances through Redis), ForwardAuth, BasicAuth, IPAllowList, CircuitBreaker, Retry and Headers. JWT and OIDC validation, API keys, OPA policies and the WAF are marked as Traefik Hub features in the documentation. Hub is Traefik Labs' paid API gateway, and its prices aren't published. In the open-source build you validate tokens with ForwardAuth: Traefik sends each request's headers to a small auth service you write and lets the request through only if that service answers with a 2xx.

That works well when the clients are your own web and mobile apps and you issue the tokens. When dozens of outside consumers each need keys and quotas, Kong gives you more out of the box.

On Kubernetes, the Gateway API changes the question

For years the usual way to expose services on Kubernetes was an Ingress controller, most often ingress-nginx. That project was retired in March 2026 and its repository is archived. The Kubernetes maintainers point users to the Gateway API, a standard set of resources (Gateway, HTTPRoute, GRPCRoute and others) that describes routing independently of the product that implements it.

That makes the controller underneath replaceable. Kong (through Kong Operator) and Traefik Proxy are both listed as conformant with Gateway API v1.6, the current release, on the project's implementations page, next to Envoy Gateway, Istio, Cilium and NGINX Gateway Fabric. AWS API Gateway isn't a Kubernetes controller at all. On EKS, AWS's own option is the AWS Load Balancer Controller, which provisions ALBs and NLBs and is listed as partially conformant.

Our advice for a cluster: write routes as Gateway API resources, pick the controller whose free tier covers your authentication needs, and keep vendor-specific annotations and custom resources to the few places that need them. Switching later is then mostly a matter of replacing the controller. If you are still deciding whether the product needs Kubernetes at all, our Docker and Kubernetes comparison is the place to start.

What 100 million requests a month costs

100 million requests a month averages about 39 requests a second. For a self-hosted proxy that is a light load, so the bill is mostly for redundancy and for the people who keep it running.

Option

Monthly cost at 100M requests

Not included

AWS API Gateway, HTTP API (Frankfurt)

$120

Data transfer, logs

AWS API Gateway, REST API (Frankfurt)

$370

Data transfer, logs, caching, WAF

Kong open source or Traefik Proxy, self-hosted

The two or more instances it runs on

Upgrades, monitoring and on-call, all yours

Kong Enterprise or Konnect, Traefik Hub

Quoted by the vendor

Depends on the contract

Per request, AWS looks expensive and self-hosting looks free, and both impressions mislead. When an AWS API Gateway node dies at 3 a.m., that is AWS's problem. When one of your Kong nodes dies, someone on your team gets paged, and the same person has to keep up with its security patches. For a small team, a few hundred dollars a month to AWS is often the cheaper option in practice. Once the gateway line on the bill reaches thousands, price Kong or Traefik on infrastructure you already run.

How we would choose

  1. Backend on Lambda, or mostly AWS services, with modest or spiky traffic: AWS API Gateway with an HTTP API. Move to a REST API only for API keys and usage plans, WAF, caching or private endpoints.
  2. One or two containerised APIs on AWS, used only by your own apps: an Application Load Balancer with JWT verification, plus rate limiting in the application. No gateway product.
  3. Several services on Docker or Kubernetes, used by your own web and mobile apps: Traefik, with routes written as Gateway API resources if you are on Kubernetes.
  4. A public or partner API with many consumers, per-consumer keys and quotas, transformations, or a mix of clouds and your own servers: Kong, after deciding whether you will stay on the open-source 3.9 line or pay for Enterprise or Konnect.
  5. gRPC from outside clients: Kong, Traefik or Envoy Gateway. On AWS without a proxy of your own, an ALB with a gRPC target group. Before you commit to that, our gRPC vs REST post explains why browsers and partners are usually better off calling REST.

Whichever you pick, generate the gateway's routes from your OpenAPI document instead of maintaining them by hand. AWS API Gateway imports OpenAPI definitions, and Kong's decK converts them with deck file openapi2kong. FastAPI publishes an OpenAPI document by default, and Express or NestJS can produce one with Swagger tooling, so the gateway configuration can be generated in CI and won't drift away from the code.

Frequently asked questions

Which is faster, Kong or Traefik?

For most APIs the difference won't show. The 39 requests a second from the cost example above are a light load for either one on a small instance, and the latency you notice usually comes from what you add: a rate-limit check that calls Redis on every request, a ForwardAuth round trip, heavy logging. Published benchmarks tend to come from the vendors, on configurations they chose. If speed is what decides it for you, test both with your own plugins and traffic.

Can AWS API Gateway route to containers on ECS or EKS?

Yes, through a VPC link. HTTP APIs can reach an Application Load Balancer, a Network Load Balancer or services registered in AWS Cloud Map inside your VPC; REST APIs can reach an Application or Network Load Balancer. You then pay for the gateway and the load balancer, and the 29- and 30-second integration timeouts still apply. If the containers only serve your own apps, the load balancer on its own is usually enough.

Should the gateway or the service check the JWT?

Both, for different things. The gateway checks that the token is genuine and unexpired, and turns junk away before it reaches your code. The service still decides whether this user may see order 42, because only the service knows who owns it. If the gateway passes the user ID on in a header, make sure the service can only be reached through the gateway; otherwise anyone can send that header themselves.

Do I need both an API gateway and a service mesh?

Usually not at first. The gateway handles requests coming from outside; a mesh handles encryption, identity, retries and telemetry between your own services. A product with a handful of services rarely needs a mesh. It starts to make sense with many services, several teams and a requirement for mutual TLS everywhere.

If you are making this choice for your own product and want a second opinion, our backend and API team can help.

Related Articles

July 4, 2026

gRPC vs REST for Microservices: When gRPC Is Worth It

When gRPC beats REST between services, what it adds to your operations (load balancing, deadlines, browser access), and what our own protobuf vs JSON test showed.

Read More: gRPC vs REST for Microservices: When gRPC Is Worth It
March 14, 2026

RPA Implementation: From Process Choice to Bots That Keep Running

Most of an RPA implementation is choosing the process and designing for exceptions. The order we work in, current license prices, and what broke in the n8n and LLM automation we built with an agency.

Read More: RPA Implementation: From Process Choice to Bots That Keep Running
February 22, 2026

Composable Architecture: What It Is and When It's Worth It

Composable architecture builds a system from replaceable business capabilities joined by APIs. How it differs from microservices and MACH, how to adopt it, and when a small team should skip it.

Read More: Composable Architecture: What It Is and When It's Worth It