Index

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

The Chai Stall That Got Famous
The Chai Stall That Got Famous · Open board

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.

Continue reading with a plan

The first three lessons of every track are free. This lesson is included with a plan, which unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in

Lab

Sixteen customers, one wala. If the wala stops standing at each kettle, how much sooner is everyone served?

Switch to Juggle the kettles, drag Customers at once and Burners to 64, then watch Walas busy.

Open One wala, many kettles →

Review System Design →

Saved in this browser, and to your account when you sign in.