Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 07 · System Design · The stall, built · with code: Go · about 16 min to read

Play it as a journeyTutor comes with a plan

The stall, built: one counter in code (load balancing, health checks and caching in Go)

Design the Whole Thing
Design the Whole Thing · Open board

The whiteboard where every box had to be paid for by a number. This lesson takes three of those boxes, the gate, the slate and the rail, and writes them as one small program you can run on a laptop.

Before you start. You need the chai stall from The chai stall that got famous (load balancing): one famous stall became three, and a man at the gate sends each customer to one of them, which is a load balancer. You need the slate from The slate next to the stove (caching), a small board by the stove that remembers answers so the wala does not walk to the back room every time, which is a cache. You need the rail from The order slip rail (queues & the utilization cliff), a wire of paper slips that lets the counter take an order now and cook it later, which is a queue. Design the Whole Thing (the interview, assembled) put all three on one whiteboard. This lesson turns that whiteboard into code. If you have never read Go, start with Reading Go in twenty minutes first.

Lesson 41 of 115 in System Design

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • February 2013: a lyrics site finds its gate was guessing
  • The stall as a program
  • The load balancer that guesses, and the one that counts
  • A stall shuts mid-rush: the health check
  • The cache by the stove: a hit in nanoseconds, a miss in 20 ms
  • The queue that says “kitchen full”
  • What the stall still cannot do

Terms it explains: load balancer, health check, cache, queue, backpressure, least connections.

Review System Design