All system design challenges
#41 Data Transfer/Bandwidth

Large Scale Cloud Migration

Move a company's applications and hundreds of terabytes of data from its own data centre to the cloud, with almost no downtime.

Asked at Google OCI

What is being asked

Plan and design a large migration. The interviewer is looking for an ordered approach: how the data gets there, how the two sides stay in step, how you cut over and how you go back if it fails.

Requirements

Functional

  • Move databases, file stores and applications.
  • Keep serving users throughout; cut over in a short window.

Non-functional

  • No data loss; a tested rollback.
  • Limited network bandwidth between the sites.
  • Done in stages, not one risky night.

Design

On-premises databases+ filesDedicated link / VPNPhysical transferapplianceChange data capturestreamBulk load into cloudstorageCloud databases +object storageCloud applicationsTraffic switch: DNS /load balancer
Boxes are services; rounded shapes are data stores and queues.
  1. Estimate first. 500 TB over a 1 Gbit/s link takes about 46 days at full speed. For such volumes, ship disks in a transfer appliance and use the network only for changes.
  2. Bulk copy a consistent snapshot to the cloud.
  3. Replicate changes made since the snapshot with change data capture until the cloud copy lags by seconds.
  4. Run both. Deploy applications in the cloud, send them test and then a small share of real traffic, and compare results.
  5. Cut over. Stop writes briefly, let replication drain, verify checksums, switch traffic, and reverse the replication direction so the old site stays current for rollback.

Key decisions and trade-offs

  • Bandwidth arithmetic decides the method. Do it aloud in the interview.
  • Big bang or incremental. Moving service by service is slower overall but each step is small and reversible; it requires the two sides to talk to each other for a while.
  • Rehost, replatform or rewrite. Moving as-is is fastest; adopting managed services gives more benefit later but more risk now.
  • Verification. Row counts and checksums per table, and a period of dual reads, before trusting the copy.

Follow-up questions

  • What do you do if the cut-over window is five minutes?
  • How do you migrate a database that cannot be replicated logically?
  • How do you keep costs down during months of running both sites?
  • What is your rollback plan one week after cut-over?
Log in to tick off the challenges you have worked through. Log in