Design Live Shard Migration for a MySQL Fleet Without Downtime

Last updated: November 29, 2026

Quick Overview

Design how to move a busy MySQL shard holding Facebook user data from one host or region to another, or split it into two, while it keeps serving reads and writes.

Meta
System Design
Software Engineer
Meta
November 29, 2026
Software Engineer
Onsite
System Design
Hard

0

0

0 solved


Design how to move a busy MySQL shard holding Facebook user data from one host or region to another, or split it into two, while it keeps serving reads and writes.

Meta operates one of the largest MySQL fleets, and rebalancing it is constant work. Interviewers check whether a candidate can sequence copy, catch-up, and cutover with a very short write pause and a safe rollback.

What the Interviewer Expects
  • Explain logical shards mapped to physical hosts
  • Sequence snapshot copy, binlog catch-up, and cutover
  • Keep the write freeze to seconds
  • Update routing atomically
  • Plan verification and rollback
Key Topics to Cover
Logical sharding
Replication catch-up
Cutover
Routing metadata
Rollback
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How is a split different from a move?
  • How do you avoid split-brain at cutover?
  • What if catch-up never converges because write rate is too high?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Goal: move logical shard S from host A to host B (or split it), with no data loss and a write unavailability of a few seconds at most.

Context: many small logical shards per physical host; a ...

High-Level Design

Phases:

  1. Copy: take a consistent snapshot of S on a replica of A at binlog position P and load it on B.
  2. Catch-up: B replicates from A starting at P until lag is near zero.
  3. Cutover:...

Submit Your Answer
Markdown supported