Sidecar is a design pattern that allows deploying a supplementary service alongside the main application on the same host. It is a very popular pattern in microservices architecture and provides isolation to the main service from failures in supplementary services if any.

What is Sidecar pattern?


As far as dictionary meaning goes, a sidecar is a one-wheeled device attached to the motorcycle or bicycle. Purpose of accessory in the context of a vehicle is to provide additional seating space and/or stability. It is not a necessary component of a vehicle but provides supplementary functionality.

In software architecture, sidecar pattern means separating certain functionality or a set of functionalities into a separate process, to be run on the same host. By running this component on the same host, ensures that these supplementary applications have the same lifecycle as that of the main application.

Sidecar pattern – [source:]

Why is this pattern popular in microservices architecture?

Microservices architecture necessitates that application is broken down into several different services, which potentially can be run on separate hosts. This distributed nature gives rise to certain needs such as discoverability of the services (central registry), centralized logging, circuit-breaker capabilities, health-check etc. These functionalities are not a core part of the microservice but are essential for the overall functioning of the application. This is the reason, such functionalities are implemented using sidecar design pattern.

Microservices architecture also enables development of applications in various different languages/technologies. A single implementation of sidecar can be made to consume by all such components, thus making it manageable implementation.

Use cases

Following are some samples of functionalities which could be implemented using sidecar pattern:

  • Health-check of the application
  • Logging
  • Application registry for discoverability
  • Platform abstraction
  • Admin UI

Related Links

Related Keywords

Microservices, Service Mesh, Kubernetes, Circuit breaker

One Reply to “Sidecar”

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.