Design a Horizontally Sharded SQL Database (Vitess)

Problem

Design PlanetScale's core: a horizontally sharded MySQL platform (Vitess) with online schema changes.

Requirements

Functional:

  • Shard tables across many MySQL instances
  • Route queries; scatter-gather cross-shard
  • Online, non-blocking schema changes
  • Replicas for reads + failover

Non-functional:

  • Petabyte scale, high QPS
  • Zero-downtime schema migrations
  • Strong durability

Discussion points

  1. Sharding (vindexes), routing, scatter-gather
  2. Resharding without downtime
  3. Online schema change (branch/deploy-request workflow)
  4. Replication, failover, consistency
  5. Connection pooling and query planning
added …
LeaderboardSalaryAccount