ZeroMQ

The Backend Engineering Show with Hussein Nasser

Episode | Podcast

Date: Sun, 05 Jul 2020 15:31:50 GMT

<p><strong>ZeroMQ</strong> is an Open Source Messaging Library designed for a <a href="https://en.wikipedia.org/wiki/High-throughput_computing">high-performance</a> asynchronous <a href="https://en.wikipedia.org/wiki/Message_passing">messaging</a> library. In this video I discuss this tech and build a simple queue with this tech</p> <p>0:00 Intro</p> <p>1:48 What is ZeroMQ?</p> <p>4:48 Messaging Patterns</p> <p>6:42 Socket Types</p> <p>8:55 Simple Queue</p> <p>11:00 Code</p> <p>23:20 ZeroMQ Pros &amp; Cons</p> <p>29:30 Summary</p> <p>Source Code</p> <p><a href="https://github.com/hnasr/javascript_playground/tree/master/zeromq-simplequeue">https://github.com/hnasr/javascript_playground/tree/master/zeromq-simplequeue</a></p> <p>Resources</p> <p><a href="https://github.com/booksbyus/zguide/tree/master/examples/Node.js">https://github.com/booksbyus/zguide/tree/master/examples/Node.js</a></p> <p><a href="https://en.wikipedia.org/wiki/ZeroMQ">https://en.wikipedia.org/wiki/ZeroMQ</a></p> <p><a href="https://blog.scottlogic.com/2015/03/20/ZeroMQ-Quick-Intro.html">https://blog.scottlogic.com/2015/03/20/ZeroMQ-Quick-Intro.html</a></p> <p><a href="http://zguide.zeromq.org/page:chapter3#advanced-request-reply">http://zguide.zeromq.org/page:chapter3#advanced-request-reply</a></p> <p>Outline</p> <ul> <li>What is ZeroMQ? <ul> <li>Message library</li> <li>Message Patterns</li> <li>Broker less</li> <li>Simple you build the components that you need</li> </ul> </li> <li>Sockets Types <ul> <li>REQ</li> <li>REP</li> <li>PUSH</li> <li>PULL</li> <li>ROUTER</li> <li>DEALER</li> </ul> </li> <li>Message PatternS <ul> <li>Synchronous Request/Response</li> <li>Asynchronous Request/Response</li> <li>Publish/Subscribe</li> <li>Push/Pull</li> <li>Exclusive Pair</li> </ul> </li> <li>Example! (Simple Queue (Push Pull))</li> <li>Pros &amp; Cons <ul> <li>Pros <ul> <li>Simple (meh)</li> <li>Efficient lightweight</li> <li>Great for small use cases</li> </ul> </li> <li>Cons <ul> <li>You have to write customize</li> <li>If you are building a large distributed message queue then you need to implement all features</li> <li>Feels over-engineered Could be simpler.</li> </ul> </li> </ul> </li> </ul>