-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
331 lines (277 loc) · 10.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
<!doctype html>
<html lang="en" ng-app="presentation">
<head>
<meta charset="utf-8">
<title>Messaging at Scale</title>
<meta name="description" content="Presentation Template">
<meta name="author" content="Chad Cravens">
<link rel="stylesheet" target="_blank" href="css/index.css">
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<img class="logo" src="./img/logo.png">
<div class="slides">
<section class="intro">
<h1 class="title">Messaging at Scale</h1>
<h1 class="title">With Open Source</h1>
<hr>
<div class="med">Open Source 101</div>
<div class="med">Chad Cravens</div>
<div class="med">Open Source Systems</div>
<a class="small" href="https://github.com/ossys/messaging-at-scale">https://github.com/ossys/messaging-at-scale</a>
</section>
<section class="intro">
<h1>Overview</h1>
<ol>
<li class="fragment">Introduction to Messaging</li>
<li class="fragment">Message Broker - ActiveMQ Artemis</li>
<li class="fragment">Message Router - QPid Dispatch</li>
<li class="fragment">Lightweight Messaging - MQTT with Mosca</li>
<li class="fragment">Nanoservices - ZeroMQ</li>
<li class="fragment">Stream Processing - Apache Kafka</li>
</ol>
</section>
<section class="intro">
<h1>Many Open Source Tools Not Covered</h1>
<ol>
<li class="fragment">Akka (Actor Model)</li>
<li class="fragment">Ejabberd (XMPP)</li>
<li class="fragment">Erlang</li>
<li class="fragment">And Many Many Many More...</li>
</ol>
</section>
<section class="intro">
<h1>What is Messaging?</h1>
<div>Asking this basic question allows us to challenge how we think about computing and software architecture</div>
<hr>
<div>A message is a discrete unit of communication intended by the source for consumption by some recipient or group of recipients.</div>
<img src="./img/sharing-info.png" style="width: 50%; height: 50%;" />
</section>
<section class="intro">
<h1>Why Share Information?</h1>
<ul>
<li class="fragment">Don't have time (Asynchronous)</li>
<li class="fragment">Can't do it (Interfaces / Contracts)</li>
<li class="fragment">Failure (Fault Tolerance)</li>
</ul>
<img class="fragment" src="./img/self-surgery.png" />
</section>
<section class="intro">
<h1>What does it mean to "scale"?</h1>
<ul>
<li class="fragment">Adding more compute nodes</li>
<li class="fragment">Fault Tolerant</li>
</ul>
<h1 class="fragment">But what else?</h1>
<ul>
<li class="fragment">Scaling the team</li>
<li class="fragment">Separation of Concerns</li>
<li class="fragment">Scope of App</li>
</ul>
</section>
<section class="intro">
<h1>Typical Messaging Architecture</h1>
<img src="./img/messaging-architecture.png" />
</section>
<section class="intro">
<img src="./img/artemis-logo.jpg" />
<h1>Message Broker - ActiveMQ Artemis</h1>
<div><u>3 Separate 'ActiveMQ' Projects</u></div>
<ol>
<li>ActiveMQ 5</li>
<li>ActiveMQ Apollo (6)</li>
<li>ActiveMQ Artemis (Active)
<div>Donation of HornetQ to Apache</div>
<div>HornetQ Core Now </div></li>
</ol>
</section>
<section class="intro">
<h1 class="title">AMQ Artemis Architecture</h1>
<img src="./img/artemis-architecture.png" />
</section>
<section class="intro">
<h1 class="title">Scaling AMQ Artemis (Clustering, High Availability)</h1>
<img src="./img/amq-shared-fs.png" />
<img src="./img/amq-network-repl.png" />
</section>
<section class="intro">
<img src="./img/qpid-logo.png" height="30%" width="30%" />
<h1>Message Router - QPid Dispatch</h1>
<ul>
<li>AMQP support only</li>
<li>Uses "addresses" to connect consumers/producers</li>
<li>No persistence</li>
<li>Blocking (Both producer and consumer must be connected)</li>
<li>Can "pass through" messages to broker</li>
</ul>
</section>
<section class="intro">
<h1 class="title">QPid Dispatch Architecture</h1>
<img src="./img/interconnect-network.png" />
</section>
<section class="intro">
<h1>Combining with ActiveMQ Artemis</h1>
<img src="./img/interconnect-amq.png" height="50%" width="50%" />
</section>
<section class="intro">
<img src="./img/mqtt-logo.png" height="30%" width="30%" />
<h1>Lightweight Messaging - MQTT</h1>
<ul>
<li>Message Queuing Telemetry Transport</li>
<li>Designed for lightweight devices, "IoT"</li>
<li>Uses a pub/sub pattern</li>
<li>Very simple API</li>
<li>Defines 3 QoS (Quality of Service) Levels</li>
<li>0 - at most once (fire and forget)</li>
<li>1 - at least once (acknowledged delivery)</li>
<li>2 - exactly once (assured delivery)</li>
</ul>
</section>
<section class="intro">
<h1>Broker Implementations</h1>
<row>
<div class="col-md-6">
<h2>Mosquitto</h2>
<ul>
<li>Written in C</li>
<li>Lightweight and fast</li>
<li>Connect clients</li>
<li>Subscribe / Publish to Topics</li>
</ul>
</div>
<div class="col-md-6">
<h2>Mosca</h2>
<ul>
<li>Written in Node.JS</li>
<li>Ability to use MQTT over WebSockets</li>
<li>Callback Handlers Greatly Enhances Functionality</li>
<li>Great for Real-Time Mobile / Web</li>
</ul>
</div>
</row>
</section>
<section class="intro">
<img src="./img/zeromq-logo.jpg" height="30%" width="30%" />
<h1>Messaging API - ZeroMQ</h1>
<ul>
<li>One of my personal favorites!</li>
<li>Not a broker, but rather an API</li>
<li>"Sockets on Steroids"</li>
<li>Extremely Low Latency: 2.8 million messages / sec on 10GbE</li>
<li>Binding support for dozens of languages (C/C++, NodeJS, R, Scala, Ruby, Java, etc...)</li>
<li>Great documentation!</li>
</ul>
</section>
<section class="zeromq">
<row>
<div class="col-md-6">
<pre>
<code class="language-clike">
void *socket = zmq_socket(context, ZMQ_REP);
zmq_bind(socket, "tcp://server:5555");
zmq_bind(socket, "ipc:///tmp/feeds/0");
zmq_bind(socket, "inproc://endpoint");
</code>
</pre>
</div>
<div class="col-md-6">
<h1>Connection Types</h1>
<ol>
<li>TCP Connection - Over Network</li>
<li>IPC - Inter-Process Communication</li>
<li>inproc - Thread Communication</li>
</ol>
</div>
</row>
</section>
<section class="zeromq">
<row>
<div class="col-md-12">
<h1>"Multi-Threading Magic" with ZeroMQ</h1>
<ol>
<li>Pieter Hintjens and Martin Sustrik discuss challenges of shared memory across threads</li>
<li>Race conditions, critical sections, semaphores, mutexes, lock management, context switches, etc...</li>
<li>What's the Secret? Share data as messages rather than shared state!</li>
</ol>
</div>
</row>
</section>
<section class="zeromq">
<row>
<div class="col-md-12">
<h1>Why I believe this is Powerful...</h1>
<ol>
<li>Current Dev Ops Capabilities Allow for Ephemeral Environments</li>
<li>Design threaded apps as "nanoservices", individual compute nodes</li>
<li>(Almost) seamlessly change between multi-threaded / multi-process / multi-node for distributed computing</li>
</ol>
</div>
</row>
</section>
<section class="zeromq">
<h1>ZeroMQ Patterns</h1>
<row>
<div class="col-md-4">
<h2>Request / Reply</h2>
<img src="./img/req-rep.png" />
</div>
<div class="col-md-4">
<h2>Publish / Subscribe</h2>
<img src="./img/pub-sub.png" />
</div>
<div class="col-md-4">
<h2>Push / Pull</h2>
<img src="./img/push-pull.png" />
</div>
</row>
</section>
<section class="intro">
<h1>Combine Patterns</h1>
<img src="./img/patterns.png" height="50%" width="50%" />
</section>
<section class="zeromq">
<row>
<div class="col-md-12">
<h1>Quick Note on Protocols with ZeroMQ</h1>
<ul>
<li>ZeroMQ does not support any specific protocol (binary)</li>
<li>Developers have the freedom to develop their own</li>
<li>Suggest looking into protobufs (Google), Thrift (Facebook), Avro (Hadoop / Spark)</li>
</ul>
</div>
</row>
</section>
<section class="intro">
<img src="./img/kafka-logo.png" height="50%" width="50%" />
<h1>Stream Processing - Kafka</h1>
<ul>
<li>Pub/Sub Fault-Tolerant Messaging System</li>
<li>Messages are Persisted to Disk</li>
<li>Built on top of Zookeeper Synchronization Service</li>
<li>Integrates well with Spark (SMACK Stack)</li>
<li>Very Efficient and Fast Persistence</li>
<li>Streaming Library</li>
</ul>
</section>
<section class="intro">
<h1 class="title">Thank you!</h1>
<hr>
<div class="med">Chad Cravens</div>
<div class="med">Open Source Systems</div>
<div class="med">[email protected]</div>
<a class="small" href="https://github.com/ossys/messaging-at-scale">https://github.com/ossys/messaging-at-scale</a>
</section>
</div>
</div>
<script src="js/bundle.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
</script>
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
</body>
</html>