Case study
Distributed systems in Go
Distributed systems are where every assumption about a single machine stops holding: nodes join and leave, messages arrive late or not at all, and no one process sees the whole picture. This is a set of systems built in Go to work under those conditions — a peer-to-peer storage ring, a parallel job scheduler that survives its workers dying, and a server and proxy running in the cloud.
A ring that keeps its data
The centrepiece is an implementation of Chord, a distributed hash table: every node owns a slice of a key space arranged as a ring, and any node can find the owner of any key in a logarithmic number of hops by way of a finger table.
The difficult part is not the lookup. It is keeping the ring correct while it changes. Nodes run periodic stabilisation to repair successor pointers and finger tables as peers join or fail, keep a list of successors rather than a single one so that losing a neighbour does not break the ring, and replicate their stored files to those successors on a timer, so that data outlives the node that held it.
A second variant secures the ring. Communication between nodes runs over TLS with certificates on both sides, so a node only accepts traffic from peers that can prove they belong — the difference between a system that works in a lab and one that could be exposed to a network. Each node is packaged as a container, so a ring can be stood up and torn down repeatably.
Work that survives its workers
The MapReduce system splits a job across worker processes coordinated over RPC. Workers ask for tasks, run map or reduce functions over their share of the data, and report back. The coordinator does not trust a worker to finish: any task that has not completed within a deadline is handed to someone else, so a crashed or stalled worker delays a job rather than breaking it.
Concurrency at the edge
The first piece is a concurrent HTTP server and a forwarding proxy, written against the standard library. The server handles each client concurrently but bounds how many it serves at once, so load degrades service instead of exhausting the machine. Both were containerised and deployed to AWS EC2, with their images published so they could be run anywhere.
Why it matters
Replication, failure detection, deadlines, mutual authentication and bounded concurrency are not academic curiosities. They are the same mechanisms that decide whether a production platform stays up when a machine disappears — and building them from first principles is what makes them recognisable later, inside systems someone else wrote.