Sidecar
Peripheral tasks such as Monitoring, Logging etc are critical to most applications and often integrated within them. However, these tasks run alongside the same process as the application which is potentially inefficient and points to improper separation of concerns. Plus, outages caused in these monitoring and logging components could severely impact the entire application functions.
Solution: Co-locate as Sidecar
- Co-locate the set of tasks along with the application but place them in their process or container as a Sidecar
- Sidecars are typically small/pluggable components and can be written in different languages
- Both application and sidecar are deployed as a single unit, therefore latency is low
- The sidecar can be used for modifying how the application container works without having to make any changes to the code
- The sidecar is bolted to the application and its lifecycle is dependent on the application
- If the sidecar container logic gets complex or tightly coupled with the main application, it may better be integrated with the main application’s code instead