We have a parent
that holds information about many nodes
. Each node is separate VM instance, that performs different tasks. parent
is like a dashboard for all the nodes.
The parent
needs to:
- send some occasional configuration changes to some
node
- monitor the heartbeat i.e. the health of the
node
- get some statistic data from the
node
I would like that node
is unaware of the outside world as much as possible. Each node
works as a web server, they can have big traffic sometimes.
How to communicate in the best way between the parent
and the node
?
I was thinking into using files for communication, so parent
can set a file with a command on a node
file-system, and then to have a dir watcher that reads for such files.
Or to have some event-bus/message-queue in the background, but they are using sockets, so a node
may become un-responsive for parent
s message in case of high-traffic. Or maybe I worry too much?
EDIT
Is there any event/message-bus that offers direct communication between channels, to save the time for broadcasting? In my example, the communication between is always between a parent
and single child
, there is no need to broadcast. So we could have some messaging like email ;)
EDIT #2 - about communication and traffic
There is one parent
(or a cluster that represents one instance of a parent). Number of childs
is not determined, it may be any; the goal is to have as much as possible, as long the system works fine. The communication is:
Commands (
parent
->child
) Low-frequent commands, usually initiated by admin (e.g. "restart", "upload", "reload config"). It goes directly to specificchild
.Runtime stats (each
child
->parent
) Eachchild
notifies theparent
about its health (heartbeat) and some minor stats. This does not have to be a real-time communication, as long as the message is transferred under e.g. 10 seconds.Runtime logs (each
child
->parent
) Important logs about the traffic and usage. This may be high-volume data as it is important to measure each node, if the computation gets over certain limit we need to be aware of that etc. Again, not real-time, but we need a promptly alert on high computation.
There is no much need of general broadcasting (since child
s are not aware of other childs), this is more direct messaging.