Two servers must keep a directory in sync both ways for a simple active-active setup. What do you recommend?
AdvancedScenarioMigrations, performance and fleet operations
Answer
Situation read → Bidirectional file sync is hard; conflicts are the main risk.
What I'd do →
- Prefer removing the need: shared storage (NFS, EFS), object storage, or one writer.
- If files are rarely edited on both sides:
unisonwith a conflict policy, orlsyncdone-way per direction for separate subdirs. - For real active-active: a clustered filesystem (GlusterFS, CephFS) or DRBD with a cluster FS (complex).
Why → Two rsync crons in opposite directions will eventually delete or overwrite new files.
Interview tip → Saying "I'd avoid bidirectional sync" and explaining why is the senior answer.
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