Chapter 5. Adapters
In the preceding chapters, we saw how the sidecar pattern can
extend and augment existing application containers. We also saw
how ambassadors can alter and broker how an application container
communicates with the external world. This chapter describes the final
single-node pattern: the adapter pattern. In the adapter pattern,
the adapter container is used to modify the interface of the application container so that it conforms to some predefined interface that is
expected of all applications. For example, an adapter might ensure that
an application implements a consistent monitoring interface. Or it
might ensure that log files are always written to stdout
or any
number of other conventions.
Real-world application development is a heterogeneous, hybrid exercise. Some parts of your application might be written from scratch by your team, some supplied by vendors, and some might consist entirely of off-the-shelf open source or proprietary software that you consume as precompiled binary. The net effect of this heterogeneity is that any real-world application you deploy will have been written in a variety of languages, with a variety of conventions for logging, monitoring, and other common services.
Yet, to effectively monitor and operate your application, you need common interfaces. When each application provides metrics using a different format and interface, it is very difficult to collect all of those metrics in a single place for visualization and alerting. ...
Get Designing Distributed Systems, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.