sidecar
also: sidecar container, sidecar proxy
A sidecar is a lightweight container or process that runs alongside a main application to provide supporting functionality like logging, monitoring, or networking without modifying the primary application code.
A sidecar pattern involves deploying a helper container or process in close proximity to your main application. It handles cross-cutting concerns—features needed by the app but not core to its business logic—such as log aggregation, metrics collection, or network proxying.
In containerized environments like Kubernetes, a sidecar container runs in the same pod as your main application container, sharing network namespace and often storage volumes. For example, you might run an Envoy proxy sidecar alongside a web service to handle TLS encryption and traffic routing, keeping your application code focused on its primary purpose.
Sidecars are popular in microservices architectures because they decouple infrastructure concerns from application logic, enable code reuse across polyglot services, and simplify testing and maintenance by isolating supporting functionality.