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
November 29, 20260
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
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- 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 ProblemsSample 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:
- Copy: take a consistent snapshot of S on a replica of A at binlog position P and load it on B.
- Catch-up: B replicates from A starting at P until lag is near zero.
- Cutover:...