4 ms·
To make a distinction that the article does not (but should), ZeroMQ is a network transport abstraction layer. It is not useful for many distributed systems des
by jandrewrogers 14y ago
To make a distinction that the article does not (but should), ZeroMQ is a network transport abstraction layer. It is not useful for many distributed systems despite the title for the same reason. For non-trivial distributed systems, behaviors that are correct for network transport use cases that are built into ZeroMQ are pathological for distributed system use cases.
In the specific case of ZeroMQ, there is a deep underlying assumption that logical queues are fundamentally independent things. As a corollary, scheduling what work is done on which queues is of no consequence as long as the contract of the individual queues is upheld.
For any non-trivial distributed system, the above assumption is not true. Correct and scalable scheduling of operations is a function of the current status of all logical queues visible to a process. The processing priority of one queue is dependent on the current status of all other queues, which can change from operation to operation. Distributed systems are cooperatively scheduled and much of the self-balancing behavior of good distributed system designs come from this adaptive scheduling behavior. Unfortunately, systems like ZeroMQ intentionally hide and encapsulate all of the properties of the network transport that would be used to inform the scheduling of operations over a set of logical queues. And if you assume logical queues are fundamentally independent from a scheduling perspective then that is a good design.
ZeroMQ is a good for moving bits over a network but it is often not a correct choice for distributed systems.
- rdtsc 14y agoAll good points. Never thought of it that way. Are you thinking of RabbitMQ and distributed queues? Is it about all the distributed processes seeing a consistent queue state, or are you talking in general about having a quick feedback 'loading' value for each worker (as each grabs an item of the the queue, they are busy and will be less likely to grab one, so other less busy ones can take over).?
- snprbob86 14y ago> For non-trivial distributed systems, behaviors that are correct for network transport use cases that are built into ZeroMQ are pathological for distributed system use cases. I'm not sure what you mean. Please provide one or more concrete examples. > ZeroMQ is a good for moving bits over a network but it is often not a correct choice for distributed systems. It seems to me that distributed systems are defined by moving bits over a network. You're right that there is some confusion regarding what ZeroMQ actually us. This is in no small part due to it's unfortunate name: ZeroMQ isn't a queue. It is implemented with queues, but that's because it sends and receives discrete messages instead of bytes, like it's underlying protocols. The underlying transport protocols use "buffers" to store bytes on their way from your application to their destination. When you have a buffer of messages, that's called a queue! ZeroMQ is a network protocol for messaging. If you need custom scheduling, load balancing, etc, you can send and receive control messages on a secondary channel. The ZeroMQ Guide [1] is extremely enlightening in this regard. It's worth reading even if you never use ZeroMQ because all of the underlying principals apply to any network transport. [1] http://zguide.zeromq.org/page:all http://zguide.zeromq.org/page:all
- scott_s 14y agoIt seems to me that distributed systems are defined by moving bits over a network. Sorta. People say "distributed system" to mean a single, logical system - typically an application, or maybe some middleware that executes applications - that runs on many machines. So, yes, a distributed system will have bits moving over the network. But the point that jandrewrogers is making is that in a distributed system, the network connections are often dependent on each other. That is, sending data on one connection will impact the sending of data on another connection. When someone says "distributed systems," you're probably thinking of a client application talking to a server, and maybe that server talking to some backend. That's not what people mean when they use the term. They mean, in the large case, thousands of processes running across hundreds of hosts, and all of those processes may communicate with each other. In the client-server-backend case, it's okay to assume that each of those connections are independent, and to reason about them as such. In the thousand-to-thousand case in a distributed system, it's often not okay to assume that each of those connections is independent.
- snprbob86 14y agoI've worked on more than one thousand+ machine distributed systems. These systems all use unix sockets extensively. Unix sockets are pretty much independent from each other from the developer's perspective. Scheduling and coordination is not a concern of the socket layer of the stack. In most production distributed systems, there is an agreed upon common RPC protocol and a variety of ad-hoc messaging protocols. Often, this is HTTP for RPC coupled with a variety of job worker systems, maybe an "enterprise" message broker, and line-oriented protocol or two, and a few other custom services. ZeroMQ isn't trying to replace unix sockets. Nor is it trying to be a panacea for distributed systems. It's trying to standardize a set of sound topology patterns with robust implementations over a common protocol. It's a damn useful tool for distributed systems. If you're system has everyone all chatting at once and saturating your links, that's not ZeroMQ's problem any more than it's unix sockets' problem.
- scott_s 14y agoIf you think "enterprise" when someone says "distributed system," then you are not talking about the same kind of thing that jandrewrogers and I are talking about. We're talking about high performance computing (HPC), where the communication patterns among nodes in a cluster can be complex and dominate performance. I disagree with his strong statement that if something like ZMQ works for you, it's not a distributed system, but otherwise, everything he has said is spot on.