sidecar pattern
also: sidecar container, ambassador pattern, adapter pattern
A design pattern where an auxiliary container or process runs alongside a main application to provide supporting services like logging, monitoring, or networking without modifying the main application code.
The sidecar pattern is a containerization and microservices architecture practice where a helper container (the "sidecar") is deployed next to your main application container, sharing the same network namespace and storage volumes. This allows the sidecar to intercept, enhance, or manage traffic and services for the main application transparently.
Common uses include service meshes like Istio, where sidecar proxies handle traffic management, security policies, and observability; logging sidecars that collect and forward application logs; and monitoring sidecars that gather metrics without application awareness.
For example, in Kubernetes, you might define a Pod with two containers: your web application and an Envoy proxy sidecar that enforces mTLS, rate limiting, and observability—the app continues running unchanged while the sidecar handles infrastructure concerns.