Introduction to ZeroMQeSpace TechTalks@modsaid
Outline● Quick Definition● Creators● Why ØMQ?● What the hell is it?● Patterns● Demos● Should it be C?● Discussion
Quick Definition● ØMQ (aka ZeroMQ, 0MQ or ZMQ)● a high-performance asynchronous messaging library● aimed at use in scalabl...
Creators - Martin Sústrik● Martin Sústrik (@sustrik)● Expert in the field of messagingmiddle-ware● Participated in the cre...
Creators - Pieter Hintjens● Belgian software developer, writer.● Past president of the Foundation for a Free InformationIn...
Why ØMQ?● Moores Law means more moving pieces● Cost of Connection is high● Needed cheaper, fast and reliable connections● ...
What the hell is it?● Intelligent socket library for messaging● Many kinds of connection patterns● Multiplatform, multi-la...
What the hell is it? (2)● Socket like API. But better than sockets● Based on reactor pattern“Event handling pattern for ha...
Patterns● Request – Reply● Publish-Subscribe● Push-Pull (pipeline)● Exclusive Pair
Request-Reply Pattern
Publish-Subscribe Pattern
Pipeline Pattern
Demo● HelloWorld req-rep● Weather pub-sub● Tasks workers (pipeline)
Use Case● Centralized Logging for rails instances“Several application servers, consolidated logs”
ØMQ Transports● Threads in one process (inproc://)● Processes on one box (ipc://)● Processes on one network (tcp://)● Mult...
ØMQ Routing● Round-robin (REQ, PUSH, DEALER)● Multicast (PUB)● Fair-queuing (REP, SUB, PULL, DEALER)● Explicit addressing ...
ØMQ Benefits● Start with simple / fast language (Python)● Move to faster language where needed (C)● Run on arbitrary platf...
AMQP vs ØMQ● Centralized (like SVN)● Family of messagingprotocols used throughimplementations likeRabbitMQ, Apache Qpid..●...
Why should it have been C?● C++ was chosen for STL,coding style, destructors,virtual functions● 5 years old admission:poor...
References● http://zguide.zeromq.org/page:all● http://en.wikipedia.org/wiki/%C3%98MQ● http://www.imatix.com/● http://www.z...
Upcoming SlideShare
Loading in …5
×

Introduction to ZeroMQ - eSpace TechTalk

947
-1

Published on

A quick overview about zeroMQ as part of eSpace weekly techtalks

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
947
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
30
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Introduction to ZeroMQ - eSpace TechTalk

  1. 1. Introduction to ZeroMQeSpace TechTalks@modsaid
  2. 2. Outline● Quick Definition● Creators● Why ØMQ?● What the hell is it?● Patterns● Demos● Should it be C?● Discussion
  3. 3. Quick Definition● ØMQ (aka ZeroMQ, 0MQ or ZMQ)● a high-performance asynchronous messaging library● aimed at use in scalable distributed or concurrentapplications.● It provides a message queue, but unlike message-orientedmiddleware, a ØMQ system can run without a dedicatedmessage broker.● The library is designed to have a familiar socket-style API.
  4. 4. Creators - Martin Sústrik● Martin Sústrik (@sustrik)● Expert in the field of messagingmiddle-ware● Participated in the creation &implementation reference of AMQPstandard.● Founder of the ØMQ project.● currently is working on integration ofmessaging technology with OS &Internet stack
  5. 5. Creators - Pieter Hintjens● Belgian software developer, writer.● Past president of the Foundation for a Free InformationInfrastructure● Author of Orielly ZeroMQ● CEO or iMatix
  6. 6. Why ØMQ?● Moores Law means more moving pieces● Cost of Connection is high● Needed cheaper, fast and reliable connections● Physics of Software Development
  7. 7. What the hell is it?● Intelligent socket library for messaging● Many kinds of connection patterns● Multiplatform, multi-language (30+: ruby, C, C++, java,python, …. )● Fast (8M msg/sec, 30usec latency)● Small (20K lines of C++ code)● Distributed● Open source LGPL (large community)
  8. 8. What the hell is it? (2)● Socket like API. But better than sockets● Based on reactor pattern“Event handling pattern for handling service requestsdelivered concurrently to a service handler by one or moreinputs. The service handler then demultiplexes theincoming requests and dispatches them synchronously tothe associated request handlers.”
  9. 9. Patterns● Request – Reply● Publish-Subscribe● Push-Pull (pipeline)● Exclusive Pair
  10. 10. Request-Reply Pattern
  11. 11. Publish-Subscribe Pattern
  12. 12. Pipeline Pattern
  13. 13. Demo● HelloWorld req-rep● Weather pub-sub● Tasks workers (pipeline)
  14. 14. Use Case● Centralized Logging for rails instances“Several application servers, consolidated logs”
  15. 15. ØMQ Transports● Threads in one process (inproc://)● Processes on one box (ipc://)● Processes on one network (tcp://)● Multicast group (pgm://)
  16. 16. ØMQ Routing● Round-robin (REQ, PUSH, DEALER)● Multicast (PUB)● Fair-queuing (REP, SUB, PULL, DEALER)● Explicit addressing (ROUTER)● Unicast (PAIR)
  17. 17. ØMQ Benefits● Start with simple / fast language (Python)● Move to faster language where needed (C)● Run on arbitrary platforms (Windows, Android)● Scale to arbitrary sizes (2 cores, 16 cores...)● No per-core or per-seat licensing● Easy to experiment and learn
  18. 18. AMQP vs ØMQ● Centralized (like SVN)● Family of messagingprotocols used throughimplementations likeRabbitMQ, Apache Qpid..● Main use cases: transientpubsub distribution andreliable request-reply● Dozens of pieces doingperhaps a hundredthousand messages persecond● Distributed (like git)● Messaging library, andtools● Covers transient pubsub,unreliable request-reply,pipeline, and peer-to-peer.● Hundreds or thousands ofpieces perhaps doinghundreds of millions ofmessages per second
  19. 19. Why should it have been C?● C++ was chosen for STL,coding style, destructors,virtual functions● 5 years old admission:poor choice● Exception Handlingguarantee not failing, butnot undefined behavior● Meant to be infrastructure● Preventing undefinedbehavior more important● More efficient compiledcode● System program● Recent translation to C,nanomsg (not releasedyet)
  20. 20. References● http://zguide.zeromq.org/page:all● http://en.wikipedia.org/wiki/%C3%98MQ● http://www.imatix.com/● http://www.zeromq.org/docs:welcome-from-amqp● http://www.rabbitmq.com/blog/tag/zeromq/● http://www.250bpm.com/blog:4 (why it shouldve been C)● http://nanomsg.org/ (C endeavor)● http://www.zeromq.org/docs:labs● http://www.slideshare.net/pieterh/overview-of-zeromq
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×