Broker Pattern

Learn about broker pattern architecture and its advantages and disadvantages.

Overview

Many systems are built from a collection of services deployed across numerous servers in many circumstances, and creating these systems is a challenging task. We must be concerned about the following:

  • How will the systems interoperate?
  • How will they connect?
  • How will they exchange information?
  • How available will the component services be?

The main question is this: how can we design the distributed software in a way that allows the service users to be unaware of the specifics and location of service providers, enabling us to easily alter the connections between users and providers as needed?

Introduction to broker pattern

The broker pattern, also known as the intermediary pattern, inserts a middleman called a broker between service users (also known as clients) and service providers (servers). The client is fully disconnected from the servers and has no knowledge of them. When a client requires a service, it asks a broker over a service interface, and the broker forwards the request to the appropriate server, which handles the request. The server returns the outcome of its action to the broker that forwards the result (together with any exceptions) to the client that initiated the request.

Get hands-on with 1400+ tech skills courses.