The stall, built: copies and shards (replication and sharding in Go)

The famous stall, now a row of stalls behind one gate. Every stall in that picture still writes into one book. This lesson copies the book, then cuts it into three, in code.
Before you start. The stall, built: one counter in code (load balancing, health checks and caching in Go) built the stall as a Go program: a gate that sends each customer to the least busy of three stalls, a slate that remembers prices, and a rail of order slips, all with one book behind them. The copy clerks (database replication) gave that book copy clerks: the leader’s book takes every write, and each clerk copies it a moment later, so readers can use the copies, and a copy is always slightly behind. Splitting the ledger (sharding) cut the book itself: different customers in different books, with one field, the shard key, deciding which book a customer lives in. This lesson builds both and measures them.
