Data Backup and Recovery
Design a backup plan that follows the 3-2-1 principle, choose between full and incremental backups, and test that a restore actually works.
The folder that vanished on a Friday evening
At 6:40 on a Friday evening, Sameer Joshi tidies the shared drive before the weekend and deletes a folder he thinks is an old duplicate. It is not. It holds every supplier invoice for March, and the auditors arrive on Monday. Sameer phones Neha Kulkarni in a panic, and she asks him one calm question: "Did it exist before last night's backup?" A backup is a separate copy of your data, kept so that you can get the data back when the original is lost, damaged or locked. Whether Sameer's weekend is ruined depends entirely on how good that copy is.
Three ordinary ways to lose data
People imagine data loss as a dramatic attack, but most of it is ordinary. Someone deletes or overwrites the wrong file, as Sameer did. A storage disk, the part of a computer that holds files when it is switched off, wears out and stops working one day without warning. Ransomware, malicious software that scrambles files and demands money to unscramble them, locks everything it can reach. And sometimes the loss is physical: a laptop is stolen from a counter, or a short circuit starts a fire in the office cupboard where the shared drive's computer sits.
A backup has to survive all four. A copy that sits next to the original survives the first two at best.
A backup matters because it is the only control that works after every one of these has already happened. Passwords, updates and training try to stop harm; a backup is what lets you undo it. It also changes how an organisation can respond to ransomware, because a company that can restore its own files does not have to bargain with criminals. One trap catches many people here: a folder that syncs, meaning it automatically copies every change to another device, is not a backup. If you delete a file or ransomware scrambles it, the sync faithfully copies the deletion or the scrambled version too.
Full and incremental backups
Think of a family photo album. One way to protect it is to photocopy the entire album every Sunday. That is simple, and any single copy is complete, but you copy hundreds of old photos again and again. The other way is to photocopy the whole album once, and after that copy only the photos added each week. That takes far less paper, but to rebuild the album you need the big first copy plus every weekly bundle since, in order.
Backups work the same way. A full backup copies all the data every time. An incremental backup copies only what has changed since the previous backup of any kind. Tulsi Health's nightly backup covers the shared drive and the app database, about 200 GB in total, a GB (gigabyte) being a unit of storage size roughly equal to 250 phone photos. On a normal day only about 4 GB is new or changed. A common plan is a full backup on Sunday night and an incremental backup every other night.
Restoring Thursday's data needs Sunday's full backup plus Monday, Tuesday, Wednesday and Thursday, applied in order. If one link in that chain is missing, the restore stops there.
The saving in storage is large. The short calculation below compares 30 days of backups made both ways. You can press Run without knowing any Python, and you can change the number of days on the line marked with a comment and run it again.
Expected output:
Full backup every night: 6000 GB
One full, then incrementals: 316 GB
Space saved: 5684 GB
| Line | What it does |
|---|---|
full_size_gb = 200 |
Stores the size of one complete copy, 200 GB |
changed_per_day_gb = 4 |
Stores how much changes on a typical day |
every_night_full = days * full_size_gb |
Thirty complete copies, one per night |
one_full_then_incremental = ... |
One complete copy on the first night, then only the day's changes on each of the other 29 nights |
print(...) |
Shows each total and the difference |
Incrementals use about one twentieth of the space, which is why almost every real backup plan uses them. The price is a longer chain to restore, so the safety question becomes how often to start a fresh full backup.
The model below makes that trade visible. Choose how many days pass between full backups and watch the total storage and the worst-case restore time change. The mission asks you to keep both within limits that Neha has set.
The 3-2-1 principle
Families in India often keep important papers, such as a flat's sale deed, the same way. There is one photocopy in the cupboard at home, another at a relative's house in a different city, and the original or a certified copy in a bank locker. A fire at home, a flood in one city or a misplaced file cannot take all of them at once. The backup world has a rule for exactly this habit, called the 3-2-1 principle: keep at least 3 copies of your data, on 2 different kinds of storage, with 1 copy kept off-site, meaning in a different building or place.
Tulsi Health's version of 3-2-1. The unplugged disk in the locker is the copy that survives a fire at the office and an attacker who controls the network.
For ransomware, one extra detail matters. Attackers who get inside a network look for backups and delete or scramble every copy they can reach. So at least one copy should be offline, meaning disconnected from the network, like a disk in a locker, or immutable, meaning stored so that nobody, not even an administrator, can change or delete it for a fixed period. Some people now call this 3-2-1-1 for that reason.
Try building Tulsi Health's backup plan yourself. Turn on the copies you want within the yearly budget, then press Run to see which disasters each plan survives.
A backup you have never restored is only a hope
Schools hold fire drills so that on the day of a real fire, everyone already knows the stairs, the meeting point and who counts heads. A backup needs the same practice. Copies fail silently far more often than people expect: the backup job stopped months ago after a password change, the disk has errors, an important folder was never included, or nobody remembers how the restore software works. The only way to know a backup works is a restore test, where you actually bring data back from the copy and check it.
Restoring to a separate place means a failed test never overwrites the live data. The timing tells Neha how long a real recovery would keep stores waiting.
Data recovery is the wider job of getting a business working again after the loss, of which restoring files is one step. Two questions shape it. The first is how much recent work you can afford to lose: with a nightly backup, a failure at 5 pm loses that day's changes. The second is how long you can afford to be without the data, which the restore test measures. For Tulsi Health the order of work also matters. Neha first stops the damage, for example by disconnecting an infected laptop, then picks the newest copy that is known to be clean, restores the app database before anything else because every store bills through it, and checks the restored data with the people who use it.
Sameer's folder came back that Friday night, restored from Thursday's incremental on top of Sunday's full backup. The auditors never knew. The reason was not luck; Neha had run the same restore as a drill three weeks earlier and already knew it took eleven minutes.