Examples
Protocols and systems written in Synod. Each page holds the real source: run it in the browser, change it, and break it.
| Example | Topic | What to watch |
|---|---|---|
tcp | TCP three-way handshake | SYN, SYN-ACK, ACK and the state changes on both ends |
gossip | Gossip membership and failure detection | Heartbeats spreading; a crashed node marked down after 4s; generations after restart |
paxos | Single-decree Paxos (the Synod protocol) | Two racing proposers; the higher ballot adopts any accepted value; the invariant "at most one chosen value" |
raft | Raft leader election | Randomized timeouts, votes, a leader crash, a new term; "never two leaders in a term" |
twopc | Two-phase commit | The blocking problem when the coordinator crashes between phases; the atomicity invariant |
ring | Consistent hashing with virtual nodes | Which keys move when a fifth node joins |
cassandra | A Cassandra-style cluster: gossip + ring + replication factor 3 + QUORUM + hinted handoff | A write succeeding with a replica down, and the hint replayed after restart |
webapp | Cache-aside behind a load balancer (api, lb, app, cache, db) | Hit rate warming up; what happens when the cache crashes and there is no timeout |
wal | Write-ahead log and checkpoint recovery | Which writes survive a crash between checkpoints |
The programs are the acceptance tests of the language; they live in synodlang/examples.