# DDHub Message Broker

## Overview

DDHub Message Broker is a component that primarily provides message routing, persisting, and delivery for a seamless data exchange between participants within an energy market or supply chain.

The message broker promotes sovereignty of participants by:

* The broker does not have authority or logic which assumes the power of the participants
* No one except the participant themselves can govern data exchange channels and verify messages
* Encryption/decryption, signature validation, authorization, etc must be done under the participants domain ([Client Gateway](https://docs.energyweb.org/legacy-documentation/ew-dos-technology-components-2023/decentralized-data-hub-ddhub/ddhub-client-gateway))

## DDHub Message Broker Component Diagram

<figure><img src="https://2400236058-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_pXALj14Egb-5Bal_p%2Fuploads%2Fx8gjCBkwzPbrtynGRLhv%2FEnergyWeb%20Architecture%20-%20Entry%20diagram%20(Latest)%20(3).png?alt=media&#x26;token=faec9b0c-b338-42f1-a8cd-582e3f48329f" alt=""><figcaption></figcaption></figure>

Below are the Message Broker components which need to be hosted to deploy a Decentralized Data Hub:

* Message Broker App
* NATS Jetstream and Jetstream Store to store small data messages (small messages up to 2 MB) and channel configurations
* Azure Blob (or other large file) Store for large data messages and delimited files converted into blobs, as well as file metadata
* RDBMS for message topic and schema management

<figure><img src="https://github.com/energywebfoundation/ewf-gitbook/blob/develop/.gitbook/assets/Screenshot%202023-05-02%20at%204.29.24%20PM.png" alt=""><figcaption></figcaption></figure>
