SlideShare a Scribd company logo
Introduction to
ZeroMQ
Howard Lee
2013/05/16
113年5月17⽇日星期五
Announce
ØMQ, ZeroMQ, and 0MQ used in this
slides are trademarks of iMatix
Corporation
ØMQ is copyright (c) Copyright (c)
2007-2012 iMatix Corporation and
Contributors. ØMQ is free software
licensed under the LGPL.
Above statements are referred from footer
of its website
213年5月17⽇日星期五
Outline
Concept
Demo
Reference
313年5月17⽇日星期五
If you have known these, you will know
what I say
Java, Ruby
Network programming
Multithread
Background knowledge
413年5月17⽇日星期五
Online chat room is a basic program for
beginner of network programming
513年5月17⽇日星期五
How do you do when building a program
of online chat-room for multi-players?
613年5月17⽇日星期五
Centralize-typeServer
Client
Client
Client
713年5月17⽇日星期五
Good
What if the server broken......?
813年5月17⽇日星期五
-- Howard Lee said :p
2013.05.16
Everything is important means
nothing is important
913年5月17⽇日星期五
Everyone is a server means
no one is a server
1013年5月17⽇日星期五
Client
Client
Client
De-centralize
1113年5月17⽇日星期五
Previous page about de-centralize use
many sockets
More sockets grow exponential when a
client joins!
1213年5月17⽇日星期五
Here is
1313年5月17⽇日星期五
Apply scenarios above pages
It can do more!
We only pick up above two scenarios at
today’s lightning session
1413年5月17⽇日星期五
Actor model
De-centralize --> zero broker
Distributed computing
Concept
1513年5月17⽇日星期五
Actor model in ZeroMQ
REQuest-REPly
PUBlish-SUBcribe
Pipeline
1613年5月17⽇日星期五
Actor model in ZeroMQ
One machine can play many actors
simultaneously
Better scalability than data-centric
distributed computing because easier to
extend
1713年5月17⽇日星期五
REQuest-REPly
Reference:https://github.com/imatix/zguide/raw/
master/images/fig2.png
After successfully connected,
REQ and REP can start to act like
pin-pong
1813年5月17⽇日星期五
REQuest-REPly
Only suite for demonstrating simple
program of network chatting room to
your TA with limited condition: pin-
pong action. lol
You can design your own transmit
strategy when speed of network aren’t
stable for your file-transfer application
according the time of response-received
from other side.
1913年5月17⽇日星期五
PUBlish-SUBscribe
Publisher
PUB
SUB
Subscriber
bind
Connect Connect
SUB
Subscriber
SUB
Subscriber
Connect
update
2013年5月17⽇日星期五
PUBlish-SUBscribe
Scenario: News feeds
Must explicitly assign subscribe
condition: zmq_setsockopt
Auto delivered if they are connected
successfully
2113年5月17⽇日星期五
Pipeline
Always synchronize
workers to start
load balancing from
vent. to worker
fair-queuing: Sink
collect data from
workers
Reference: https://github.com/imatix/zguide/
raw/master/images/fig5.png
2213年5月17⽇日星期五
Pipeline scenarios
Supercomputing
Wireless sensor network
...etc
2313年5月17⽇日星期五
Dealer
enhanced REQ
no restrict behaviors of send and
receive
Router
Prepend identity of originator to
message before passing it to another
application
2413年5月17⽇日星期五
Example of Router and Dealer
Reference: https://github.com/imatix/zguide/raw/
master/images/fig17.png
2513年5月17⽇日星期五
More actors model
Router
Dealer
Push
Pull
Pair
I won’t explain details today
2613年5月17⽇日星期五
Features
2713年5月17⽇日星期五
De-centralized
Reference:https://github.com/imatix/zguide/raw/
master/images/fig8.png
2813年5月17⽇日星期五
Distributed
Scalability
2913年5月17⽇日星期五
Distributed
Scalability
2913年5月17⽇日星期五
Sockets
IPC
Thread communication
TCP
Multicast
...etc
3013年5月17⽇日星期五
ZeroMQ Centralized
Server - REPly
Client - REQuest
Client - REQuest
3113年5月17⽇日星期五
AUto reconnect
First, clients issue request of
connection
Later, server binds a port to reply the
requests from clients
Centralize
3213年5月17⽇日星期五
AUto reconnect
First, clients issue request of
connection
Later, server binds a port to reply the
requests from clients
Centralize
Strange!
Not conventional
3213年5月17⽇日星期五
Demo
3313年5月17⽇日星期五
Code of REQ-REP
hwserver.rb
hwclient.rb
3413年5月17⽇日星期五
Demo REQ-REP
3513年5月17⽇日星期五
Code of PUB-SUB
wuserver.rb wuclient.rb
3613年5月17⽇日星期五
Demo PUB-SUB
3713年5月17⽇日星期五
Demo
Pipeline
taskvent.rb
taskwork.rb
tasksink.rb
3813年5月17⽇日星期五
More examples are here
https://github.com/imatix/zguide/tree/
master/examples/
3913年5月17⽇日星期五
2011 SERN CERN comment ZeroMQ and other
frameworks, which based on COBRA
http://www.zeromq.org/local--files/intro:read-the-
manual/Middleware%20Trends%20and%20Market
%20Leaders%202011.pdf
4013年5月17⽇日星期五
Reference
Implementing Distributed Application
using ZeroMQ http://www.slideshare.net/
fcrippa/europycon2011-implementing-
distributed-application-using-zeromq
Multithread magic http://
www.slideshare.net/pieterh/
fosdem-2011-0mq
4113年5月17⽇日星期五
Reference
Overview of ZeroMQ http://
www.slideshare.net/pieterh/overview-of-
zeromq
4213年5月17⽇日星期五
Question?
4313年5月17⽇日星期五
Multi-players chat
room?
Leave it to you :p
4413年5月17⽇日星期五
FAQ
Get peer list?
No
4513年5月17⽇日星期五
Notice
These slides has presented in micro
session CNA@CCU 2013
If I forgot to give a credit to you via
referring your content, I will append it
to reference page as soon as you notify
me about that. :)
4613年5月17⽇日星期五

