mirror of
https://github.com/hanzoai/papers.git
synced 2026-10-29 07:34:31 +00:00
67 lines
3.1 KiB
TeX
67 lines
3.1 KiB
TeX
\section{API Gateway: Hanzo Gateway}
|
|
|
|
\label{sec:gateway}
|
|
%% ============================================================================
|
|
|
|
\subsection{Overview}
|
|
|
|
Hanzo Gateway extends KrakenD, a stateless Go-based API gateway, with Hanzo-specific integrations: IAM JWT validation via JWKS endpoint auto-discovery, KMS-backed configuration secrets, Prometheus metrics aligned with the Hanzo observability stack, and declarative endpoint definitions across 147+ routes. The gateway requires no database and no distributed cache, enabling horizontal scaling by adding replicas behind a load balancer.
|
|
|
|
\subsection{Feature Matrix}
|
|
|
|
\begin{table}[H]
|
|
\centering
|
|
\caption{API gateway feature comparison.}
|
|
\label{tab:gateway}
|
|
\footnotesize
|
|
\begin{tabular}{@{}lccccc@{}}
|
|
\toprule
|
|
Feature & \rotatebox{60}{Hanzo} & \rotatebox{60}{Kong} & \rotatebox{60}{Envoy} & \rotatebox{60}{AWS APIGW} & \rotatebox{60}{Nginx} \\
|
|
\midrule
|
|
Stateless & \yes & \no & \yes & N/A & \yes \\
|
|
JWT validation & \yes & \yes & \yes & \yes & \pmark \\
|
|
Rate limiting & \yes & \yes & \yes & \yes & \pmark \\
|
|
Circuit breaker & \yes & \yes & \yes & \no & \no \\
|
|
Response merge & \yes & \no & \no & \no & \no \\
|
|
Backend agg. & \yes & \no & \no & \no & \no \\
|
|
IAM-native & \yes & \no & \no & \no & \no \\
|
|
KMS-native & \yes & \no & \no & \yes & \no \\
|
|
Declarative cfg & \yes & \yes & \yes & \yes & \no \\
|
|
Zero-downtime & \yes & \yes & \yes & \yes & \pmark \\
|
|
Self-hosted & \yes & \yes & \yes & \no & \yes \\
|
|
Open source & \yes & \yes & \yes & \no & \yes \\
|
|
Plugin system & \yes & \yes & \yes & \yes & \yes \\
|
|
K8s CRD & \yes & \yes & \yes & \no & \pmark \\
|
|
\bottomrule
|
|
\end{tabular}
|
|
\end{table}
|
|
|
|
\subsection{Performance}
|
|
|
|
Benchmarked using \texttt{wrk2} with 256 concurrent connections, 30-second duration, targeting a pass-through proxy to a static JSON backend on the same host:
|
|
|
|
\begin{table}[H]
|
|
\centering
|
|
\caption{Gateway throughput and latency overhead.}
|
|
\footnotesize
|
|
\begin{tabular}{@{}lrrr@{}}
|
|
\toprule
|
|
System & RPS & Median (ms) & p99 (ms) \\
|
|
\midrule
|
|
Hanzo Gateway & 45,200 & 1.2 & 4.8 \\
|
|
Kong (dbless) & 28,400 & 2.1 & 12.3 \\
|
|
Envoy & 52,100 & 0.9 & 3.2 \\
|
|
Nginx (proxy) & 61,300 & 0.6 & 2.1 \\
|
|
AWS API GW & 10,000 & 8.5 & 45.0 \\
|
|
\bottomrule
|
|
\end{tabular}
|
|
\end{table}
|
|
|
|
Envoy and Nginx outperform Hanzo Gateway on raw proxy throughput. However, neither provides built-in response merging, backend aggregation, or IAM-native JWT validation. Kong's database dependency (even in dbless mode, it loads declarative config into an in-memory store) adds overhead. AWS API Gateway's 10,000 RPS limit is a hard regional default that requires quota increases.
|
|
|
|
\subsection{Key Differentiator}
|
|
|
|
Hanzo Gateway combines KrakenD's zero-allocation proxy pipeline with native Hanzo IAM JWKS validation and KMS secret injection. A single JSON configuration file defines all 147+ endpoints, including backend aggregation rules that merge responses from multiple microservices into a single client response. No competing gateway provides this combination without additional plugins or sidecars.
|
|
|
|
%% ============================================================================
|