← Back to microservices patterns map
šŸ›ø
Microservices Pattern

Sidecar Pattern

Run a helper container beside the app to handle cross-cutting infrastructure concerns.

infra

Detailed Description

Sidecars move infrastructure behavior out of application code. The main service stays focused on business behavior.

This is common for proxies, log collectors, telemetry agents, and certificate rotation.

Visual Diagram

Pod
ā”œā”€ Main App
└─ Sidecar
   logs, proxy, certs, metrics

Tradeoffs

Pros

Language agnostic, no app-code changes

Cons

Extra resources and operational moving parts

Examples: Istio Envoy sidecar, Datadog agent, Fluentd