DevOpsil
Load Balancing

Envoy vs HAProxy

Cloud-native L7 proxy vs traditional load balancer. Compare Envoy and HAProxy for modern microservice architectures.

EnvoyHAProxy
CriteriaEnvoyHAProxy
ArchitectureCloud-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.
ObservabilityBuilt-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 MeshThe 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 SupportHTTP/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 ConfigurationxDS 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 UsageHigher 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.