Intermediate15 min readยท Topic 4.2

Proxies

Forward proxy, reverse proxy, service mesh with Istio and Envoy

๐Ÿ”€Key Takeaways

  • 1
    Forward proxy: sits in front of clients (VPN, corporate firewall, privacy); Reverse proxy: sits in front of servers (load balancing, SSL, caching)
  • 2
    A reverse proxy is essentially what most people mean by 'load balancer' โ€” Nginx, HAProxy, Envoy
  • 3
    Service mesh (Istio/Envoy) is a proxy infrastructure for microservices โ€” handles routing, security, observability
  • 4
    API Gateways are specialized reverse proxies with auth, rate limiting, and API management

Forward vs Reverse Proxy

A proxy is an intermediary that sits between clients and servers. The direction determines the type: forward proxy acts on behalf of clients (hiding client identity), reverse proxy acts on behalf of servers (hiding server infrastructure).

In system design, you'll almost always work with reverse proxies โ€” Nginx, Envoy, and Traefik are the most common.

Proxy Types

TypeSits in front ofPurposeExamples
Forward ProxyClientsPrivacy, access control, caching for clientsSquid, corporate firewalls, VPN
Reverse ProxyServersLoad balancing, SSL termination, caching, compressionNginx, HAProxy, Envoy, Traefik
API GatewayAPI serversAuth, rate limiting, request transformation, analyticsKong, AWS API Gateway, Apigee
Service Mesh SidecarEach microservicemTLS, retries, circuit breaking, observabilityEnvoy (Istio), Linkerd

Service Mesh Deep Dive

A service mesh is a dedicated infrastructure layer for handling service-to-service communication. Each service gets a sidecar proxy (Envoy) that handles all network traffic โ€” encryption, retries, circuit breaking, load balancing, observability.

Think of it as moving network logic out of application code into infrastructure.

Data Plane: Envoy proxies deployed as sidecars alongside every service pod. Handle all inbound/outbound traffic.

Control Plane: istiod manages configuration, certificate rotation, and service discovery. Pushes routing rules to all Envoy proxies.

Use when: you have 20+ microservices, need mTLS everywhere, want uniform observability without changing code.

Don't use when: you have <10 services, latency overhead is unacceptable, team doesn't have Kubernetes expertise.

Advantages

  • โ€ขReverse proxies add security, caching, and compression
  • โ€ขService mesh provides uniform network policies
  • โ€ขDecouples networking logic from application code

Disadvantages

  • โ€ขEvery proxy hop adds latency
  • โ€ขService mesh adds significant operational complexity
  • โ€ขDebugging through proxy layers is harder

๐Ÿงช Test Your Understanding

Knowledge Check1/1

Which type of proxy sits in front of backend servers?