AdvancedAbout 15 min

    Raft Log Replication

    Read the full article on Substack

    8 min read.

    Follow a client write through the leader to a majority and commit, repair a follower that fell behind, and see an old leader’s uncommitted entries overwritten.

    Think of it this way: The leader is a minute-taker whose notebook is the truth. An entry counts as decided once most members have copied it down. A member who missed meetings gets caught up page by page, and anyone holding pages the notebook never had tears them out and copies the notebook.

    Current term 1AppendEntries: 0
    S1leadercommit 1
    x=1term 1
    S2followercommit 1
    x=1term 1
    S3followercommit 1
    x=1term 1

    Three servers keep the same log. S1 is the leader in term 1. Entry 1 is on all three and committed.

    1/5

    Check your understanding

    Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.

    Commit a Raft entry

    Sequence

    Order the steps from the client write to followers learning it is committed.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    1. 1Drop a step here
    2. 2Drop a step here
    3. 3Drop a step here
    4. 4Drop a step here
    5. 5Drop a step here
    5 pieces left to place

    Quiz

    8 questions
    Question 1 of 8
    Score: 0

    When is a Raft entry committed?

    Done with this lesson?

    Sign in free to keep your progress, streak and quiz scores.

    Keep going