Developer Systems & Sharded MySQLPRODUCTION RETROSPECTIVE

GitHub: Spokes 3-Way Git Replication & Freno MySQL Throttling

The infrastructure behind 100M+ developers: Spokes three-way Git repository replication, Vitess horizontal database sharding, and Freno cooperative MySQL replica throttling.

High-Level Architectural Overview

GitHub stores petabytes of Git repositories and relational metadata. Spokes maintains three real-time replicas of every Git repository across physically isolated hosts with quorum-based consistency, while Freno continuously monitors replication lag to throttle background schema changes.

Key Engineering Problems & Trade-Offs

Spokes: 3-Way Fault-Tolerant Git Replication

Hundreds of millions of Git pushes and billions of daily API requests
The Scaling Problem

Guaranteeing zero data loss and read availability for millions of Git push and pull operations across server failures.

Engineering Solution

Custom Spokes architecture replicates Git bare repositories across 3 servers. Two servers must agree via voting before a Git update reference is committed.

Architectural Trade-Offs

Synchronous voting latency on push vs mathematical durability guarantee.

How to Say This in an Interview

Explain why Git replication is harder than block storage replication: Git references (refs) must update atomically with packfiles.

Curriculum Topics Used in GitHub Architecture (8)
Full Syllabus
Phase 1#7

HTTP Methods, Status Codes, & Headers

Master the RESTful grammar of the web: Idempotency semantics, safe vs unsafe methods, status classes (2xx, 3xx, 4xx, 5xx), and caching/security headers.

7 min readRead Blueprint →
Phase 3#26

Load Balancers: What, Why, & Single Point of Failure

Learn the foundational role of load balancers: Eliminating single points of failure, horizontal traffic distribution, health checking, and active-passive failover.

9 min readRead Blueprint →
Phase 5#67

Zero-Downtime Schema Migrations at Scale (gh-ost / pt-online-schema-change)

Alter massive tables without locking: The Expand/Contract pattern, shadow tables, binlog streaming, and preventing metadata locks.

9 min readRead Blueprint →
Phase 7#98

Cache-Aside (Lazy Loading)

Master the most popular caching pattern: Application-orchestrated read-through, lazy population, TTL expiration, and cache invalidation.

8 min readRead Blueprint →
Phase 8#121

Webhooks vs Polling vs Message Queues

Select inter-system communication mechanisms: Push webhooks across SaaS boundaries, HTTP short/long polling, internal VPC message queues, HMAC-SHA256 signatures, and ingestion buffering.

8 min readRead Blueprint →
Phase 9#130

GraphQL Fundamentals & Query Language

Solve over-fetching and under-fetching: Schema Definition Language (SDL), Queries, Mutations, Subscriptions, and client-specified data fetching.

9 min readRead Blueprint →
Phase 11#160

JWT Deep Dive: Structure, Signing, & Critical Pitfalls

Master JSON Web Tokens: Base64URL anatomy, symmetric HS256 vs asymmetric RS256/ES256, JWKS key rotation, the "alg: none" vulnerability, RSA-to-HMAC key confusion attacks, and JWS vs JWE differences.

10 min readRead Blueprint →
Phase 11#168

Design-Level Defenses: SQL Injection, XSS, & CSRF

Architect invulnerable web systems: Parameterized prepared statements against SQL Injection, Content Security Policy (CSP) & HttpOnly cookies against XSS, and SameSite cookie attributes with Synchronizer Tokens against CSRF.

10 min readRead Blueprint →
Primary Technical Sources & Published Papers
Freno: Cooperative Throttle Service for MySQL

GitHub Engineering Blog • 2017

Ready to Practice GitHub-Style Systems?

Start with foundational networking, compute, and storage, and build up to complex distributed consensus.

Start Free: Topic #1