I'm trying to design a real-time monitoring & control system that's modular, so it can distributed, and expanded/reconfigured for different hardware & networks.
I've quickly come to the conclusion I'll need some kind of distributed enterprise messaging system. But there are many options out there, each with advantages and disadvantages, and some of them dictate different architectures. I'm trying to work out whether I need a broker or brokerless system, whether I need the message reliability of some systems (e.g. RabbitMQ) or the light-weight high-throughput of a system like ZeroMQ, or the "arrive in order" high throughput of Kafka.
First, do these architectures make sense?
ZeroMQ type "Brokerless" system:
Notes:
There can be many "Part A" to each "Part B", and many "Part B" feeding into a "Part C"
Advantages:
- High throughput, low latency
- Easily integrated into components, lightweight deployment (no need to deploy a broker).
Disadvantages
- Messages not guaranteed delivery. Some may be dropped. This may be a problem in the orange highlighted areas. It's not critical for the GUI, but if the local control module is making decisions, it might need all the information. (Thinking about it, just the latest is probably good enough - no point making a decision with out of date data). Similarly, if the network between A and B goes down, the historian will have incomplete history. How critical is this though?
- No "discovery". Relationship between components needs to be more managed.
RabbitMQ type Broker system:
Advantages:
- Messages guaranteed delivery.
- Discovery managed through brokers.
Disadvantages
- Much slower, high latency
- More to deploy & maintain (brokers/RabbitMQ need installing on machines, it's not just built into the modules)
Inbetween options:
I've looked at Kafka. It's brokered, so discovery is taken care of. However, it seems much more lightweight than RabbitMQ and while it doesn't guarantee delivery (thus is faster/lower latency) it does maintain order, which RabbitMQ doesn't. It also buffers messages - so they can be retrieved if there's a network problem.
After writing this down, I'm not sure how important guaranteed delivery is. If the control module gets a message, if it's "old" it doesn't matter. It would be great if the historian had a full history - but is it essential?
It might be an option to implement my own "Message buffer" in ZeroMQ for network communication that stores messages in case of failure. I'd have more control than RabbitMQ, and can just implement it when I need it for messaging over the more unreliable (over the network).
Obviously, weighing up these advantages or disadvantages is my job. My question is: Is there anything else to consider? and Does the architecture for these two options make sense?
I'm planning on most implementation to be in C#, and I currently have zero experience in messaging systems.