A platform team is choosing between Kong, AWS API Gateway, and a plain Nginx reverse proxy to front a set of microservices. What are the core architectural differences that should drive the choice, and under what circumstances would routing everything through one central gateway be the WRONG call?
answer
- Nginx = general proxy, DIY API features via Lua
- Kong = Nginx-based, plugin ecosystem, still self-hosted
- AWS API Gateway = fully managed, AWS-locked, per-request cost
- north-south (edge) vs east-west (internal) traffic
- service mesh handles internal traffic, not the edge gateway
basics
~20 sNginx is a fast general-purpose proxy you configure and run yourself; Kong adds API-specific features (plugins for auth, rate limiting) on top of that same self-hosted model; AWS API Gateway is a fully managed service with those features built in but tied to AWS. Sometimes it's better NOT to force all traffic through one shared gateway, especially service-to-service traffic inside the system.
solid answer
~60 sNginx is a general-purpose, self-hosted reverse proxy: fast and flexible, but API-specific concerns (auth plugins, rate limiting, request transformation) require custom config or Lua scripting rather than being built in. Kong is built on top of Nginx/OpenResty specifically for APIs, adding a plugin ecosystem (JWT, rate limiting, logging) and a control-plane API for managing routes dynamically, while still being self-hosted/operated. AWS API Gateway is fully managed — no infrastructure to run, native integration with Lambda/IAM/Cognito, but you're paying per-request, subject to AWS's throttle/payload limits, and locked into its config model. The choice mostly comes down to: how much ops burden can the team absorb, how deep is cloud-provider lock-in already, and how much do plugin ecosystem and dynamic config matter. On the second half: forcing ALL traffic — including internal service-to-service (east-west) calls — through one central gateway adds a hop, a bottleneck, and a shared-ownership chokepoint to traffic that doesn't need edge concerns like public auth or global rate limiting; that's usually better served by a service mesh or direct service discovery, reserving the gateway for north-south (client-to-system) traffic only.
go deeper
Knows there are different gateway products (managed vs self-hosted) without needing to compare their architecture in depth.
Can name at least one concrete difference between a managed gateway (AWS API Gateway) and a self-hosted one (Kong/Nginx), such as who owns operations.
Articulates the ops-burden/flexibility/lock-in trade-off across the three options and can justify a choice given team constraints.
Draws the north-south/east-west traffic distinction, argues for keeping the central gateway scoped to edge traffic, and routes internal traffic through a service mesh or discovery layer instead — recognizing gateway-sprawl and bottleneck risk as an organizational, not just technical, concern.
## Three axes for the comparison Comparing **Kong**, **AWS API Gateway**, and plain **Nginx** as API Gateway implementations comes down to three architectural axes: 1. how much of the API-specific behavior is built-in versus something you configure yourself, 2. how much operational burden the team takes on, and 3. how deep the resulting vendor or platform lock-in becomes. ## Where each one sits on those axes - **Plain Nginx** is a general-purpose, high-performance reverse proxy and web server; it can do path-based routing, TLS termination, and basic rate limiting (via its `limit_req` module), but anything API-specific — validating JWTs, calling an external auth server, per-route usage plans, request/response transformation — has to be hand-built, typically via Nginx's Lua scripting extension (**OpenResty**) or external auth-request modules. It's self-hosted, meaning the team owns deploying, scaling, patching, and monitoring it, but it's also maximally flexible and has no per-request cost beyond infrastructure. - **Kong** is built directly on top of Nginx/OpenResty but is purpose-designed as an API Gateway: it ships a plugin architecture with pre-built plugins for JWT/OAuth2 validation, rate limiting (including Redis-backed cluster-wide counters), request transformation, logging integrations, and a declarative or API-driven control plane for managing routes and plugins dynamically without hand-editing config files and reloading. It's still self-hosted (or available as a managed offering), so the team still owns the infrastructure, but gets substantially more API-specific behavior out of the box than raw Nginx. - **AWS API Gateway** sits at the other end of the spectrum: it's fully managed — no servers to patch or scale — with native, tight integration into the AWS ecosystem (IAM for authorization, Cognito for user pools, direct Lambda and ECS/ALB integration, native usage plans with API-key-based throttling), but it comes with AWS-specific configuration models, per-million-requests pricing that can get expensive at very high volume, platform-imposed payload size and timeout limits, and by nature commits the team more deeply to AWS as their cloud provider. ## Choosing on organizational facts The choice between these should be driven by concrete organizational facts rather than feature checklists: - A team **already fully committed to AWS** with modest-to-moderate traffic and a preference for minimizing operational surface area typically gets the most value from AWS API Gateway, trading configuration flexibility and unbounded self-hosted scalability for near-zero ops burden. - A team that needs to **run on-prem, multi-cloud**, or wants full control over the plugin pipeline and cost structure at very high request volumes (where managed per-request pricing becomes expensive) tends toward Kong or a similar self-hosted product, accepting the ops burden of running and scaling it themselves in exchange for flexibility and cost control at scale. - **Raw Nginx** is usually the right call only when the API-specific feature set needed is genuinely minimal (routing and TLS termination, nothing more) or when a team wants to build something bespoke — most teams building anything beyond simple routing eventually reinvent enough of Kong's feature set in Lua that adopting Kong directly would have been cheaper. ## The bigger question: north-south versus east-west traffic The second, arguably more important question — when centralizing all traffic through one gateway is the wrong call — comes down to distinguishing **north-south traffic** (external clients calling into the system from outside) from **east-west traffic** (services calling other services internally). A gateway's value proposition — centralized auth, rate limiting, a single stable public entry point — is specifically about the boundary between untrusted external clients and the trusted internal system. Internal service-to-service calls don't need public-facing authentication or a client-facing stable contract; they need low-latency, resilient communication with concerns like mutual TLS, internal load balancing, and retries — which is exactly what a **service mesh** (**Istio**, **Linkerd** — sidecar proxies deployed alongside each service) is designed for. Routing internal east-west traffic through the same central gateway used for external traffic: - adds an unnecessary extra network hop to every internal call, - turns the gateway into a scaling bottleneck sized for internal traffic volume (which is typically an order of magnitude higher than external request volume, since one external request often fans out into several internal calls), and - creates a shared-ownership chokepoint where every team's internal routing changes require going through the gateway team's config — actively harming the team autonomy that microservices are meant to provide. The architecturally sound default is: **gateway at the edge for north-south traffic, service mesh or direct service discovery for east-west traffic**, keeping the gateway's blast radius and traffic volume scoped to what it was actually designed to protect.
- Why does routing internal service-to-service traffic through the same central gateway used for external clients tend to become a scaling bottleneck?One external request often fans out into several internal service-to-service calls, so internal (east-west) traffic volume is typically several times higher than external (north-south) volume. A gateway sized and architected for edge traffic gets disproportionately loaded if it also has to absorb that much larger internal volume.
- What specifically does a service mesh provide for internal traffic that a central API Gateway doesn't optimize for?A service mesh deploys a lightweight sidecar proxy alongside each service instance, handling mutual TLS, fine-grained internal load balancing, retries, and observability at the point closest to the caller and callee, without adding a centralized extra hop. It's designed for high-volume, low-latency internal traffic patterns rather than the edge-facing concerns a gateway focuses on.
- If a team is already fully on AWS with unpredictable but generally moderate traffic, why might AWS API Gateway be preferable to self-hosting Kong?The managed, pay-per-request, auto-scaling nature of AWS API Gateway removes the operational burden of running, patching, and capacity-planning gateway infrastructure themselves, which matters most for teams without dedicated platform-ops capacity. The trade is less configuration flexibility and a cost curve that can become expensive only at very high sustained volume, which a moderate-traffic team is less likely to hit.
Like choosing between building your own security checkpoint from raw parts (Nginx), buying a purpose-built checkpoint kit with plug-in modules for badges, metal detectors, and visitor logs (Kong), or renting a fully staffed checkpoint service where you don't touch the equipment at all (AWS API Gateway) — and separately, realizing employees walking between internal offices shouldn't have to go back out through the main lobby checkpoint every time (the east-west vs. north-south distinction).
saying these in an interview costs you the question
- Treats Kong, Nginx, and AWS API Gateway as interchangeable with no architectural distinction
- Doesn't know that Kong is built on top of Nginx/OpenResty
- Assumes all traffic, including internal service-to-service calls, should always go through the central gateway
- No concept of north-south vs east-west traffic
- Picks a gateway product based on popularity alone rather than ops burden / lock-in / traffic volume trade-offs