API Gateway vs Reverse Proxy: Choosing the Right Tool for Cloud‑Native Architecture
API gateways serve microservices and developers, while reverse proxies handle static web traffic for ops teams; the article traces their evolution from static Nginx setups to cloud‑native programmable gateways like Envoy and Traefik, explains their overlapping concepts, and suggests a unified deployment to reduce complexity.
Overview
API gateways and reverse proxies both route traffic, but they originated for different audiences. Gateways are typically managed by developers to expose micro‑service APIs, while reverse proxies such as Nginx are operated by operations teams for static web sites.
Historical Evolution
Web 1.0/2.0 : Front‑end reverse proxies (e.g., Nginx) were configured statically by ops for load balancing, TLS termination, basic security, rate limiting and caching. Deployment cycles were long, so static configuration was sufficient.
Microservice era : API services change frequently. Static Nginx configs become a bottleneck, prompting the adoption of dynamically configurable gateway platforms (e.g., Kong, Spring Cloud Gateway) that developers can update via APIs or declarative files.
Cloud‑native era : Requirements such as gray‑release, service discovery, and programmable traffic policies lead to fully programmable data‑plane proxies (Envoy, Traefik) that combine reverse‑proxy performance with API‑gateway features.
Programmable Gateways in Kubernetes
In Kubernetes the Ingress resource represents the entry point for external traffic. Programmable gateways (Kong, Envoy, Traefik, Spring Cloud Gateway) can be deployed as Ingress controllers, providing:
Dynamic configuration via CRDs or REST APIs
Advanced routing (path, header, weight‑based)
Built‑in observability (metrics, tracing)
Extensible filters for authentication, rate limiting, and traffic shaping
Large organizations often run dozens of gateway clusters to isolate traffic per business unit, platform (iOS, Android, H5, web) or security requirement. Independent deployments avoid configuration conflicts and allow department‑specific policies (e.g., stricter PCI compliance for payment services).
Conceptual Distinction
An API gateway can be viewed as a specialized reverse proxy that adds API‑centric capabilities such as request/response transformation, authentication, quota enforcement, and service discovery. In practice many architectures place a generic reverse proxy (load balancer, TLS terminator) in front of one or more API gateways, forming a three‑layer stack similar to a Web Application Firewall (WAF) → reverse proxy → API gateway → microservices.
Combined Deployment Architecture
Historical migrations often leave both a traditional reverse proxy and a modern gateway in place, increasing operational overhead. A unified approach merges the two functions into a single programmable data‑plane (e.g., Envoy) that handles TLS termination, load balancing, and API‑level policies together.
Reference: https://stackoverflow.com/questions/35756663/api-gateway-vs-reverse-proxy
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
JavaEdge
First‑line development experience at multiple leading tech firms; now a software architect at a Shanghai state‑owned enterprise and founder of Programming Yanxuan. Nearly 300k followers online; expertise in distributed system design, AIGC application development, and quantitative finance investing.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
