SlideShare a Scribd company logo
http://zero.mq/
A ØMQ socket is what you get when
you take a normal TCP socket, inject
it with a mix of radioactive isotopes
 stolen from a secret Soviet atomic
  research project, bombard it with
1950-era cosmic rays, and put it into
  the hands of a drug-addled comic
 book author with a badly-disguised
   fetish for bulging muscles clad in
 spandex. Yes, ØMQ sockets are the
    world-saving superheros of the
           networking world.
ZeroMQ
Problem
How to
    easy connect
any code to any code,
      anywhere
Existing solutions
Connect

• In-process in-proc://some-point
• Unix sockets ipc://some/pipe
• BSD sockets tcp://0.0.0.0:1234
• Others           multicast (PGM) ...
BSD Sockets
BSD   Protocols




        TCP       * Images by Tenouk
BSD    Protocols




               UDP

      TCP
                   * Images by Tenouk
BSD       Sockets

 • New/Exit - socket() , close()
 • Configure - setsockopt()
 • Connect - bind() , connect()
 • Use - send() , recv()
BSD    Problems


• Need to choice of transport
• Stream (TCP) , datagram (UDP)
• Peer-2-Peer connections
ZeroMQ
zguide.zero.mq
A ØMQ socket is what you get when
you take a normal TCP socket, inject
it with a mix of radioactive isotopes
 stolen from a secret Soviet atomic
  research project, bombard it with
1950-era cosmic rays, and put it into
  the hands of a drug-addled comic
 book author with a badly-disguised
   fetish for bulging muscles clad in
 spandex. Yes, ØMQ sockets are the
    world-saving superheros of the
           networking world.
in a Hundred Words
    ØMQ (ZeroMQ, 0MQ, zmq) looks like an embeddable
      networking library but acts like a concurrency
                           framework.
  It gives you sockets that carry whole messages across
various transports like in-process, inter-process, TCP, and
                            multicast.
 You can connect sockets N-to-N with patterns like
fanout, pub-sub, task distribution, and request-reply. It's fast
       enough to be the fabric for clustered products. Its
   asynchronous I/O model gives you scalable multicore
applications, built as asynchronous message-processing tasks.
          It has a score of language APIs and runs
                on most operating systems.
       ØMQ is from iMatix and is LGPL open source.
Many languages




           * Images by iMatrix
Sockets

•Well known API
•Messages oriented
• Transport agnostic
•Socket-level topology
Well known API
BSD     Sockets

 • New/Exit - socket()
 • Configure - setsockopt()
 • Connect - bind()
 • Use - send() , recv()
Sockets

• New/Exit - zmq_socket()
• Configure - zmq_setsockopt()
• Connect - zmq_bind()
• Use - zmq_send() , zmq_recv()
ZeroMQ
Hello world (server)
Hello world (client)
Message oriented
Message oriented
           Send




Receive
Various transports
Various transports