More Related Content

PDF
20180426测速 - 重庆到Vultr各机房的测速数据
PDF
twMVC#25 | ASP.NET MVC A/B Testing 的眉眉角角
PDF
20180514测速 - 内蒙古到Vultr各机房的测速数据
PDF
20180527测速 - 重庆到Vultr各机房的测速数据
KEY
Distributed app development with nodejs and zeromq
PDF
ZeroMQ Is The Answer
KEY
Europycon2011: Implementing distributed application using ZeroMQ
PDF
You're Going To Need A Bigger Toolbox
20180426测速 - 重庆到Vultr各机房的测速数据
twMVC#25 | ASP.NET MVC A/B Testing 的眉眉角角
20180514测速 - 内蒙古到Vultr各机房的测速数据
20180527测速 - 重庆到Vultr各机房的测速数据
Distributed app development with nodejs and zeromq
ZeroMQ Is The Answer
Europycon2011: Implementing distributed application using ZeroMQ
You're Going To Need A Bigger Toolbox

Viewers also liked (12)

PDF
Message Queues for Web Applications
PDF
Scala and ZeroMQ: Events beyond the JVM
KEY
PPTX
Roman Kuznietsov: Zeromq: sockets on steroids.Zero mq
PPTX
zeromq
PPTX
RabbitMq
PPTX
ZeroMQ: Super Sockets - by J2 Labs
ODP
Sistema de Mensajeria de Colas con ZeroMQ y Python
PDF
Software Architecture over ZeroMQ
PPTX
Build reliable, traceable, distributed systems with ZeroMQ
KEY
Zero mq logs
ODP
Overview of ZeroMQ
Message Queues for Web Applications
Scala and ZeroMQ: Events beyond the JVM
Roman Kuznietsov: Zeromq: sockets on steroids.Zero mq
zeromq
RabbitMq
ZeroMQ: Super Sockets - by J2 Labs
Sistema de Mensajeria de Colas con ZeroMQ y Python
Software Architecture over ZeroMQ
Build reliable, traceable, distributed systems with ZeroMQ
Zero mq logs
Overview of ZeroMQ
Ad

Similar to Introduction to ZeroMQ (20)

PDF
twMVC#33玩轉 Azure 彈性部署
PDF
模糊也是一種美 - 從 BlurHash 探討前後端上傳圖片架構
PDF
使用Javascript及HTML5打造協同運作系統
PPT
Bluemix Node-Red Part II
PPTX
Accel series 2021_summer zh
PDF
OpenWRT, A value-add base solution for your product. (1st part, chihchun)
PDF
Code review on github training ( intermediate )
PDF
MiCloud服務提供者訓練
PDF
Cncf k8s Ingress Example-03
PDF
twMVC#42 讓我們用一種方式來開發吧
ODP
[BizLePro] 主題講座 #7:商業利用怎麼行? - 從開源授權十個常見 FAQ 來了解
PDF
twMVC#41 hololens2 MR
PPT
Introduction to ngn sce
PDF
Proxmox VE 功能概觀、案例分享與實用工具 [2019/12/07] @Proxmox VE 中文使用者社團 2019 年會
PDF
门户网站宕机网络分析报告
PPT
轻量级Flash服务器开发框架(刘恒)
PDF
架構這件事 - Azure 可以幫助什麼 - 如何選擇使用什麼 Azure 服務
PDF
Is it really easy for companies to import Ansible automation
PPTX
初探 Elastic Observability 的實踐方法
PDF
HKPC 行業專題培訓講座 , 雲計算 ~ 在零售業 (II) 實踐篇
twMVC#33玩轉 Azure 彈性部署
模糊也是一種美 - 從 BlurHash 探討前後端上傳圖片架構
使用Javascript及HTML5打造協同運作系統
Bluemix Node-Red Part II
Accel series 2021_summer zh
OpenWRT, A value-add base solution for your product. (1st part, chihchun)
Code review on github training ( intermediate )
MiCloud服務提供者訓練
Cncf k8s Ingress Example-03
twMVC#42 讓我們用一種方式來開發吧
[BizLePro] 主題講座 #7:商業利用怎麼行? - 從開源授權十個常見 FAQ 來了解
twMVC#41 hololens2 MR
Introduction to ngn sce
Proxmox VE 功能概觀、案例分享與實用工具 [2019/12/07] @Proxmox VE 中文使用者社團 2019 年會
门户网站宕机网络分析报告
轻量级Flash服务器开发框架(刘恒)
架構這件事 - Azure 可以幫助什麼 - 如何選擇使用什麼 Azure 服務
Is it really easy for companies to import Ansible automation
初探 Elastic Observability 的實踐方法
HKPC 行業專題培訓講座 , 雲計算 ~ 在零售業 (II) 實踐篇
Ad

