20 - Storage Systems & Disk Management

603 words
3 min read
Python Week 1: the first filter for runtime behavior
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)
LevelSpeedSizeVolatile?
Cache1 nsKBYes
RAM10-100 nsGBYes
SSD0.1 msGB-TBNo
HDD5-10 msTBNo
TapeSecondsTB-PBNo

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+TtransferT_{access} = T_{seek} + T_{rotation} + T_{transfer}
ComponentDescriptionFormula
Seek time ( TseekT_{seek} )Time to move arm to correct trackTseek=avgย seekย timeT_{seek} = \text{avg seek time}
Rotational latency ( TrotationT_{rotation} )Time for platter to rotate to correct sectorTrotation=12ร—60RPMT_{rotation} = \frac{1}{2} \times \frac{60}{RPM}
Transfer time ( TtransferT_{transfer} )Time to read/write dataTtransfer=dataย sizetransferย rateT_{transfer} = \frac{\text{data size}}{\text{transfer rate}}
Transfer rate = sectorsย perย trackร—sectorย sizerotationย time\frac{\text{sectors per track} \times \text{sector size}}{\text{rotation time}}

Worked Example

Problem: Seek time = 3ms, rotational speed = 30000 RPM, 200 sectors/track, sector size = 512 bytes. File size = 1000KB.
  1. Transfer rate = 200ร—512รท(60/30000)=102400รท0.002=51.2ย MB/s200 \times 512 \div (60/30000) = 102400 \div 0.002 = 51.2 \text{ MB/s}
  2. Rotational latency = 12ร—6030000=1ย ms\frac{1}{2} \times \frac{60}{30000} = 1 \text{ ms}
  3. 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: MTTFdiskn\frac{MTTF_{disk}}{n} (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=61415 \times 18 + 8 \times 22 + 7 \times 24 = 270 + 176 + 168 = 614 hours Number of failures = 23 MTTF for one disk = 614/23=26.7614 / 23 = 26.7 hours MTTF for 15 disks = 26.7/15=1.7826.7 / 15 = 1.78 hours

๐Ÿ“ Key Formulas

FormulaDescription
Taccess=Tseek+Trotation+TtransferT_{access} = T_{seek} + T_{rotation} + T_{transfer}Total disk access time
Trotation=602ร—RPMT_{rotation} = \frac{60}{2 \times RPM}Average rotational latency
MTTFsystem=MTTFdisknMTTF_{system} = \frac{MTTF_{disk}}{n}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 (602ร—RPM\frac{60}{2 \times RPM}), not the full rotation (60RPM\frac{60}{RPM}).

๐Ÿ“ Practice Questions

Q1. A disk has 30000 RPM, seek time 5ms, 400 sectors/track, sector size 512B. Find the transfer rate.

Answer
Data 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?

Answer
Cache โ†’ 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

Document outline

Keep your place and jump directly to a heading.

Table of contents

No note selected

Open a chapter to see its outline, backlinks, and sources here.