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 01 · Portfolio Projects · Build It Yourself · about 14 min to read

Play it as a journeyTutor comes with a plan

P9: Break your project on purpose

S2 - Build a Load Balancer
S2 - Build a Load Balancer · Open board

The board shows requests arriving at a front door and being passed to servers. In this project the same arrows carry a flood of requests, and then one server on the board stops answering.

On 31 January 2017, an engineer at GitLab was tired and working late. They meant to wipe a copy of the database on a spare server. They ran the command on the main server instead. About 300 GB of live data was gone before they stopped it. The team then reached for their backups, and every way of getting data back had a problem. Nobody had ever tried a full restore, so nobody knew. GitLab.com was down for about 18 hours.

You will not run a company database. You will have a small project in your portfolio, and a hiring engineer will ask a question that GitLab could not answer that night: “what happens when it breaks?” By the end of this lesson you will be able to load-test a small service, break it on purpose, fix what you find, and write the one page that shows a stranger you did it.

The history (optional)

The facts above come from GitLab’s own postmortem, published on 10 February 2017. The pg_dump backups used PostgreSQL 9.2 tools against a 9.6 database, and the storage bucket was empty. Disk snapshots were not on, and replication was never meant for disaster recovery. A snapshot taken about 6 hours earlier saved the day. About 5,000 projects, 5,000 comments and 700 user accounts were lost. The post names no person. It says “there was no ownership”, so nobody tested the restore.

Before you start. S2 · Build a Load Balancer gave you a service that spreads requests over servers and notices when one dies. When the neighbour is slow: timeouts, retries, breakers gave you the timeout (the longest you wait for one answer) and Little’s law (workers held equals calls per second times seconds each call is held). The Watchtower (Observability) gave you the habit of measuring a service with numbers and not with feelings. A repo a stranger can judge in two minutes showed what a stranger wants to find in your repo.

Lesson 16 of 19 in Portfolio Projects

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

  • A load test sends many requests and records every answer
  • The p99 is the time that 99 of every 100 requests beat
  • Failure injection: break one part on purpose and watch
  • Fail fast: refuse early so the line cannot grow
  • A postmortem is a page that turns one failure into a fix
  • A design doc states the numbers before you test them
  • The service
  • The load generator
  • Open loop and closed loop
  • Traps in your own numbers
  • Chaos engineering, in one paragraph
  • Restore drills

Terms it explains: load test, percentile, p99, Failure injection, failing fast, postmortem, design doc, open loop, closed loop, active vs passive, health check, reverse proxy, round-robin.

Review Portfolio Projects