Course contentsShow
← System Design
Lesson 828 of 1,91922. Service MeshFree lesson

The Sidecar Proxy Pattern

How service meshes deploy a proxy alongside each service instance to intercept and manage network traffic.

The Sidecar Proxy Pattern

What you'll learn: How service meshes use sidecar proxies to intercept and control network traffic without changing application code.

What Is a Sidecar Proxy?

In the service mesh architecture, a sidecar proxy is a small network proxy deployed alongside each service instance—like a companion container in the same pod (in Kubernetes terms). This proxy sits between your service and the network, intercepting all incoming and outgoing traffic.

Think of it like a personal assistant who handles all your phone calls: they screen incoming calls, place outgoing calls on your behalf, and keep detailed logs—all while you focus on your actual work without knowing the mechanics of the phone system.

How It Works

When Service A wants to call Service B:

  1. Service A makes a normal HTTP/gRPC call to Service B
  2. The call is intercepted by A's sidecar proxy (before leaving the container)
  3. The sidecar handles routing, retries, load balancing, encryption, and observability
  4. Traffic goes to Service B's sidecar proxy
  5. B's sidecar decrypts and forwards the request to Service B

The application code remains unchanged—it doesn't know the sidecar exists.

Why Use Sidecars?

This pattern separates network concerns (security, reliability, observability) from business logic. Instead of every team implementing retries, circuit breakers, and mTLS differently, the sidecar provides these features uniformly across all services.

The sidecar deploys as a separate process, making it technology-agnostic—your Java, Python, and Go services all get the same capabilities without code changes.

Key Takeaway: The sidecar proxy pattern deploys a network proxy alongside each service instance to transparently intercept and manage all traffic, centralizing cross-cutting networking concerns without modifying application code.