Let’s look at some of the use cases where we can use the Sidecar pattern.
Ambassador Sidecar — The primary application uses an ambassador to handle the connectivity operations like login, routing, etc. The ambassador is executed as a Sidecar. Find more details here.
Offload Proxy — In a Microservice instance, a Proxy like NGINX is placed for handling static files serving in the service.
Managing the Proxy Caching — Another Sidecar can monitor the environment and clear the cache when the cache needs to be invalidated.
Adding HTTPS to a Legacy Service — We can add a Sidecar proxy to receive the HTTPS requests and forward them to a legacy service that uses HTTP.
Log aggregator -When each Microservice generates any error logs, it might impact its memory and disk volume. In such cases, we can transfer the error logs from the Microservice to a log aggregator, Sidecar.