20 - Storage Systems & Disk Management
603 words
3 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# 20 - Storage Systems & Disk Management ## ๐ฏ Learning Objectives After reading this topic, you will be able to: - Describe the storage hierarchy (cache โ RAM โ disk โ tape) - Calculate disk access time (seek + rotational + transfer) - Compute MTTF for disk systems - Understand the role of buffer management ## ๐ C...

20 - Storage Systems & Disk Management
๐ฏ Learning Objectives
After reading this topic, you will be able to:
- Describe the storage hierarchy (cache โ RAM โ disk โ tape)
- Calculate disk access time (seek + rotational + transfer)
- Compute MTTF for disk systems
- Understand the role of buffer management
๐ Core Content
20.1 Storage Hierarchy
(Diagram)
| Level | Speed | Size | Volatile? |
|---|---|---|---|
| Cache | 1 ns | KB | Yes |
| RAM | 10-100 ns | GB | Yes |
| SSD | 0.1 ms | GB-TB | No |
| HDD | 5-10 ms | TB | No |
| Tape | Seconds | TB-PB | No |
20.2 Magnetic Disk Structure
A hard disk consists of:
- Platters: Circular disks coated with magnetic material
- Tracks: Concentric circles on each platter
- Sectors: Divisions of tracks (typically 512 bytes)
- Cylinders: Same track across all platters
- Read/write head: Moves across the platter to access data
20.3 Disk Access Time
Taccessโ=Tseekโ+Trotationโ+Ttransferโ| Component | Description | Formula |
|---|---|---|
| Seek time ( Tseekโ ) | Time to move arm to correct track | Tseekโ=avgย seekย time |
| Rotational latency ( Trotationโ ) | Time for platter to rotate to correct sector | Trotationโ=21โรRPM60โ |
| Transfer time ( Ttransferโ ) | Time to read/write data | Ttransferโ=transferย ratedataย sizeโ |
Transfer rate = rotationย timesectorsย perย trackรsectorย sizeโ
Worked Example
Problem: Seek time = 3ms, rotational speed = 30000 RPM, 200 sectors/track, sector size = 512 bytes. File size = 1000KB.
- Transfer rate = 200ร512รท(60/30000)=102400รท0.002=51.2ย MB/s
- Rotational latency = 21โร3000060โ=1ย ms
- Access time per sector = 3 + 1 = 4 ms If file is contiguous: Transfer time = 1000KB / 50 KB/ms = 20ms. Total = ~20ms. If file is scattered: Need 2000 sectors (1000KB / 512 bytes). Total = 2000 ร 4ms + 20ms = 8.02 seconds!
20.4 MTTF (Mean Time To Failure)
- MTTF for a single disk: Average time until the disk fails
- MTTF for a system of n disks: nMTTFdiskโโ (assuming independent failures)
Worked Example
30 disks tested for 24 hours. 15 failed after 18 hours, 8 failed after 22 hours, 7 survived entire 24 hours.
Total operating hours = 15ร18+8ร22+7ร24=270+176+168=614 hours Number of failures = 23 MTTF for one disk = 614/23=26.7 hours MTTF for 15 disks = 26.7/15=1.78 hours
๐ Key Formulas
| Formula | Description |
|---|---|
| Taccessโ=Tseekโ+Trotationโ+Ttransferโ | Total disk access time |
| Trotationโ=2รRPM60โ | Average rotational latency |
| MTTFsystemโ=nMTTFdiskโโ | System MTTF for n disks |
โ ๏ธ Common Pitfall
The Mistake: Calculating rotational latency as full rotation time instead of half.
Why: Average rotational latency is half the rotation time (2รRPM60โ), not the full rotation (RPM60โ).
๐ Practice Questions
Q1. A disk has 30000 RPM, seek time 5ms, 400 sectors/track, sector size 512B. Find the transfer rate.
AnswerData per track = 400 ร 512 = 204800 bytes Rotation time = 60/30000 = 0.002s = 2ms Transfer rate = 204800 / 0.002 = 102.4 MB/s
Q2. What is the storage hierarchy? Why is it important for DBMS?
AnswerCache โ RAM โ SSD โ HDD โ Tape. Each level is larger, slower, and cheaper. DBMS uses this hierarchy strategically: frequently used data stays in memory (cache/RAM), bulk data on disk, archives on tape.
๐ Cross-References
- Next Topic: 21 - RAID Systems
- Related: BSCS4022 (OS) โ Storage management
- Textbook: Chapter 10 (Storage and File Structure) Join Discord Previous19 - Application DesignNext21 - RAID Systems