Give

Raft step by step

Trace leader election, log replication and safety in the Raft algorithm.

Planned. This module is part of the plan and is not written yet.

COCO-DST-REP-0505Level16–17

Why it matters

Raft runs inside real systems such as etcd, which stores a Kubernetes cluster's state. Tracing it shows how a small cluster on the Lantern's server can keep one consistent log.

Draft outline · in review
For
Level 16–17 · 300 Level to 400–500 Level
Inside
5 lessons and a test · about 120 minutes
Topic
Replication and consensus · advanced, 4 of 4
Plate CO-DST-REP-05: planned.

Inside the module.

5 lessons in order, about 120 minutes in all, then a short test. Learners go at their own pace; the minutes are a guide, not a timetable.

Draft outline · in review

  1. Lesson 1: Followers, candidates, leaders and terms

    Raft's three roles and its terms.

    Explain20 min, from minute 0

  2. Lesson 2: Leader election

    Randomised election timeouts, RequestVote, and why a voter rejects a candidate whose log is behind its own.

    Worked example25 min, from minute 20

  3. Lesson 3: Log replication

    AppendEntries, the consistency check and the commit index.

    Worked example25 min, from minute 45

  4. Lesson 4: Safety

    Why a newly elected leader always has every committed entry.

    Explain20 min, from minute 70

  5. Lesson 5: Network splits

    Trace both sides of a partition and what happens when it heals.

    Practice30 min, from minute 90

  6. End-of-module test

    Trace leader election and log replication in Raft, and reason about what happens on each side of a network split.

    Mastered at 85% or more. Retake it until you pass; nothing is lost, and each try gives feedback.

    Already know it? A Challenge Test (planned) clears the whole module: 90% overall, no objective below 75%.

    Last stageafter about 120 min

Practicalities

Draft outline · in review
  • Built to run offline

    Planned to run on the Lantern's own computer, with no internet needed.

  • Languages

    Planned first in English; every module aims to reach all of the Lantern's languages.

Try a question.

One question from the module, as a learner would meet it. Have a go, then open the worked solution a step at a time.

Draft outline · in review

A 5-node Raft cluster (A to E) splits. A, the leader in term 3, and B are on one side. C, D and E are on the other. What happens on each side, and what happens when the split heals?

Work it out on paper first, then show the answer and mark it yourself.

Particulars

What a learner can do after it

  1. Trace leader election and log replication in Raft.
  2. Reason about what happens when the network splits.

Level

Level 16–17 · 300 Level to 400–500 Level

Show levels in

Level mappings are approximate. A qualified teacher or lecturer in each country must check them before they appear in the app. Levels 13–18 describe the content, not the learner: “Level 15” means material usually taught in a second-year university course, whoever chooses to learn it.

Difficulty for its level

4 of 4 · Advanced

Time

About 120 minutes

Alignments

  • Aligned to Typical university coursepartial · in reviewTypical third-year distributed systems course: consensus algorithms

Alignment in review until a qualified teacher or lecturer checks it. No exam body, university or vendor endorses us; learners still sit the real exam. University-level modules give knowledge, not university credit.

Challenge Test

Planned: a Challenge Test to prove you know it and skip it. Pass at 90% overall, with no objective below 75%.

University courses it previews

Computer Science, Software Engineering

The route here.

Everything this module builds on, drawn as a route from its foundations. Solid lanes must be mastered first, or cleared by a Challenge Test; dashed lanes are suggestions that never lock anything.

