[zeromq-dev] adaptable net
matjaz.ostroversnik at gmail.com
Sat Apr 9 01:57:52 CEST 2016
In last days I am studying the mlm server architecture. Nice and clean
design. Congrats to the architects.
My objective is set to prepare adaptable net of nodes with client and
worker functionality (i.e. service pattern in mlm semantics) that
can communicate among themselves. It is always client (consumer of the
results of the service)-worker(provider of the service) communication,
but nodes have both client and worker functionality.
There is/are one or more brokers between clients and workers.
Communication goes client-broker-worker-broker-client. Brokers should be
as simple as possible.
1. There are two or more brokers in the net.
2. Brokers hold no vital information. If one broker goes down (regular
/ irregular shutdown) net must readapt. No payload is lost.
3. broker is go between clients and workers from the security reasons
(clients must not have direct access to the workers and vice versa)
1. brokers allow only connection of registered clients/workers
4. brokers distribute work between workers offering the same service
1. e.g. round-robin
5. provide alternative paths between clients and workers. (resistance
1. C1->B1->W1->B1-C1 if there are several brokers the same pair
C1/W1 can communicate via different brokers, assuming that all
workers and all clients are connected to all brokers.
6. source of information about other brokers in the net
1. i.e. client/worker connects to one predefined broker,
periodically it distributes the list of other brokers to its
2. brokers have periodically "quorum" when they exchange
information about them selves (i.e. list of all active brokers)
3. initially each node is configured with at least one broker
(others are provided dynamically)
4. initially each broker is configured with at least one peer
broker (is there mechanism to make broadcast on WAN?)
1. connected to one broker initially, gradually they "see" whole set of
2. if one broker fails, client uses different path (via retransmitting
3. clients distribute work between brokers
1. - each worker provides one service type
2. - there can be several workers offering the same service
1. payload is opaque (size cca 4KB)
2. meta-data : sender, receiver, unique-msg id, possible duplicate,
original message id (for replys), retry cnt
3. if they are expired and until there is an option for retry client
E. Message exchange:
1. it is always initiated by the client part of the node and goes to
the service worker, which replys
2. if message is not return in predefined period of time (msg exchange
timeout) it is retried (predefined number of retries)
3. client can select the broker to send the message through, but worker
always returns message via arriving path(broker)
4. message exchange C-B-W-B-C is fast (sub seccond)
Current mlm server is by my opinion platform for this task. Am I too
- A.4 (?) believe so
- E.1 (how to do reply?)
Already added functionality:
- A.3.1 (curve)
- D.1 (blobs)
- A.6 (the toughest stuff)
1. Async request-reply pattern. Is it already supported? Code talks
about replys, but I am unsure. Hints?
2. D.2-3, E.2: Is current message (mlm_msg_t) suitable for expansion
(e.g. unique-id, original-unique-id, retry-cnt)?Or should I do it in
some other way?
3. A.5: clients / workers should connect to different brokers (e.g.
array of mlm_client actors )
4. A.6: Currently I do not have solution for A.6. Is zgossip the right
5. B.1-3 - Strictly related to A.6 solution
What is your opinion on this?
Would you do something in a different way?
How you would tackle A.6?
Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the zeromq-dev