Basis Lab

A System Design in Forty Minutes

Justifying Every Box in the Drawing With the Number That Forced It

Last timeWhat You Promise When It Breaks

How to draw a final design in which every component can be defended by the estimate that forced it, which boxes to leave out, and what to change first when one estimate moves.

A final drawing is a transcription, not a design. By the time it is drawn, every

decision in it has already been made by arithmetic, and the drawing's only job

is to hold those decisions where both of you can see them. That is also what

makes it defensible. Asked why a component is there, you are not being asked

for an opinion about that component. You are being asked for a number, and

either you have it or the box was decoration.

The numbers the drawing answers to

The brief is a link shortener with click analytics, and the estimates were

settled before anything was drawn. There are 100,000,000 new links a day, and

since a day is 86,400 seconds that is 100,000,000/86,400=1,157100{,}000{,}000 / 86{,}400 = 1{,}157 a

second, rounded up to 1,200 writes a second. A link is followed about 100 times

over its life, so redirects run at 1,200×100=120,0001{,}200 \times 100 = 120{,}000 a second at

the mean. Peak is three times the mean, giving 3×1,200=3,6003 \times 1{,}200 = 3{,}600

writes and 3×120,000=360,0003 \times 120{,}000 = 360{,}000 reads a second. A link row is 500

bytes, so storage grows by 100,000,000×500=50100{,}000{,}000 \times 500 = 50 GB a day and

50×365=18,25050 \times 365 = 18{,}250 GB a year, which is 18 TB. Every redirect also

records a click event of 100 bytes, so clicks arrive at the same 360,000 a

second at the peak and occupy 10,000,000,000×100=110{,}000{,}000{,}000 \times 100 = 1 TB a day,

or 365 TB a year. The read to write ratio is 100 to 1.

Against that, one machine does 10,000 reads a second from memory, 5,000 writes

a second to a store that goes to disk, and holds 1 TB of usable disk. Those

three numbers and the six above are the whole of what the drawing has to

answer to.

FIG 1The drawing, with the load on each arrow
Eight boxes, each of which has a division behind it. Read it as a list of claims rather than as a picture, and ask of every arrow which of the six estimates above put it there.

Every box is one division

The whole defence is one piece of arithmetic applied repeatedly, and it has

three parts: a demand DD, a capacity CC and the machine count mm that falls

out of dividing one by the other.

The lesson stops here

7 more paragraphs to go

You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.

The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.

See the planThe contents

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

The rest of this course

  1. 01What a One Line Design Request Actually Asks For
  2. 02Estimating the Load Before You Draw Anythingopening only
  3. 03The One Machine Version, and the Number at Which It Breaksopening only
  4. 04Where 360,000 Reads a Second Actually Goopening only
  5. 05Splitting the Writes, and the Number That Decides How Many Piecesopening only
  6. 06What a Reader Sees While Something Is Brokenopening only
  7. 07Justifying Every Box in the Drawing With the Number That Forced Ityou are here
  8. 08Where Each of the Forty Minutes Goes, and the Two Mistakes That Cost Tenopening only

Read alongside