From Level 1, Instructions in order to Level 12, Commits and history
  1. CO-BLK-SEQ-01 Instructions in order, Level 1–4, Coding. Planned.
  2. CO-BLK-SEQ-01Instructions in orderCoding · Primary 1 to Primary 4 (Level 1–4) · Planned
  3. CO-BLK-LOP-01 Repeat blocks, Level 3–5, Coding. Sample lesson in the demo.
  4. CO-BLK-LOP-01Repeat blocksCoding · Primary 3 to Primary 5 (Level 3–5) · Sample lesson in the demo Needs Instructions in order (required).Try the sample lesson: Repeat blocks
  5. DS-CMP-TYP-01 The home row, Level 3–6, Digital skills. Planned.
  6. DS-CMP-TYP-01The home rowDigital skills · Primary 3 to Primary 6 (Level 3–6) · Planned · recommended
  7. CO-BLK-CND-01 If this, then that, Level 3–6, Coding. Planned.
  8. CO-BLK-CND-01If this, then thatCoding · Primary 3 to Primary 6 (Level 3–6) · Planned · recommended
  9. CO-BLK-LOP-02 Patterns with loops, Level 4–6, Coding. Planned.
  10. CO-BLK-LOP-02Patterns with loopsCoding · Primary 4 to Primary 6 (Level 4–6) · Planned Needs Repeat blocks (required).
  11. DS-FIL-ORG-01 Folders that make sense, Level 4–7, Digital skills. Planned.
  12. DS-FIL-ORG-01Folders that make senseDigital skills · Primary 4 to JSS 1 (Level 4–7) · Planned · recommended
  13. MA-ARI-ORD-01 Order of operations, Level 5–6, Maths. Planned.
  14. MA-ARI-ORD-01Order of operationsMaths · Primary 5 to Primary 6 (Level 5–6) · Planned · recommended
  15. CO-BLK-LOP-03 Loops inside loops, Level 5–7, Coding. Planned.
  16. CO-BLK-LOP-03Loops inside loopsCoding · Primary 5 to JSS 1 (Level 5–7) · Planned · recommended
  17. CO-PRG-PYB-01 Your first Python program, Level 7–9, Coding. Planned.
  18. CO-PRG-PYB-01Your first Python programCoding · JSS 1 to JSS 3 (BECE) (Level 7–9) · Planned Needs Patterns with loops (required), The home row (recommended).
  19. CO-PRG-PYB-02 Variables, Level 7–9, Coding. Sample lesson in the demo.
  20. CO-PRG-PYB-02VariablesCoding · JSS 1 to JSS 3 (BECE) (Level 7–9) · Sample lesson in the demo Needs Your first Python program (required).Try the sample lesson: Variables
  21. CO-PRG-PYB-03 Numbers and calculations, Level 7–9, Coding. Planned.
  22. CO-PRG-PYB-03Numbers and calculationsCoding · JSS 1 to JSS 3 (BECE) (Level 7–9) · Planned Needs Variables (required), Order of operations (recommended).
  23. MA-ALG-FRM-01 Substituting into formulae, Level 7–8, Maths. Planned.
  24. MA-ALG-FRM-01Substituting into formulaeMaths · JSS 1 to JSS 2 (Level 7–8) · Planned · recommended
  25. CO-NET-HOW-01 Packets, addresses and routes, Level 7–10, Coding. Planned.
  26. CO-NET-HOW-01Packets, addresses and routesCoding · JSS 1 to SSS 1 (Level 7–10) · Planned
  27. CO-PRG-PYB-05 Decisions with if, Level 8–10, Coding. Planned.
  28. CO-PRG-PYB-05Decisions with ifCoding · JSS 2 to SSS 1 (Level 8–10) · Planned Needs Numbers and calculations (required), If this, then that (recommended).
  29. CO-PRG-PYB-06 Loops in Python, Level 8–10, Coding. Planned.
  30. CO-PRG-PYB-06Loops in PythonCoding · JSS 2 to SSS 1 (Level 8–10) · Planned Needs Decisions with if (required), Loops inside loops (recommended).
  31. CO-PRG-PYF-01 Defining functions, Level 8–11, Coding. Planned.
  32. CO-PRG-PYF-01Defining functionsCoding · JSS 2 to SSS 2 (Level 8–11) · Planned Needs Loops in Python (required).
  33. CO-PRG-PYB-07 Lists, Level 8–10, Coding. Planned.
  34. CO-PRG-PYB-07ListsCoding · JSS 2 to SSS 1 (Level 8–10) · Planned Needs Loops in Python (required).
  35. CO-SYS-OPS-01 What an operating system does, Level 8–11, Coding. Planned.
  36. CO-SYS-OPS-01What an operating system doesCoding · JSS 2 to SSS 2 (Level 8–11) · Planned · recommended
  37. CO-PRG-PYF-02 Parameters and return values, Level 9–11, Coding. Planned.
  38. CO-PRG-PYF-02Parameters and return valuesCoding · JSS 3 (BECE) to SSS 2 (Level 9–11) · Planned Needs Defining functions (required), Substituting into formulae (recommended).
  39. CO-ALG-SRT-01 Linear search, Level 9–11, Coding. Planned.
  40. CO-ALG-SRT-01Linear searchCoding · JSS 3 (BECE) to SSS 2 (Level 9–11) · Planned Needs Parameters and return values (required), Lists (required).
  41. CO-PRG-PYF-03 Scope, Level 9–11, Coding. Planned.
  42. CO-PRG-PYF-03ScopeCoding · JSS 3 (BECE) to SSS 2 (Level 9–11) · Planned Needs Parameters and return values (required).
  43. CO-PRG-PYF-04 Breaking problems into functions, Level 9–12, Coding. Planned.
  44. CO-PRG-PYF-04Breaking problems into functionsCoding · JSS 3 (BECE) to SSS 3 (WASSCE) (Level 9–12) · Planned Needs Parameters and return values (required), Lists (required).
  45. CO-ALG-SRT-03 Simple sorts, Level 10–12, Coding. Planned.
  46. CO-ALG-SRT-03Simple sortsCoding · SSS 1 to SSS 3 (WASSCE) (Level 10–12) · Planned Needs Linear search (required).
  47. CO-ALG-SRT-02 Binary search, Level 10–12, Coding. Planned.
  48. CO-ALG-SRT-02Binary searchCoding · SSS 1 to SSS 3 (WASSCE) (Level 10–12) · Planned Needs Linear search (required).
  49. CO-PRG-PYF-05 Recursion, Level 11–13, Coding. Planned.
  50. CO-PRG-PYF-05RecursionCoding · SSS 2 to A level / JUPEB / foundation year (Level 11–13) · Planned Needs Scope (required).
  51. CO-ALG-SRT-04 Merge sort, Level 11–13, Coding. Planned.
  52. CO-ALG-SRT-04Merge sortCoding · SSS 2 to A level / JUPEB / foundation year (Level 11–13) · Planned Needs Simple sorts (required), Recursion (required).
  53. CO-SWD-GIT-01 Why version control?, Level 12–13, Coding. Planned.
  54. CO-SWD-GIT-01Why version control?Coding · SSS 3 (WASSCE) to A level / JUPEB / foundation year (Level 12–13) · Planned Needs Parameters and return values (required), Folders that make sense (recommended).
  55. CO-SWD-GIT-02 Commits and history, Level 12–13, Coding. Planned.
  56. CO-SWD-GIT-02Commits and historyCoding · SSS 3 (WASSCE) to A level / JUPEB / foundation year (Level 12–13) · Planned Needs Why version control? (required).
  57. CO-ALG-SRT-05Comparing algorithmsCoding · SSS 3 (WASSCE) to A level / JUPEB / foundation year (Level 12–13) · Planned Needs Binary search (required), Merge sort (required).
  58. From here on: Beyond school · university level
    CO-SWD-GIT-03Branches and mergingCoding · A level / JUPEB / foundation year to 100 Level (Level 13–14) · Planned Needs Commits and history (required).
  59. CO-SWD-GIT-04Working together with remotesCoding · A level / JUPEB / foundation year to 100 Level (Level 13–14) · Planned Needs Branches and merging (required).
  60. CO-DST-CCR-01Doing many things at onceCoding · 100 Level to 200 Level (Level 14–15) · Planned Needs Breaking problems into functions (required), Comparing algorithms (required), What an operating system does (recommended).
  61. CO-DST-FND-01What makes a system distributedCoding · 200 Level (Level 15) · Planned Needs Doing many things at once (required), Packets, addresses and routes (required), Working together with remotes (required).
  62. CO-DST-REP-01Why replicate?Coding · 200 Level to 300 Level (Level 15–16) · Planned Needs What makes a system distributed (required).
  63. CO-DST-REP-02Leaders and followersCoding · 200 Level to 300 Level (Level 15–16) · Planned Needs Why replicate? (required).
  64. CO-DST-REP-03Time, clocks and orderingCoding · 200 Level to 300 Level (Level 15–16) · Planned Needs Why replicate? (required).
  65. CO-DST-REP-04Consensus: agreeing despite failuresCoding · 300 Level (Level 16) · Planned Needs Leaders and followers (required), Time, clocks and ordering (required).
  66. CO-DST-REP-05Raft step by stepCoding · 300 Level to 400–500 Level (Level 16–17) · Planned · the destination Needs Consensus: agreeing despite failures (required).
38 stops across Coding, Digital skills and Maths. 2 have a sample lesson in the demo; the other 36 are planned and not yet written.

Help light the room where this is learned.

Every route on this map starts in a classroom with 24 stations, a tutor that works offline and a facilitator upstairs. Four are planned and waiting for light.