[zeromq-dev] Stateless service protocols

Justin Karneges justin at karneges.com
Mon Jun 26 04:15:02 CEST 2017


I don't know anything about Swarm's load balancer, but the most common
load balancers create TCP connections to backend servers as needed, and
are able to route different incoming requests to different backend
servers as long as the client is using HTTP (or other layer 7 protocol
the load balancer has awareness of). If a load balancer does not
understand the protocol, basic TCP routing is possible but then the
routing is pinned to a single backend server until the connection is
terminated by the client or backend.
ZeroMQ doesn't work well with such common load balancers for a couple
of reasons:
1) I'm not aware of any load balancers that understand the ZeroMQ
   protocol, so you can only use TCP routing.2) TCP routing pins to a specific backend which means you lose out on
   actual load balancing.
Instead, you should use ZeroMQ's built-in load balancing capability.
There are two ways to do this:
1) Build a ZeroMQ broker node. Create a process that binds two ZeroMQ
   sockets, one for receiving work, and one for sending work. Configure
   your nodes to connect to the broker. As you add or remove client or
   server nodes, routing should work automatically.
2) Go brokerless. A ZeroMQ socket can connect to more than one peer, so
   have each client node connect to all of the server nodes directly. If
   the number of nodes in your cluster changes, then reconfigure the
   client nodes to add or remove ZeroMQ connections.

On Sun, Jun 25, 2017, at 01:51 PM, picflo_2 at web.de wrote:
> Hi,
> a few days ago I posted a question here regarding the combination of
> Zeromq and Docker Swarm.>  
> As a follow up to this thread. Since it is not possible to really use
> a stateful connections with the load balancer provided by Docker
> Swarm, I am curious if it is possible to write distributed
> architectures with entirely stateless protocols?>  
> Thanks,
> Florian
> _________________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20170625/4c3e7ea4/attachment.htm>

More information about the zeromq-dev mailing list