forked from ongardie/raft-talk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
564 lines (466 loc) · 16.2 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
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Raft</title>
<meta name="description" content="The Raft Consensus Algorithm">
<meta name="author" content="Diego Ongaro">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="reveal.js/css/reveal.css">
<link rel="stylesheet" href="reveal.js/css/theme/white.css" id="theme">
<style>
.left {
text-align: left;
}
ul.left {
display: block;
padding-left: 2em;
}
.reveal section img {
border: 0;
box-shadow: none;
}
@media print {
.reveal blockquote {
box-shadow: none;
background: inherit;
}
} /* end @media print */
.reveal em {
color: #1b91ff;
font-style: normal;
}
.reveal h1 {
font-size: 2.4em;
}
.reveal h2 {
font-size: 1.8em;
}
.reveal ol li {
font-weight: bold;
}
.reveal ol li ul {
font-weight: normal;
}
.reveal ol li ul li {
font-weight: normal;
}
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4,
.reveal h5,
.reveal h6 {
text-transform: none;
}
</style>
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="reveal.js/lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'reveal.js/css/print/' + (window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper') + '.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<a href="https://raft.github.io"><img src="raft.png" style="margin: 0; width: 200px; box-shadow: none" /></a>
<h2>The Raft Consensus Algorithm</h2>
<h4>Diego Ongaro and John Ousterhout</h4>
<h4>January 2017</h4>
<div>
<img src="stanford.png" style="padding: 0 40px" />
<img src="salesforce.png" style="padding: 0 40px; height: 75px"/>
</div>
<p style="font-size: .4em; clear: both;">
Source code available at <a href="https://github.com/ongardie/raft-talk">https://github.com/ongardie/raft-talk</a>.
<br />
Unless otherwise noted, this work is:
<br />
© 2012-2017 Diego Ongaro,
© 2012-2014 John Ousterhout.
<br />
Licensed under the <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
<br />
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img style="margin: 2px; border: 0; box-shadow: none" alt="Creative Commons License" style="border-width:0" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAPCAIAAAD8q9/YAAAABGdBTUEAANbY1E9YMgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAISSURBVHjaYmAYYYARiP///z9SfMvIyAJhrdm0Glliz669M6fO7OjoKC8vx9Tm6up66tSptu5WcQlxIFdeVsHVyfXjh4+D3LeQeGXClHj54uXyxctx+RYIdu/ebWZmNrl/CoT74eOHwoLCoRLJWDy8fMkKYWFhXL6FAGBw3Lxxc8PajUD2x08fPHw8vH28h6qHL128lJ6eDmScPXtWWVkZmO6Bafj9+/dAEsgGigDFjY2NXVxcrl29BjWFiQnIRUs/EICcnDDZA+/hSxcvf/70GegfIDssLAzIALoPSHZ2dgL9+e7dO2DM37t3DygLFLxz+w48VQMTOWYJAQQQ78EZQBLIHkQe/vrlC5AUFBQERinQYxCfAxMwkK2kpAQUT0tLCw0NhRXxUKf//PmDkYURs5BA9h7EzwPrWywe5ubhAZJA3wL9BvQhMFYhxTKQC/QzULyiomLWrFloiZOdneP/n/94Ynjw5mE9fV1eXl6IP4ERu2fPHqCjgT4HsoGxLSQkBBSBZNczZ84oKitCdAnwCwArKvwxPLgaHsj1cF9X//Onz+/fv49HGzBETExMouOiA4L9gVxZabnmhuatW7YO8noYGPpYSunouKi3b98AoxSP5rKyMhVVZYhv+fkEdmzZMch9i69aArafUjNTKysr29vbsepxcna6fv16QUkBPD33T+gfbUsP0rb0SOssMQAEGAB0zfzj5yHE/QAAAABJRU5ErkJggg==" /></a>
</p>
</section>
<section data-markdown data-move-to="backup">
<script type="text/template">
## Motivation
- Goal: shared key-value store (state machine)
- Host it on a single machine attached to network
- Pros: easy, consistent
- Cons: prone to failure
- With Raft, keep consistency yet deal with failures
</script>
</section>
<section data-markdown>
<script type="text/template">
## What Is Consensus
- Agreement on shared state (single system image)
- Recovers from server failures autonomously
- Minority of servers fail: no problem
- Majority fail: lose availability, retain consistency
<center><img src="consensus-servers.svg" /></center>
- Key to building consistent storage systems
</script>
</section>
<section data-markdown>
<script type="text/template">
## Replicated State Machines
Typical architecture for consensus systems
<img src="rsm.svg" />
- <em>Replicated log</em> ⇒ replicated state machine
- All servers execute same commands in same order
- Consensus module ensures proper log replication
- System makes progress as long as any majority of servers up
- Failure model: fail-stop (not Byzantine), delayed/lost msgs
</script>
</section>
<section>
<h2>How Is Consensus Used?</h2>
<p class="fragment" style="margin: 0">
Top-level system configuration
<br />
<img style="height: 200px" src="activeactive.svg" />
<img style="height: 200px" src="activepassive.svg" />
</p>
<p class="fragment" style="margin: 0">
Replicate entire database state
<br />
<img style="height: 200px" src="bigdata.svg" />
</p>
</script>
</section>
<section>
<h2>Paxos Protocol</h2>
<ul>
<li>Leslie Lamport, 1989</li>
<li>Nearly synonymous with consensus</li>
</ul>
<blockquote class="fragment">
“The dirty little secret of the NSDI community is that at
most five people really, truly understand every part of
Paxos ;-).” <br /><small>—NSDI reviewer</small>
</blockquote>
<blockquote class="fragment">
<b>“</b>There are significant gaps between the description of
the Paxos algorithm and the needs of a real-world
system...the final system will be based on an unproven
protocol.<b>”</b> <br /><small>—Chubby authors</small>
</blockquote>
</script>
</section>
<section data-move-to="backup" data-markdown>
<script type="text/template">
## Raft
- Algorithm for implementing a replicated log
- System makes progress as long as any majority of servers up
- Failure model: fail-stop (not Byzantine), delayed/lost msgs
- Designed for <em>understandability</em>
</script>
</section>
<section>
<h2>Raft's Design for Understandability</h2>
<p class="left">
<strong>
We wanted an algorithm optimized for building real systems
</strong>
<ul class="left">
<li>Must be correct, complete, and perform well
<li>Must also be <em>understandable</em>
</ul>
</p>
<p class="left">
<strong>
“What would be easier to understand or explain?”
</strong>
<ul class="left">
<li>Fundamentally different decomposition than Paxos</li>
<li>Less complexity in state space</li>
<li>Less mechanism</li>
</ul>
</p>
</section>
<section>
<h2>Raft User Study</h2>
<img style="width: 40%;" src="studyscatter.svg">
<img style="width: 40%;" class="fragment" src="survey.svg">
</section>
<section data-markdown>
<script type="text/template">
## Raft Overview
1. Leader election
- Select one of the servers to act as cluster leader
- Detect crashes, choose new leader
2. Log replication (normal operation)
- Leader takes commands from clients, appends to its log
- Leader replicates its log to other servers (overwriting
inconsistencies)
3. Safety
- Only a server with an up-to-date log can become leader
</script>
</section>
<section data-markdown>
<script type="text/template">
## [RaftScope Visualization](raftscope-replay/index.html)
<p style="font-size: .4em">
or [https://raft.github.io/raftscope-replay/](https://raft.github.io/raftscope-replay/)
</p>
</script>
</section>
<section data-markdown>
<script type="text/template">
## Core Raft Review
1. Leader election
- Heartbeats and timeouts to detect crashes
- Randomized timeouts to avoid split votes
- Majority voting to guarantee at most one leader per term
2. Log replication (normal operation)
- Leader takes commands from clients, appends to its log
- Leader replicates its log to other servers (overwriting
inconsistencies)
- Built-in consistency check simplifies how logs may differ
3. Safety
- Only elect leaders with all committed entries in their logs
- New leader defers committing entries from prior terms
</script>
</section>
<section data-markdown>
<script type="text/template">
## Randomized Timeouts
- How much randomization is needed to avoid split votes?
<img src="timeoutcdf.svg">
- Conservatively, use random range ~10x network latency
</script>
</section>
<section>
<h2>Raft Implementations</h2>
<small>
<table id="implementations" class="table table-striped table-hover">
<thead>
<tr>
<th>Name</th>
<th>Primary Authors</th>
<th>Language</th>
<th>License</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://github.com/coreos/etcd">etcd/raft</a></td>
<td>Xiang Li and Yicheng Qin</td>
<td>Go</td>
<td>Apache 2.0</td>
</tr><tr>
<td><a href="https://github.com/rethinkdb/rethinkdb">RethinkDB/clustering</a></td>
<td></td>
<td>C++</td>
<td>AGPL</td>
</tr><tr>
<td><a href="https://github.com/pingcap/tikv">TiKV</a></td>
<td>
<a href="https://github.com/BusyJay">Jay</a>,
<a href="https://github.com/ngaut">ngaut</a>,
<a href="https://twitter.com/siddontang">siddontang</a>,
<a href="https://github.com/tiancaiamao">tiancaiamao</a>.
</td>
<td>Rust</td>
<td>Apache2</td>
</tr><tr>
<td><a href="https://github.com/hashicorp/raft">hashicorp/raft</a></td>
<td><a href="https://twitter.com/armon">Armon Dadgar</a></td>
<td>Go</td>
<td>MPL-2.0</td>
</tr><tr>
<td><a href="https://github.com/atomix/copycat">copycat</a></td>
<td><a href="https://twitter.com/definekuujo">Jordan Halterman</a></td>
<td>Java</td>
<td>Apache2</td>
</tr><tr>
<td><a href="https://github.com/logcabin/logcabin">LogCabin</a></td>
<td><a href="https://twitter.com/ongardie">Diego Ongaro</a></td>
<td>C++</td>
<td>ISC</td>
</tr><tr>
<td><a href="https://github.com/apache/incubator-kudu">Kudu</a></td>
<td>
<a href="https://twitter.com/dribeiroalves">David Alves</a>,
<a href="https://twitter.com/tlipcon">Todd Lipcon</a>,
<a href="https://twitter.com/mike_percy">Mike Percy</a></td>
<td>C++</td>
<td>Apache2</td>
</tr><tr>
<td><a href="https://github.com/andrewjstone/rafter">rafter</a></td>
<td><a href="https://twitter.com/andrew_j_stone">Andrew Stone</a></td>
<td>Erlang</td>
<td>Apache2</td>
</tr><tr>
<td><a href="https://github.com/ktoso/akka-raft">akka-raft</a></td>
<td><a href="https://twitter.com/ktosopl">Konrad Malawski</a></td>
<td>Scala</td>
<td>Apache2</td>
</tr><tr>
<td><a href="https://github.com/opendaylight/controller">OpenDaylight</a></td>
<td>Moiz Raja, Kamal Rameshan, Robert Varga, Tom Pantelis</td>
<td>Java</td>
<td>Eclipse</td>
</tr><tr>
<td><a href="https://github.com/dreyk/zraft_lib">zraft_lib</a></td>
<td>Gunin Alexander</td>
<td>Erlang</td>
<td>Apache2</td>
</tr><tr>
<td><a href="https://github.com/willemt/raft">willemt/raft</a></td>
<td><a href="https://twitter.com/willemht">Willem-Hendrik Thiart</a></td>
<td>C</td>
<td>BSD</td>
</tr><tr>
<td><a href="https://github.com/peterbourgon/raft">peterbourgon/raft</a></td>
<td><a href="https://twitter.com/peterbourgon">Peter Bourgon</a></td>
<td>Go</td>
<td>Simplified BSD</td>
</tr><tr>
<td><a href="https://github.com/Hoverbear/raft">hoverbear/raft</a></td>
<td>
<a href="https://twitter.com/andrewhobden">Andrew Hobden</a>,
Dan Burkert
</td>
<td>Rust</td>
<td>MIT</td>
</tr><tr>
<td><a href="https://github.com/zhebrak/raftos">raftos</a></td>
<td><a href="https://github.com/zhebrak/">Alexander Zhebrak</a></td>
<td>Python</td>
<td>MIT</td>
</tr><tr>
<td><a href="https://github.com/belaban/jgroups-raft">jgroups-raft</a></td>
<td>Bela Ban</td>
<td>Java</td>
<td>Apache2</td>
</tr><tr>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
</tbody>
</table>
<p>Copied from Raft website, probably stale.</p>
</small>
</section>
<section data-move-to="backup">
<h2>LogCabin</h2>
<ul>
<li>Started as research platform for Raft at Stanford</li>
<li>Developed into production system at Scale Computing</li>
<li>Network service running Raft replicated state machine</li>
<li>Data model: hierarchical key-value store, kept in memory</li>
<li>Written in C++ <small>(<a href="https://gcc.gnu.org/projects/cxx0x.html">gcc 4.4's C++0x</a>)</small></li>
</ul>
<a href="https://github.com/logcabin/logcabin/"><img style="float:right; width: 500px" src="logcabin.svg" /></a>
</section>
<section data-markdown>
<script type="text/template">
## Conclusion
- Consensus useful for both coordination and data management
- Consensus widely regarded as difficult
- Raft designed for understandability
- Easier to teach in classrooms
- Better foundation for building practical systems
- Pieces needed for a practical system:
- Cluster membership changes <small>(simpler in dissertation)</small>
- Log compaction <small>(expanded tech report/dissertation)</small>
- Client interaction <small>(expanded tech report/dissertation)</small>
- Evaluation <small>(dissertation: understandability, correctness,
leader election & replication performance)</small>
</script>
</section>
<section data-markdown>
<script type="text/template">
# Questions
<p>
<a href="https://raft.github.io">raft.github.io</a>
</p>
<p>
<a href="https://groups.google.com/forum/#!forum/raft-dev">raft-dev</a>
mailing list
</p>
<img src="raft.png" style="margin: 0; width: 300px" />
</script>
</section>
<div data-move-target="backup"></div>
</div> <!-- slides -->
</div> <!-- reveal -->
<script src="jquery/jquery.min.js"></script>
<script>
// Move anything with data-move-to="foo" after data-move-target="foo".
// Used to move slides to the end of the presentation (backup slides)
// without moving them in the source file.
// Only enabled if "move-slides" appears in the query string.
var moveSlides = function() {
$('[data-move-target]').each(function(i, target) {
target = $(target);
var name = target.attr('data-move-target');
target.after($('[data-move-to="' + name + '"]'));
});
};
if (location.search.indexOf('move-slides') != -1 ||
location.toString().indexOf('raft-talk-archive') != -1) {
moveSlides();
}
</script>
<script src="reveal.js/lib/js/head.min.js"></script>
<script src="reveal.js/js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
// Push each slide change to the browser history
history: true,
// The "normal" size of the presentation, aspect ratio will be preserved
// when the presentation is scaled to fit different resolutions. Can be
// specified using percentage units.
width: 1270,
height: 768,
// Factor of the display size that should remain empty around the content
margin: 0.05,
// slide transitions: none/fade/slide/convex/concave/zoom
transition: 'none',
controls: false,
slideNumber: true,
// Menu plugin configuration (jump to slide by title)
menu: {
numbers: true,
markers: true,
themes: false,
transitions: false,
openSlideNumber: true,
},
dependencies: [
// Interpret Markdown in <section> elements
{ src: 'reveal.js/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'reveal.js/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
// Syntax highlighting for <code> elements
{ src: 'reveal.js/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
// Speaker notes (press 's')
{ src: 'reveal.js/plugin/notes/notes.js', async: true },
// Menu plugin (jump to slide by title)
{ src: 'reveal.js-menu/menu.js' },
],
});
</script>
</body>
</html>