You need to move a service from one data centre to the cloud with a database that can't have long downtime. Outline the Linux side.
AdvancedScenarioMigrations, performance and fleet operations
Answer
Situation read → Replicate the data continuously and switch over at the end.
What I'd do →
- Build cloud hosts from code; set up VPN or Direct Connect.
- Set up DB replication from the DC primary to a cloud replica (native streaming replication or AWS DMS).
- Sync static files with repeated rsync or
lsyncd. - Lower DNS TTL; run read traffic tests against the cloud.
- Cutover: stop writes, wait for replica lag to reach 0, promote the cloud replica, switch DNS, start apps.
- Keep reverse replication or the old primary as a rollback path.
Why → Downtime becomes the time to promote and switch DNS, not the time to copy data.
Interview tip → Mention verifying replica lag and checksums before promoting.
More on Migrations, performance and fleet operations
You must migrate 2 TB of application data from an old server to a new one with less than 5 minutes of downtime. How?IntermediateThe new server has different UIDs for the same users than the old one. What breaks during migration and how do you handle it?IntermediateA server is "slow" according to users. What is your first 60 seconds of investigation?BeginnerYour team must capacity-plan for a server whose disk grows 4% per week. How do you predict when it fills?IntermediateYou need to replace a physical server with a VM without changing its IP or hostname. Plan the cutover.IntermediateMemory usage on a server shows 95% used but the app is fine. A manager is worried. How do you explain and verify?Beginner