Load Balancing
Envoy vs HAProxy
Cloud-native L7 proxy vs traditional load balancer. Compare Envoy and HAProxy for modern microservice architectures.
EnvoyHAProxy
| Criteria | Envoy | HAProxy |
|---|---|---|
| Architecture | Cloud-native, xDS API-driven configuration. Designed for service mesh. Hot-restart for zero-downtime updates. | Traditional config-file driven. Runtime API for live changes. Battle-tested in bare-metal and VM environments. |
| Observability | Built-in distributed tracing (Zipkin, Jaeger, OpenTelemetry). Detailed per-route stats. Access logging with structured fields. | Stats page and Prometheus exporter. Access logs. Less granular per-service metrics compared to Envoy. |
| Service Mesh | The data plane for Istio, Consul Connect, and AWS App Mesh. Purpose-built for sidecar proxy pattern. | Not typically used as a sidecar. Better suited as an edge proxy or traditional load balancer. |
| Protocol Support | HTTP/1.1, HTTP/2, HTTP/3, gRPC, MongoDB, Redis, and more. Extensible via Wasm filters. | HTTP/1.1, HTTP/2, TCP, SMTP, MySQL, PostgreSQL. Lua scripting for custom protocol handling. |
| Dynamic Configuration | xDS API for fully dynamic configuration. No restarts needed. Control plane pushes changes. | Runtime API for some dynamic changes. Full config changes require reload (graceful). |
| Resource Usage | Higher memory and CPU footprint. C++ binary. Sidecar pattern multiplies resource usage. | Very lightweight. C implementation. Lower resource overhead per connection. |
Verdict
Choose Envoy for service mesh, cloud-native microservices, and when you need xDS-driven dynamic configuration. Choose HAProxy for traditional edge load balancing with lower resource overhead.