advanced
Sidecar
Place cross-cutting runtime behavior beside a service process when proxying, telemetry, or policy can be standardized safely.
A sidecar is a companion process deployed alongside each service instance — common in Kubernetes and service meshes — handling TLS, metrics, retries, or proxy routing without changing application code. Envoy as sidecar is a typical example.
Trade-off: uniform policy and language-agnostic concerns versus extra CPU/memory per pod and operational complexity.
On interviews: what to put in sidecar versus library versus platform; mTLS and observability via mesh.
Common pitfalls: business logic creeping into sidecar config; debugging through opaque proxy; resource limits ignoring sidecar cost.
Checklist:
- Limit sidecars to infrastructure concerns.
- Standardize bootstrap and config across services.
- Account for sidecar resources in capacity planning.
- Keep application observability hooks consistent.