Microservice Patterns | Design Patterns | Container Sidecar


Microservice and Containerization Patterns > Base Deployment Patterns > Container Sidecar

 

Home > Design Patterns > Container Sidecar

Container Sidecar (Erl, Naserpour)

How can microservices efficiently interact with required utility components and services?

Container Sidecar

Problem

A microservice may need access to components and services that perform common utility tasks, such as monitoring, logging and auditing. It would be impractical to redundantly copy them into the microservice deployment boundary. At the same time, it may be inefficient for the microservices to remotely interact with them.

Solution

The utility components and services are deployed on the same host as the microservice, thereby allowing the microservice to efficiently access them, as needed.

Application

Logical or physical isolation layers can be used to place the utility components and services into separate processes or containers.

The microservice and the utility components are deployed into separate containers on the same underlying host. The container used to host the utility components is referred to as the sidecar. If runtime exceptions occur in the sidecar, they do not cascade over to the microservice deployment.

Container Sidecar: Microservice A and the set of utility components are isolated from each other on separate containers and hosted on the same Virtual Machine A.

Microservice A and the set of utility components are isolated from each other on separate containers and hosted on the same Virtual Machine A.

This pattern can be applied to enable the microservice and sidecar to share resources, such as filesystems, as explained in the complete pattern description.


Module 10: Advanced Microservice Architecture & Containerization.

This pattern is covered in Module 10: Advanced Microservice Architecture & Containerization..

For more information regarding microservice and containerization courses and accreditation,
visit the Microservice Architect Certification program page..