~learn.
0:00 / 1:17
Side quest 29 · GitHub

Five copies, one lock: why GitHub now votes one branch at a time

transcript

Every push to GitHub is a vote between five machines. And each push locked the entire repository.

Your push locks a majority of the five replicas. Each one applies it and reports a checksum. Three of five agree? Pushed. No majority? Refused. There's no primary to fail over.

Then 2026. Most repositories keep two of five replicas in Azure. An Azure replica is about 25 milliseconds away. And Azure serves about half of Git traffic.

But here's the catch. The vote waits for every healthy replica, up to a timeout. So the slowest replica sets the pace. For the whole repository.

Now add coding agents. Each pushes to its own branch. One lock per repository? They queue behind each other. But Git's rules apply to each reference individually. So lock per branch. Only the same branch takes turns.

GitHub is rolling it out. In internal testing, three to four times the throughput. Its new architecture: up to 35 times, in internal benchmarks.

Git only promises order per branch. So only lock the branch.

Full breakdown in the lecture.