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

Data Plane: Sidecar Proxy Pattern

Learn how sidecar proxies intercept all network traffic for each service instance in the mesh.

Data Plane: Sidecar Proxy Pattern

What You'll Learn

You'll understand how sidecar proxies intercept and handle all network traffic for each service instance in a service mesh.

Core Concept

In a service mesh, the data plane consists of lightweight proxy instances deployed alongside each service. Think of it like having a personal assistant (the sidecar proxy) sitting next to every employee (service) in an office—every phone call, email, or message goes through the assistant first, who handles routing, security checks, and logging before passing it along.

How Traffic Interception Works

When a service wants to communicate with another service, it doesn't make the call directly. Instead:

  1. The service makes a request to what it thinks is the destination
  2. The sidecar proxy intercepts this traffic (transparently, without the service knowing)
  3. The proxy handles encryption, authentication, retries, load balancing, and observability
  4. The proxy forwards the request to the destination service's sidecar
  5. The destination's sidecar performs similar checks and delivers the request

Why "Sidecar"?

The name comes from motorcycle sidecars—a separate but attached component that travels with the main vehicle. Similarly, each sidecar proxy is:

  • Deployed in the same execution context (pod/host) as the service
  • Lives and dies with the service instance
  • Shares the same network namespace, enabling transparent interception

Key Responsibilities

The sidecar proxy handles all data plane operations:

  • Traffic routing based on rules from the control plane
  • Mutual TLS for secure service-to-service communication
  • Observability by emitting metrics, logs, and traces
  • Resilience patterns like retries, timeouts, and circuit breaking

Key Takeaway: The sidecar proxy pattern implements the data plane by deploying a proxy alongside each service instance to transparently intercept and manage all network traffic, offloading cross-cutting concerns from the application code itself.