johnag.dev


Designing Distributed Systems - Adapter

Take a common tech requirement - monitoring multiple applications. We want to monitor the logs of each application - let’s say as a time series data. But each app has its own logging format. Consuming the logs of each app and transforming the data within a single monitoring service would be a nightmare.

The solution is the adapter container. We set up a container group. We couple the app container with the adapter, which extracts and transforms the log into a consumable format, and exposes an interface for external consumer. The monitoring service can then consume and aggregate these logs into a format of choice.

The beauty of the setup is that the app container can roll out on its own, as it is loosely coupled to the adapter. Plus, the adapter container is reusable and can be deployed to other app container groups as well for monitoring.

References