The adapter design pattern
The last design pattern that we are going to discover here is the adapter design pattern. As its name suggests, it's going to adapt an entry from a source format to a target format.
What is the adapter design pattern?
The adapter design pattern is the last paradigm we are going to discover in this chapter. As with the ambassador and sidecar design patterns, this one expects that you run at least two containers:
- The first one is the main container.
- The second one is the adapter container.
This design pattern is helpful and should be used whenever the main containers emit data in a format, A, that should be sent to another application that is expecting the data in another format, B. As the name suggests, the adapter container is here to adapt.
Again, this design pattern is especially well-suited for log or monitoring management. Imagine a Kubernetes cluster where you have dozens of applications running; they are writing logs...