What is a sidecar pattern in microservices?
⚡
Quick Answer
The sidecar pattern runs a helper container alongside the main application container in the same pod, sharing its network and lifecycle, to provide cross-cutting functions like logging, proxying, or security without changing the app.
Detailed Answer
Sidecars offload concerns from the app: a service-mesh proxy (Envoy) for mTLS/routing, a log shipper, or a secrets agent. They share the pod network (localhost) and volumes, so integration is seamless and language-agnostic. The cost is extra resource usage per pod, which is why some meshes are moving to sidecar-less models.
💡
Interview Tip
Give the Envoy/service-mesh example and note the per-pod resource cost driving sidecar-less designs.
sidecarmicroserviceskubernetes