All paths

Distributed systems with three boards

Three ESP32-C3 boards on ESP-NOW: clocks, loss, retries, elections, consensus and partitions, ending in a counter that survives all of them.

ESP32-C3-DevKitM-1Free7 lessons6 h4 chapters2,890 XPCoding · Expert+400 XP

0 of 7 done

What you will build

2 projects, built step by step

7 lessons in 4 chapters, about 6 hours on a simulated ESP32-C3-DevKitM-1. Free, in your browser, every step checked by the simulator.

Chapter 1 project

Messages and loss

Heartbeats with sequence numbers: count what arrives, lose a quarter on purpose, spot the gaps, and learn why a silent node may be dead or just unlucky.

Open it in the simulator
Chapter 2 project

Consensus light

Three lamps agree on one value with ballots and votes. A value commits only with a quorum, so no lamp ever shows what was not agreed, and a majority keeps going when one board dies.

Open it in the simulator
The map

Chapter by chapter

Each lesson opens when the one before it is done, and each chapter ends in a project.

Chapter 1

Time and messages

Order events without a shared clock, and count what the network loses.

  1. Open300 XP

    Clocks and order

    Three boards, three clocks that disagree. Wall-clock stamps put a reply before its question; Lamport clocks put causes first, and a tie-break makes the order total.

    0 of 5 steps

  2. ProjectLocked660 XP

    Messages and loss

    Heartbeats with sequence numbers: count what arrives, lose a quarter on purpose, spot the gaps, and learn why a silent node may be dead or just unlucky.

    0 of 5 steps

5 questions, graded as you go.
Chapter 2

Doing it once, and agreeing

Make retries safe, pick a leader, and agree on a value with a majority.

  1. Locked280 XP

    Retries and idempotence

    Two clients add to a counter on node A with acks, timeouts and backoff. Lost acks make retries count twice, until the server remembers what it has already applied.

    0 of 4 steps

  2. Locked350 XP

    Leader election

    The bully algorithm on three boards: heartbeats, timeouts, elections and terms, with the leader's lamp lit, and a stale leader that a term number teaches A to ignore.

    0 of 6 steps

  3. ProjectLocked600 XP

    Consensus light

    Three lamps agree on one value with ballots and votes. A value commits only with a quorum, so no lamp ever shows what was not agreed, and a majority keeps going when one board dies.

    0 of 5 steps

5 questions, graded as you go.
Chapter 3

When the network splits

Keep working through a partition and merge without losing a thing.

  1. Locked300 XP

    Partitions

    A visitor count gossiped between three boards. Split the network, count on both sides, heal it, and watch a naive merge forget people until a slot-by-slot merge (a CRDT) keeps them all.

    0 of 5 steps

4 questions, graded as you go.
Chapter 4

Boss: a fault-tolerant counter

One counter that rides out loss, crashes and partitions, and a write-up that proves it.

  1. Locked400 XP

    Boss: a fault-tolerant counter

    The visitor counter, finished: a G-Counter gossiped between three boards that rides out loss, crashes and partitions, with an agreement lamp on each node and a read that knows when it might be stale.

    0 of 7 steps

4 questions, graded as you go.
Syllabus

Every lesson in the course

All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.

Chapter 1

Time and messages

  1. Clocks and orderThree boards, three clocks that disagree. Wall-clock stamps put a reply before its question; Lamport clocks put causes first, and a tie-break makes the order total.
  2. Messages and lossHeartbeats with sequence numbers: count what arrives, lose a quarter on purpose, spot the gaps, and learn why a silent node may be dead or just unlucky.
Chapter 2

Doing it once, and agreeing

  1. Retries and idempotenceTwo clients add to a counter on node A with acks, timeouts and backoff. Lost acks make retries count twice, until the server remembers what it has already applied.
  2. Leader electionThe bully algorithm on three boards: heartbeats, timeouts, elections and terms, with the leader's lamp lit, and a stale leader that a term number teaches A to ignore.
  3. Consensus lightThree lamps agree on one value with ballots and votes. A value commits only with a quorum, so no lamp ever shows what was not agreed, and a majority keeps going when one board dies.
Chapter 3

When the network splits

  1. PartitionsA visitor count gossiped between three boards. Split the network, count on both sides, heal it, and watch a naive merge forget people until a slot-by-slot merge (a CRDT) keeps them all.
Chapter 4

Boss: a fault-tolerant counter

  1. Boss: a fault-tolerant counterThe visitor counter, finished: a G-Counter gossiped between three boards that rides out loss, crashes and partitions, with an agreement lamp on each node and a read that knows when it might be stale.
Kits

Build it on your bench too

Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.

Have a kit already?

Find your kit

Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.

See every kit
Questions

About Distributed systems with three boards

Is Distributed systems with three boards free?

Yes. All 7 lessons of Distributed systems with three boards are free and run in your browser, with nothing to install and no parts to buy before you start.

Do I need a real ESP32-C3-DevKitM-1?

No. Every lesson runs on a simulated ESP32-C3-DevKitM-1 with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.

How long does Distributed systems with three boards take?

About 6 hours: 7 lessons in 4 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.

What will I build?

Each chapter ends in a project that puts it together: Messages and loss and Consensus light.

Where do I start?

With "Clocks and order", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.