Recently uploaded (20)

PPTX
3分钟读懂佩珀代因大学毕业证Pepperdine毕业证学历认证
PPTX
A Digital Transformation Methodology.pptx
PPTX
3分钟读懂南威尔士大学毕业证UCB毕业证学历认证
PPTX
3分钟读懂利物浦约翰摩尔大学毕业证LJMU毕业证学历认证
PPTX
3分钟读懂索尔福德大学毕业证Salford毕业证学历认证
PDF
想要安全提高成绩?我们的黑客技术采用深度伪装和多层加密手段,确保你的信息安全无忧。价格公道,流程简单,同时提供全面的信息保护和事后痕迹清理,让你轻松提升G...
PPTX
3分钟读懂加州大学欧文分校毕业证UCI毕业证学历认证
PPTX
3分钟读懂拉夫堡大学毕业证LU毕业证学历认证
PPTX
ONU and OLT from Baudcom Jenny training PPT
PPTX
3分钟读懂福特汉姆大学毕业证Fordham毕业证学历认证
PPTX
模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板
PPTX
3分钟读懂伦敦政治经济学院毕业证LSE毕业证学历认证
PPTX
3分钟读懂伦敦商学院毕业证LBS毕业证学历认证
PPTX
3分钟读懂纽曼大学毕业证Newman毕业证学历认证
PPTX
3分钟读懂贵湖大学毕业证U of G毕业证学历认证
PPTX
3分钟读懂伦敦大学学院毕业证UCL毕业证学历认证
PDF
01_Course_Introduction(20210916課後更新).pdf
PPTX
3分钟读懂曼彻斯特大学毕业证UoM毕业证学历认证
PPTX
3分钟读懂皇家艺术学院毕业证RCA毕业证学历认证
PDF
黑客出手,分数我有!安全可靠的技术支持,让你的GPA瞬间提升,留学之路更加顺畅!【微信:viphuzhao】
3分钟读懂佩珀代因大学毕业证Pepperdine毕业证学历认证
A Digital Transformation Methodology.pptx
3分钟读懂南威尔士大学毕业证UCB毕业证学历认证
3分钟读懂利物浦约翰摩尔大学毕业证LJMU毕业证学历认证
3分钟读懂索尔福德大学毕业证Salford毕业证学历认证
想要安全提高成绩?我们的黑客技术采用深度伪装和多层加密手段,确保你的信息安全无忧。价格公道,流程简单,同时提供全面的信息保护和事后痕迹清理,让你轻松提升G...
3分钟读懂加州大学欧文分校毕业证UCI毕业证学历认证
3分钟读懂拉夫堡大学毕业证LU毕业证学历认证
ONU and OLT from Baudcom Jenny training PPT
3分钟读懂福特汉姆大学毕业证Fordham毕业证学历认证
模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板模板
3分钟读懂伦敦政治经济学院毕业证LSE毕业证学历认证
3分钟读懂伦敦商学院毕业证LBS毕业证学历认证
3分钟读懂纽曼大学毕业证Newman毕业证学历认证
3分钟读懂贵湖大学毕业证U of G毕业证学历认证
3分钟读懂伦敦大学学院毕业证UCL毕业证学历认证
01_Course_Introduction(20210916課後更新).pdf
3分钟读懂曼彻斯特大学毕业证UoM毕业证学历认证
3分钟读懂皇家艺术学院毕业证RCA毕业证学历认证
黑客出手,分数我有!安全可靠的技术支持,让你的GPA瞬间提升,留学之路更加顺畅!【微信:viphuzhao】

Introduction to ZeroMQ