What’s a Microservice?
A microservice is a small, loosely coupled service that performs a very specific business task or function. Sucha service typically does not perform any operation outside its scope or use-case. It can be deployed, managed and scaled independently. Quite often such a service has its own independent persistence layer such as a database or object storage.
What’s a sidecar?
In software engineering, a sidecar is either a separate process or a container that runs alongside the main application process or container and handles typically infrastructure and network related tasks such as service to service communications, traffic routing, load balancing etc. Implementations of sidecar pattern are Istio & Envoy, Linkerd, Consul etc.
Benefits of a sidecar
The primary need of a sidecar stems from the adoption of Microservices. Because microservices need to communicate with other microservices, their code ends up dealing with the following aspects –
- Communication
- Service Discovery
- Traffic Management
- Observability & Metrics
- Resilience
- Security
This makes the code of a typical microservice overly complex leaking concerns related to infrastructure within the business logic. Hence, putting such infrastructure related code in a separate project or codebase and running it in a separate process or container not only provides a clear separation of concerns but also simplifies management. The sidecar pattern helps achieve this separation of concerns from both infrastructure and code management perspectives. This also frees the microservice developer from learning infrastructure related concepts and stay focused to the core stack on which the microservice is being developed.
What about Service Mesh?
From a system design point of view, the dedicated infrastructure layer responsible for handling communication between microservices is known a Service Mesh. Typically, a Service Mesh also provides tools and resources to discover, manage, monitor and secure such communications. Most service mesh implementations use some sort of high-performance network proxy to achieve their objectives. These network proxies are typically run using the sidecar pattern to decouple the data plane and the control plane.
Some popular service mesh implementations are
- Istio
- Linkerd
- Consul
- Envoy
- Apache Dubbo
- AWS App Mesh
- Open Service Mesh


Leave a Reply