Data compression and multi-copy backup
Computer ScienceFiles, Storage & DatabasesAges 17–18
Use it with your class: students open it from a link or a QR code, with no account needed.
A file is compressed three ways: kept as is, compressed losslessly (ZIP, PNG, FLAC), and compressed with loss (JPEG, MP3, H.264); the compression ratio uses real figures for each data type, so file size and quality loss update instantly as you choose. The backup panel creates one to four copies on SSD, hard disk or the cloud; click Corrupt a drive to kill one copy, then click Restore to watch a progress bar run for a time equal to size divided by read speed, along with the probability of total data loss, computed as the failure rate raised to the number of copies.
Lesson: Data compression, backup and data recovery
What it shows
Compression shrinks files by removing redundancy. Lossless methods (ZIP, PNG, FLAC) rebuild the exact original bytes, so they suit text and data; lossy methods (JPEG, MP3, H.264) also discard detail people barely notice, making photos, audio and video far smaller but never fully recoverable. The backup model treats each copy as failing independently with a yearly failure rate p, so the chance of losing every copy is p raised to the number of copies. Restore time equals data size divided by the medium's read speed, which is why a cloud copy is safe but slow.
How to use
Choose a Data type and switch the Compression method between its three options, comparing the size after compression and the detail lost. Try lossy compression on text to see the warning. Then set the Number of backup copies and the Backup medium, press Back up, press Corrupt a drive one or more times and finish with Restore. Have students record the loss probability and restore time for one to four copies on SSD, HDD and Cloud.
Parameters you can change
- Data type Text, spreadsheet, Photo, Audio, Video
- Compression method No compression, Lossless compression, Lossy compression
- Original size 10–100000 MB
- Number of backup copies 1–4 copies
- Backup medium External SSD – 500 MB/s, Hard disk drive – 120 MB/s, Cloud over a 50 Mbps connection
Questions to explore
- Why should text never be compressed with a lossy method?
- On a hard disk drive, how many times less likely is total data loss with two copies than with one?
- About how long does restoring 4000 MB take from a hard disk drive, and from the cloud?