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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access