SYSTEM DESIGN SKETCHBOOK / PRACTICE SHEET / NO. 51
Design a petabyte-scale migration to the cloud
A company is leaving its own data center. Its file store and its main transactional database must move to a public cloud while the business keeps running, and the leadership team wants proof that nothing was lost or corrupted, plus a way to go back if the new environment misbehaves.
Requirements
- Copy all files and the database to the cloud while the source stays in production.
- Keep the copy up to date with ongoing changes until cutover.
- Verify that every file and every database row arrived intact before cutover.
- Cut over with minimal write downtime, and keep a rollback path for two weeks afterwards.
Constraints and assumptions
- File store: 4 PB in about 2 billion files; about 2 TB of files are created or modified per day; roughly 80% of bytes have not changed in six months.
- Database: 20 TB relational database taking 5,000 writes per second at peak.
- Network: a dedicated 10 Gbps link, of which about 7 Gbps is usable for migration.
- The whole migration must finish within 90 days.
- Database write downtime at cutover must be under 15 minutes.
Out of scope for the first sketch
Rewriting applications for cloud-native services · Access control and identity mapping between environments · Cost optimization after the move
Draw your design
Rough math and notes
SYSTEM DESIGN SKETCHBOOK / FOLLOW-UPS
Design a petabyte-scale migration to the cloud
Finish your first sketch before answering these. Cross out freely.
- Estimate how long the network alone would take. When does shipping physical disks win?
- Files keep changing while you copy them. How do you know when the target has caught up?
- How do you prove every one of 2 billion files arrived intact, and what do you do about mismatches?
- Walk through the database cutover minute by minute. Where can it go wrong?
- Two days after cutover, a bug in the new environment corrupts data. How do you roll back without losing the writes made since cutover?
Compare afterwards: worked approaches and reading at sketchbook /questions/cloud-data-migration/review