This page looks best with JavaScript enabled

Designing Distributed Systems - Adapter

 ·  ☕ 1 min read  ·  🤖 Kaung

Context

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.

Solution with Adapter Pattern

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.

If you don’t want to write your own log scraper, you can check out Elastic Search.

References

Share on
Support Me

kaung
WRITTEN BY
Kaung
Software Engineer | Physicist