One Server
Four and a half million videos, a 37-gigabyte database, eight search indexes, twenty nightly jobs, and a matcher that reads every title, on one rented machine. This is how it runs, deploys, recovers, tests itself, and knows when it is lying, with no platform team.
- machine
- 1machine
- boxes on it
- 4boxes on it
- of data
- 37 GBof data
- nightly jobs
- 20nightly jobs
- test workers
- 8test workers
Part 01
Four boxes on one machine
The fashionable way to run this is a fleet of services with a team to keep them alive. That solves problems this system does not have: traffic is modest, data is large but slow-moving, the hard work is nightly. So the complexity budget goes into the data, where the value is, not the infrastructure.
Part 02
Lanes, not services
Twenty nightly jobs are scheduled in the same list, each with a unique key, so two boxes holding the schedule cannot run the same job twice. Measurement jobs give up rather than retry when the database is busy, because a statistic is never worth a slow page.
Part 03
A night's work, in short steps that can be dropped and picked up
The bookmark is a row id, not a page number, so a walk that changes the rows it is reading never skips any. A crash at three in the morning loses one step of five hundred rows, and the next run resumes from the bookmark. By eight the index is truer than at midnight, and the heartbeat says by how much.
Part 04
Work on real data without touching production
Tests name what a person gets, not what a function returns. The suite is measured before it is changed, and the goal is tests per second, not test count. Ninety-one world champions and eleven real search queries live in the mistake book alongside every case a reviewer pinned at the desk in Volume 5.
Part 05
Know when it is lying
Crashes go to an error tracker with an allow-list so a known noisy error cannot drown a new one. And because every nightly step can be dropped and picked up, the fix for most three-in-the-morning problems is to let the next step run.
Take-aways, without the tango
- 01Spend the complexity budget on the data, not the infrastructure. One machine and a boring stack are a feature.
- 02Concurrency is boxes and lanes. Add a box before you add a service. Keep the job list in the database you already have.
- 03Every long job is a chain of short steps passing a bookmark. Killable any second, resumable, and scoped to what anyone will see.
- 04Measure against real data mirrored read-only, never against a sample of your own output. Turn every mistake into a test.
- 05Watch the data, not just the process, and keep the daily answer to “did it get truer?”