Examples

Protocols and systems written in Synod. Each page holds the real source: run it in the browser, change it, and break it.

ExampleTopicWhat to watch
tcpTCP three-way handshakeSYN, SYN-ACK, ACK and the state changes on both ends
gossipGossip membership and failure detectionHeartbeats spreading; a crashed node marked down after 4s; generations after restart
paxosSingle-decree Paxos (the Synod protocol)Two racing proposers; the higher ballot adopts any accepted value; the invariant "at most one chosen value"
raftRaft leader electionRandomized timeouts, votes, a leader crash, a new term; "never two leaders in a term"
twopcTwo-phase commitThe blocking problem when the coordinator crashes between phases; the atomicity invariant
ringConsistent hashing with virtual nodesWhich keys move when a fifth node joins
cassandraA Cassandra-style cluster: gossip + ring + replication factor 3 + QUORUM + hinted handoffA write succeeding with a replica down, and the hint replayed after restart
webappCache-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
walWrite-ahead log and checkpoint recoveryWhich writes survive a crash between checkpoints

The programs are the acceptance tests of the language; they live in synodlang/examples.