Broker pattern

This article is in list format, but may read better as prose. You can help by converting this article, if appropriate. Editing help is available. (February 2023)

|

The broker pattern is an architectural pattern that can be used to structure distributed software systems with decoupled components that interact by remote procedure calls. A broker component is responsible for coordinating communication, such as forwarding requests, as well as for transmitting results and exceptions.[1]

## Contents

* 1 Definition
* 2 Terminology
* 3 Advantages
* 4 Disadvantages
* 5 Real-life implementation of the pattern
* 6 Confusions around the pattern
* 7 References

## Definition

The broker pattern is an architecture pattern that involves the use of an intermediary software entity called "broker" to facilitate communication between two or more software components. The broker acts as a "middleman" between the components, allowing them to communicate without being directly aware of each other's existence.

In the broker pattern, the broker is responsible for receiving messages from one component and forwarding them to the appropriate recipient. The components that communicate through the broker are known as servers or clients. The broker may also perform additional tasks, such as filtering, modifying messages, ensuring a quality of service (QoS) e.g. 0 for "at most once", or security , or providing additional services to the software components.

The broker pattern allows the components to remain decoupled and focused on their own responsibilities, while still being able to communicate and collaborate with other components in the system. It can also be used to reduce the number of dependencies between components, making the system more flexible and easier to maintain.

## Terminology

Broker

* Maintain a routing table of registered software components.
* Maintain a filter table to reroute the transiting messages to the right software components.
* May assure additional functionalities such as information security and quality of service.

Server

* Software components responsible for sending a message out.
* It can also be found under the name of publisher.

Client

* Software components that subscribed and awaits a specific message.
* It can also be found under the following names:
* Consumer
* Subscriber

## Advantages

Source:[2]

* Dynamic changes, additions, deletions and relocations of components possible.
* One source of communication with / to the broker. which define the interface.
* Components do not need to know each other.

## Disadvantages

* One central component that needs to be robust and efficiently written.
* No data consistency of transmitted messages.

## Real-life implementation of the pattern

* Message broker
* RabbitMQ
* MQTT

## Confusions around the pattern

There is a lot of amalgam with the publish–subscribe pattern because it shares a certain amount of similarities.[3] Nevertheless, when it comes to the representation, there are some core differences:

* The Broker architectural pattern is represented by a Many to One to Many diagram.
* The Publish-subscribe architectural pattern is represented by Many to Many diagram. Here, the messaging functionalities are hidden as a Cross-cutting concern.

## References

1. ↑ "Solution: Use a Broker - Pattern-Oriented Software Architecture For Dummies [Book"]. https://www.oreilly.com/library/view/pattern-oriented-software-architecture/9781119963998/chap12-sec005.html. Retrieved 26 March 2023.
2. ↑ Stal, Michael (1 January 1995). The Broker Architectural Framework. https://www.academia.edu/57594620. Retrieved 26 March 2023.
3. ↑ Team, The HiveMQ. "MQTT Client and Broker and MQTT Server Connection Establishment Explained - MQTT Essentials: Part 3". https://www.hivemq.com/blog/mqtt-essentials-part-3-client-broker-connection-establishment/. Retrieved 26 March 2023.

* v
* t
* e

Software design patterns

Creational|

* Abstract factory
* Builder
* Dependency injection
* Factory method
* Lazy initialization
* Multiton
* Object pool
* Prototype
* RAII
* Singleton

Structural|

* Adapter
* Bridge
* Composite
* Decorator
* Delegation
* Facade
* Flyweight
* Front controller
* Marker interface
* Module
* Proxy
* Twin

Behavioral|

* Blackboard
* Chain of responsibility
* Command
* Interpreter
* Iterator
* Mediator
* Memento
* Null object
* Observer
* Servant
* Specification
* State
* Strategy
* Template method
* Visitor

Functional|

* Closure
* Currying
* Function composition
* Functor
* Monad
* Generator

Concurrency|

* Active object
* Actor
* Balking
* Barrier
* Binding properties
* Coroutine
* Compute kernel
* Double-checked locking
* Event-based asynchronous
* Fiber
* Futex
* Futures and promises
* Guarded suspension
* Immutable object
* Join
* Lock
* Messaging
* Monitor
* Nuclear
* Proactor
* Reactor
* Read write lock
* Scheduler
* Thread pool
* Thread-local storage

Architectural|

* ADR
* Active record
* Broker
* Client–server
* CBD
* DAO
* DTO
* DDD
* ECB
* ECS
* EDA
* Front controller
* Identity map
* Interceptor
* Implicit invocation
* Inversion of control
* Model 2
* MOM
* Microservices
* MVA
* MVC
* MVP
* MVVM
* Monolithic
* Multitier
* Naked objects
* ORB
* P2P
* Publish–subscribe
* PAC
* REST
* SOA
* Service locator
* SN
* SBA
* Specification

Cloud
Distributed|

* Ambassador
* Anti-Corruption Layer
* Bulkhead
* Cache-Aside
* Circuit Breaker
* CQRS
* Compensating Transaction
* Competing Consumers
* Compute Resource Consolidation
* Event Sourcing
* External Configuration Store
* Federated Identity
* Gatekeeper
* Index Table
* Leader Election
* MapReduce
* Materialized View
* Pipes
* Filters
* Priority Queue
* Publisher-Subscriber
* Queue-Based Load Leveling
* Retry
* Scheduler Agent Supervisor
* Sharding
* Sidecar
* Strangler
* Throttling
* Valet Key

Other|

* Business delegate
* Composite entity
* Intercepting filter
* Lazy loading
* Mangler
* Mock object
* Type tunnel
* Method chaining

Books|

* Design Patterns
* Enterprise Integration Patterns

People|

* Christopher Alexander
* Erich Gamma
* Ralph Johnson
* John Vlissides
* Grady Booch
* Kent Beck
* Ward Cunningham
* Martin Fowler
* Robert Martin
* Jim Coplien
* Douglas Schmidt
* Linda Rising

Communities|

* The Hillside Group
* The Portland Pattern Repository

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Broker pattern. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Broker_pattern&oldid=241900"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template