TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

ZeroMQ is just sockets

201 点作者 bmaeser超过 11 年前

12 条评论

strumptrumpet超过 11 年前
I like 0MQ a lot, but this is disingenuous. Let&#x27;s break it down:<p>&gt; <i>portability</i><p>Sockets are just as portable, more so on UNIX descendants where one can rely on relatively consistent socket APIs. Beyond that, almost every single language and runtime (Python, Ruby, Java, OCaml ...) provides a portable socket API.<p>&gt; <i>message framing</i><p>Length-prefixed message framing winds up being 10-100 lines of code in almost any language&#x2F;environment.<p>&gt; <i>super fast asynchronous I&#x2F;O</i><p>Sockets have this.<p>&gt; <i>queuing</i><p>Sockets have buffers. The OS can use those buffers to implement flow control. This isn&#x27;t the same as queueing, but the truth is that you rarely want blind background queueing of an indefinite number of messages that may or may not be delivered.<p>&gt; <i>support for every bloody language anyone cares about</i><p>Just like sockets.<p>&gt; <i>huge community</i><p>I don&#x27;t think you can get &#x27;huger&#x27; than the community around sockets.<p>&gt; <i>price tag of zero</i><p>Seeing as socket libraries ship with everything, does that mean they have a time&#x2F;resource cost of less than zero?<p>&gt; <i>mind-blowing performance</i><p>Also, sockets.<p>&gt; <i>protection from memory overflows</i><p>This has essentially nothing to do with a networking library. Plenty of environments have safe&#x2F;efficient zero-copy chained byte buffer implementations&#x2F;libraries.<p>&gt; <i>loads of internal consistency checks</i><p>Library correctness isn&#x27;t a unique feature.<p>&gt; <i>patterns like pub&#x2F;sub and request&#x2F;reply, batching</i><p>Ah-ha! Here <i>finally</i> we get to the meat of it!<p>If you need <i>QUEUES</i>, including pub-sub, fanout, or any other <i>QUEUE</i>-based messaging structure, than 0MQ is better than sockets!<p>&gt; <i>and seamless support for inter-thread transport as well as TCP and multicast</i><p>Inter-thread transport of already-serialized messages at the transport protocol layer doesn&#x27;t make a ton of sense from an efficiency perspective.<p>&gt; <i>ZEROMQ IS JUST SOCKETS</i><p>No, 0MQ is a lightweight network message queue protocol. It&#x27;s not competing with sockets.
评论 #6739618 未加载
评论 #6739577 未加载
评论 #6740305 未加载
评论 #6740649 未加载
评论 #6740287 未加载
评论 #6739659 未加载
评论 #6741037 未加载
评论 #6739692 未加载
评论 #6740455 未加载
calineczka超过 11 年前
It is worth looking at Sustrik next project: <a href="http://nanomsg.org/" rel="nofollow">http:&#x2F;&#x2F;nanomsg.org&#x2F;</a> which is still in alpha version. ZMQ rewritten. He&#x27;s got awesome blog <a href="http://250bpm.com/blog" rel="nofollow">http:&#x2F;&#x2F;250bpm.com&#x2F;blog</a> where he mentions lot of things that he decided to do differently in nanomsg and the reasons behind it. Check out: <a href="http://250bpm.com/blog:23" rel="nofollow">http:&#x2F;&#x2F;250bpm.com&#x2F;blog:23</a> (I hate ZMQ contexts) and <a href="http://250bpm.com/blog:22" rel="nofollow">http:&#x2F;&#x2F;250bpm.com&#x2F;blog:22</a> (how we are doomed to rewrite protocols on top of existing protocols and solving same problems again). His other blog posts are also of a great quality.
nly超过 11 年前
The thing I most dislike about 0MQ is the overly conceptualized socket typing (ZMQ_DEALER etc), and the way the documentation tries to cram all the combinations in to idiomatic &#x27;patterns&#x27;.<p>All I want to be able to express when I send() is:<p><pre><code> 1. Whether it&#x27;s a Broadcast, Unicast or Anycast message 2. Whether I&#x27;m sending globally, or targeting a subset of peers (subscribers to some filter). </code></pre> Forgive me if these mappings are flaky, it&#x27;s been a while since I used 0MQ.<p><pre><code> Target Method ~0MQ socket type Global broadcast -&gt; ZMQ_PUSH Global unicast -&gt; ZMQ_PAIR Global anycast -&gt; ZMQ_DEALER Subscribers broadcast -&gt; ZMQ_PUB&#x2F;SUB Subscribers unicast -&gt; ZMQ_REQ&#x2F;REP Subscribers anycast -&gt; ZMQ_ROUTER</code></pre>
评论 #6739820 未加载
PeterisP超过 11 年前
The core of &quot;0MQ is just sockets&quot; argument is that it doesn&#x27;t do the main reason while MQ systems are used instead of, say, sockets - persistence and guaranteed delivery if some endpoints die.<p>All the arguments in the article are about the fact that it does messaging really good with lots of features, but it doesn&#x27;t have the queue part at all.<p>Sure, you can build that yourself on top of 0MQ, but I&#x27;d say that building the &#x27;guaranteed delivery&#x27; part properly is the hard part of an MQ system.
josteink超过 11 年前
I may be nitpicking irellevant details, but I just can&#x27;t help it.<p>Why are they using the Norwegian&#x2F;Nordic letter Ø (pronounced almost like &quot;uh&quot; in English) in their name, a letter most people in the world can&#x27;t type, if they want to get traction?
评论 #6739838 未加载
评论 #6739402 未加载
评论 #6739408 未加载
评论 #6739747 未加载
评论 #6739503 未加载
pflanze超过 11 年前
This may be a reference to &#x27;What have the Romans ever done for us&#x27; in &#x27;Life of Brian&#x27;. <a href="http://www.youtube.com/watch?v=9foi342LXQE" rel="nofollow">http:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=9foi342LXQE</a>
rwmj超过 11 年前
The important detail they miss out is that there&#x27;s no broker and no (built in) persistence, and that sucks when parts of your critical messaging infrastructure go down and you lose messages you thought had been sent.
评论 #6739439 未加载
评论 #6739370 未加载
评论 #6739361 未加载
kimagure超过 11 年前
been looking into this recently. it seems like a lot of the bindings haven&#x27;t been maintained in 2+ years, but the pure java implementation JeroMQ is very active and convenient to use (<a href="https://github.com/zeromq/jeromq" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;zeromq&#x2F;jeromq</a>)<p>the name reminds me of jero, the american-born enka singer (<a href="https://www.youtube.com/watch?v=ba9rKhVAz80" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=ba9rKhVAz80</a>)<p>i&#x27;m not entirely sure if i personally could come up with a good usage for zmq though, unless i were going through tons of data from sources like social media or scientific experimentation
评论 #6739778 未加载
eliben超过 11 年前
Pretty good explanation. I really appreciate such presentation &quot;by analogy&quot;, carefully comparing a technology with something very well known. It provides another angle from which understanding is improved.
krenoten超过 11 年前
I think of 0mq as being a really powerful prototyping tool. If you require guarantees or complex topologies, it will save you a good amount of work to get the thing running. I have never gotten low latency from it, but I know that others have with some effort.
do_easy超过 11 年前
And asserts. Sockets and asserts.
评论 #6741120 未加载
macspoofing超过 11 年前
ZeroMQ markets itself as sockets on steroids, and this hypothetical exchange is to clear up any (hypothetical?) confusion stemming from their own messaging?