What is Sidecar Pattern?

As per this pattern supporting features of the application are deployed as separate process or container to provide isolation and encapsulation.

This sidecar pattern is often used with containers and referred to as a sidecar container or sidekick container. 

This pattern is named Sidecar because it resembles a sidecar attached to a motorcycle. 

Motorbike, Sidecar, Motorcycle, Transport, Motor

The sidecar also shares the same lifecycle as the parent application, being created and killed alongside the parent.

What is the problem context?

  • Applications generally require additional functionalities like 
    • monitoring 
    • configuration 
    • logging 
  • Such functionalities tightly integrated, so
    • Outage in one of these components can affect other components or the entire application. 
    • Functionalities need to be implemented using the same language as the parent application. 

What is the solution?

The solution is a sidecar pattern:

  • Additional functionalities implemented as separate components or services.
    • Application is decomposed into services.
  • Sidecar services are not necessary part of application but are connected to it. 
  • Shares the same fate as parent application.
  • For each instance of the application, an instance of the sidecar is deployed and hosted alongside it.

What are the advantages of using this pattern?

  • Sidecar is independent from its primary application in terms
    • Runtime environment 
    • Programming language
  • Proximity to the primary application, hence no significant latency when communicating between them.
  • For legacy applications where extending application functionality is difficult, you can use a sidecar to extend functionality.

Rakesh Kalra

Hello, I am Rakesh. I have more than 15 years of experience working on IT projects, where I have worked on varied complexity of projects and at different levels of roles. I have tried starting my own startups, 3 of those though none of it were successful but gained so much knowledge about business, customers, and the digital world. I love to travel, spend time with my family, and read self-development books.


Leave a Reply

Avatar placeholder

Your email address will not be published.