johnag.dev


Designing Distributed Systems - Sidecar

Consider, for example, we have a legacy web service. It is on its way to retirement, but we still need it as a critical component of a larger system. The problem is nobody wants to touch its code because it is too risky.

Let’s bring in the sidecar pattern. The idea is straightforward. We create a new web service which talks to the legacy service for data. It then exposes its own API to serve other components in place of the legacy service. The result is a maintainable and extensible service which works as a sidecar to the legacy component.

Now we can migrate the business logic to the sidecar safely and iteratively, while still serving the data. And when the time comes, we can turn off the old web service, minimizing production issues.

References