4

I have a C4 container diagram of a system, in which most of the components communicate with MQTT. The MQTT container is SOUP. Is it necessary that I draw the MQTT container or can I simply draw direct relations between containers and state on those, that it works via MQTT? Is there a specific recommandation? If yes, why? See examples below.

Example with broker (relations can easily clutter up with more containers):

with broker

Example with direct relation and more abstraction:

enter image description here

2 Answers 2

3

This specific case is addressed in the C4 Model Frequently Asked Questions. Both options - showing service A publishing a message to the broker and the broker sending the message to service B is just as valid as omitting the broker and using notions (textual notes, colors, line style, arrow heads, etc.) to show the communication.

Since both options are valid, I would look at the clarity of communicating the system to consumers of the model. My preference would lean toward including the message broker as a component on the diagram, however I would omit it if including it and all the lines necessary to represent connections made the diagram harder to read.

Depending on clarity, you could omit the broker on the container diagram, but include it on the relevant component diagrams, or vice versa. However, you may not be creating component diagrams if they do not add value. You could also consider showing the broker on a supplemental diagram, such as a deployment diagram.

0
0

Based on https://c4model.com/abstractions/queues-and-topics, you may want to show the actual queue/topic as a Container (or Component) instead of the whole broker - especially if you have multiple queues/topics that are housed by the same message broker.

1
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. Commented Jul 9 at 19:26

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.