Загрузка...

(System Design 28/100) Handle EC2 file deletion

System Design 28/100
Interviewer 👨‍💻

"You accidentally deleted an important file from an EC2 server. How would you recover it?"

Before panicking, remember:

❌ Don't make more changes to the server.

✅ First, identify what backup options are available.

━━━━━━━━━━━━━━━━━━━━

1️⃣ Check for EBS Snapshots

If the file was stored on an EBS volume:

✅ Find the latest snapshot

✅ Create a new EBS volume from the snapshot

✅ Attach it to a temporary EC2 instance

✅ Copy the required file

This is often the fastest recovery method.

━━━━━━━━━━━━━━━━━━━━

2️⃣ Check Application or Database Backups

If snapshots aren't available:

📌 Look for application backups

📌 Check database backups

📌 Verify backup retention policies

Sometimes the file exists in a backup even if it's gone from the server.

━━━━━━━━━━━━━━━━━━━━

3️⃣ Verify S3 Backups

Many production workloads store backups in Amazon S3.

Check:

✅ S3 backup location

✅ S3 Versioning

✅ Lifecycle policies

If versioning is enabled, recovering deleted files becomes much easier.

━━━━━━━━━━━━━━━━━━━━

4️⃣ Restore & Validate

After recovering the file:

✅ Restore it to the correct location

✅ Verify permissions

✅ Test application functionality

✅ Confirm the issue is resolved

Recovery isn't complete until validation is done.

━━━━━━━━━━━━━━━━━━━━

5️⃣ Prevent Future Incidents

Implement:

🔒 Automated EBS Snapshots

🔒 AWS Backup Policies

🔒 S3 Versioning

🔒 Disaster Recovery Procedures

Good engineers don't just recover data—they prevent the same incident from happening again.

━━━━━━━━━━━━━━━━━━━━

🎯 Interview Answer

"I would first check whether an EBS snapshot exists. If available, I'd restore the snapshot, create a volume, attach it to a temporary EC2 instance, and recover the file. If snapshots aren't available, I'd check application backups, database backups, or S3 versioning.

Видео (System Design 28/100) Handle EC2 file deletion канала ITWarriorShubham
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять