O'Reilly logo

Distributed Computing with Go by V.N. Nikhil Anurag

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mediator design pattern

Mediator acts as an intermediary between components in the code, and this leads to very loose coupling between various components. This allows us to make minimal changes to the code, as we only need to change the interaction between the mediator and the component which is being extracted into its own microservice.

Let's look at an example. We have a monolith, which is defined by Codebase A. It consists of five components—Component 1 through Component 5. We realize that Component 1 and Component 2 rely on interacting with Component 5, while Component 2 and Component 3 rely on Component 4. If Component 1 and Component 2 were to directly call Component 5, and similarly Component 2 and Component 4 were to directly call ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required