• req.bind(‘inproc://some/pipe’)
• req.bind(‘ipc://some/pipe’)
• req.bind(’tcp://127.0.0.1:5555’)
Patterns
Socket level topology
Request - Reply




             * Images by iMatrix
Publish - Subscribe




                * Images by iMatrix
Parallel tasks




             * Images by iMatrix
Demo
Scale
Start small




              * Images by iMatrix
Bigger




         * Images by iMatrix
And bigger...




                * Images by iMatrix
Devices




          Device



           * Images by iMatrix
QUEUE




        * Images by iMatrix
Demo
Implementation
Ruby-FFI
Foreign Function Interface
Ruby-FFI
Ruby-FFI (Win)
Why FFI?

•Debian: no need from *-dev

• Multi-platform

• Easy to read (Ruby, not C)
Projects
http://zeromq.org/docs:labs
http://mongrel2.org
ZeroMQ
Evolution
 App          App      App

 HTTP        HTTP     HTTP

 Net          Net      Net

Webrick     Mongrel   Thin
Evolution

            App

         HTTP

            Net

       Mongrel2
Mongrel2

Push/Pull      0mq        Pub/Sub

            Handler
                Handler             Responses
                      Handler
Requests
Demo
Future



• Part of Linux kernel
• http://www.crossroads.io/
• zerocloud ?
Thank you!

More Related Content

ODP
Overview of ZeroMQ
PDF
ZeroMQ Is The Answer
PPTX
zeromq
PDF
Introduction to the Disruptor
PPTX
Prometheus (Prometheus London, 2016)
PDF
Microservices
KEY
Europycon2011: Implementing distributed application using ZeroMQ
PPTX
ZeroMQ: Super Sockets - by J2 Labs
Overview of ZeroMQ
ZeroMQ Is The Answer
zeromq
Introduction to the Disruptor
Prometheus (Prometheus London, 2016)
Microservices
Europycon2011: Implementing distributed application using ZeroMQ
ZeroMQ: Super Sockets - by J2 Labs

What's hot (20)

PDF
Network-Connected Development with ZeroMQ
 
PDF
QThreads: Are You Using Them Wrong?
 
PDF
PDF
Cloudhub 2.0
ODP
FOSDEM 2011 - 0MQ
PDF
TestNG Annotations in Selenium | Edureka
PPTX
UI Programming with Qt-Quick and QML
PPTX
Introduction To Microservices
PPTX
Node js introduction
PPTX
Enterprise Integration Patterns
PDF
Introduction to Docker Compose
PPTX
Golang - Overview of Go (golang) Language
PDF
Build Low-Latency Applications in Rust on ScyllaDB
PDF
Real Life Clean Architecture
PDF
In-Depth Model/View with QML
 
PDF
ZeroMQ with NodeJS
PDF
Introduction to AMQP Messaging with RabbitMQ
PPTX
Jenkins CI presentation
PPTX
Basic Concept of Node.js & NPM
Network-Connected Development with ZeroMQ
 
QThreads: Are You Using Them Wrong?
 
Cloudhub 2.0
FOSDEM 2011 - 0MQ
TestNG Annotations in Selenium | Edureka
UI Programming with Qt-Quick and QML
Introduction To Microservices
Node js introduction
Enterprise Integration Patterns
Introduction to Docker Compose
Golang - Overview of Go (golang) Language
Build Low-Latency Applications in Rust on ScyllaDB
Real Life Clean Architecture
In-Depth Model/View with QML
 
ZeroMQ with NodeJS
Introduction to AMQP Messaging with RabbitMQ
Jenkins CI presentation
Basic Concept of Node.js & NPM
Ad

Viewers also liked (16)

PPTX
Roman Kuznietsov: Zeromq: sockets on steroids.Zero mq
PPTX
RabbitMq
PDF
Zeromq anatomy & jeromq
PDF
You're Going To Need A Bigger Toolbox
PDF
Message Queues for Web Applications
PDF
Introduction to ZeroMQ
PDF
Introduction to Heroku Postgres
PDF
Introduction to ZeroMQ - eSpace TechTalk
PDF
RabbitMQ: Message queuing that works
PDF
Software Architecture over ZeroMQ
PDF
PPTX
The RabbitMQ Message Broker
PDF
The Future of Messaging: RabbitMQ and AMQP
PDF
RabbitMQ Operations
PPTX
High powered messaging with RabbitMQ
Roman Kuznietsov: Zeromq: sockets on steroids.Zero mq
RabbitMq
Zeromq anatomy & jeromq
You're Going To Need A Bigger Toolbox
Message Queues for Web Applications
Introduction to ZeroMQ
Introduction to Heroku Postgres
Introduction to ZeroMQ - eSpace TechTalk
RabbitMQ: Message queuing that works
Software Architecture over ZeroMQ
The RabbitMQ Message Broker
The Future of Messaging: RabbitMQ and AMQP
RabbitMQ Operations
High powered messaging with RabbitMQ
Ad

Similar to ZeroMQ (20)

PDF
ZeroMQ - Sockets on steroids!
PDF
Lindsay distributed geventzmq
PDF
0 mq the guide
PPTX
øMQ Vortrag
PDF
NullMQ @ PDX
KEY
Distributed app development with nodejs and zeromq
PDF
ekbpy'2012 - Антон Патрушев - ZeroMQ
PDF
ØMQ - An Introduction
PDF
IoTaConf 2014 - IoT Connectivity, Standards, and Architecture
PDF
Introduction to WebSockets
PPTX
RabbitMQ and EasyNetQ
PPTX
Socket programming with php
PPTX
Ømq - Distributed queues, threads and sockets
PDF
Messaging for the Internet of Awesome Things
PPTX
Zeromq - Pycon India 2013
ODP
Fosdem 2009
PDF
ZeroMQ Is The Answer: DPC 11 Version
KEY
Websockets with ruby
PDF
Building Distributed Systems
ZeroMQ - Sockets on steroids!
Lindsay distributed geventzmq
0 mq the guide
øMQ Vortrag
NullMQ @ PDX
Distributed app development with nodejs and zeromq
ekbpy'2012 - Антон Патрушев - ZeroMQ
ØMQ - An Introduction
IoTaConf 2014 - IoT Connectivity, Standards, and Architecture
Introduction to WebSockets
RabbitMQ and EasyNetQ
Socket programming with php
Ømq - Distributed queues, threads and sockets
Messaging for the Internet of Awesome Things
Zeromq - Pycon India 2013
Fosdem 2009
ZeroMQ Is The Answer: DPC 11 Version
Websockets with ruby
Building Distributed Systems

More from Stoyan Zhekov (17)

PDF
Multirotors
PDF
Padrino - the Godfather of Sinatra
KEY
KEY
Deployment on Heroku
KEY
Push the web with HTML5
KEY
Foreman - Process manager for applications with multiple components
KEY
Social Network for spare parts
KEY
Using XMPP Presence stanzas for real-time parking information
PDF
Ruby cooking
KEY
EventMachine
PDF
Webhooks - glue for the web (japanese)
PDF
Webhooks - glue for the web
PDF
Microblogging via XMPP (japanese)
PDF
Microblogging via XMPP
PDF
Ruby off Rails (english)
PDF
Ruby off Rails (japanese)
PDF
Rails Deployment with NginX
Multirotors
Padrino - the Godfather of Sinatra
Deployment on Heroku
Push the web with HTML5
Foreman - Process manager for applications with multiple components
Social Network for spare parts
Using XMPP Presence stanzas for real-time parking information
Ruby cooking
EventMachine
Webhooks - glue for the web (japanese)
Webhooks - glue for the web
Microblogging via XMPP (japanese)
Microblogging via XMPP
Ruby off Rails (english)
Ruby off Rails (japanese)
Rails Deployment with NginX

Recently uploaded (20)

PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Approach and Philosophy of On baking technology
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Tartificialntelligence_presentation.pptx
PDF
August Patch Tuesday
PDF
Mushroom cultivation and it's methods.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
OMC Textile Division Presentation 2021.pptx
Group 1 Presentation -Planning and Decision Making .pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Approach and Philosophy of On baking technology
Programs and apps: productivity, graphics, security and other tools
Univ-Connecticut-ChatGPT-Presentaion.pdf
A Presentation on Artificial Intelligence
Heart disease approach using modified random forest and particle swarm optimi...
Network Security Unit 5.pdf for BCA BBA.
Tartificialntelligence_presentation.pptx
August Patch Tuesday
Mushroom cultivation and it's methods.pdf
A comparative study of natural language inference in Swahili using monolingua...
MIND Revenue Release Quarter 2 2025 Press Release
Reach Out and Touch Someone: Haptics and Empathic Computing
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
A comparative analysis of optical character recognition models for extracting...
Encapsulation_ Review paper, used for researhc scholars
cloud_computing_Infrastucture_as_cloud_p
OMC Textile Division Presentation 2021.pptx

ZeroMQ

Editor's Notes