Disk Structure: Understanding Physical Storage
Physical Structure
Read aloud is unavailable in this browser.
The Foundation of Persistent Storage
Before we can understand how databases store, retrieve, and organize data, we must first understand the physical medium upon which all persistent data ultimately resides. Though solid-state drives (SSDs) are increasingly common, magnetic hard disk drives (HDDs) remain the dominant storage technology for large-scale database systems due to their cost-effectiveness and capacity advantages.
Why does physical structure matter for databases?
Unlike main memory (RAM), where any byte can be accessed in approximately the same time, disk access is governed by the physics of mechanical motion. The disk head must physically move to the correct location, and the platters must rotate to bring the desired data under the head. These mechanical constraints create access time asymmetries that are orders of magnitude larger than electronic memory access.
This fundamental reality shapes virtually every aspect of database design:
- Why databases read and write in fixed-size pages rather than individual bytes
- Why sequential access is vastly preferred over random access
- Why buffer pools and caching are essential for performance
- Why index structures like B+-trees are designed to minimize disk seeks
- Why query optimizers estimate costs in terms of disk I/O operations
By the end of this page, you will understand the complete physical architecture of a magnetic hard disk drive, including the mechanical components that determine performance characteristics. You will be able to explain why disk I/O is the dominant factor in database system performance and how hardware constraints inform software design decisions.
The Anatomy of a Hard Disk Drive
A hard disk drive is a marvel of precision engineering, consisting of multiple mechanical and electronic components working in concert to store and retrieve data. Understanding each component's role is essential for comprehending disk performance characteristics.
The Primary Components:
At its core, an HDD consists of:
- Platters — Circular disks coated with magnetic material where data is actually stored
- Spindle — The central axis around which platters rotate
- Read/Write Heads — Electromagnetic devices that read and write magnetic patterns
- Actuator Arm — The mechanical arm that positions the heads over the correct location
- Actuator Motor — Moves the arm assembly across the platter surface
- Controller Board — Electronics that manage disk operations and interface with the host system
| Component | Function | Performance Impact |
|---|---|---|
| Platters | Store data as magnetic patterns | Capacity; data density; rotational latency |
| Spindle Motor | Rotates platters at constant speed | Rotational latency (RPM determines speed) |
| Read/Write Heads | Convert magnetic patterns to/from electrical signals | Data transfer rate; reliability |
| Actuator Arm | Positions heads over correct track | Seek time; mechanical precision |
| Voice Coil Motor | Drives actuator arm movement | Seek time; acceleration/deceleration |
| Controller Board | Manages disk operations; interfaces with host | Command processing; caching; error correction |
Modern hard disk drives are engineering marvels. The read/write head flies approximately 3 nanometers above the platter surface—for comparison, a human hair is about 75,000 nanometers in diameter. This is equivalent to a Boeing 747 flying at 900 km/h just 1 millimeter above the ground. Any physical contact between the head and platter (a 'head crash') can cause catastrophic data loss.
The Sealed Environment
Hard disk drives operate in a hermetically sealed enclosure to protect the extremely sensitive internal components from contamination. This sealed environment is critical for reliable operation.
Why Sealing is Essential:
The gap between the read/write head and the platter surface is so small that even microscopic particles would cause catastrophic damage. A single smoke particle (approximately 250 nanometers) is nearly 100 times larger than the head-to-platter gap. A fingerprint on a platter would be like placing a mountain range in the path of the flying head.
The Breathing Mechanism:
Despite being sealed, traditional HDDs are not fully airtight. They include a breather hole with a filter that allows air pressure to equalize while blocking contaminants. This is necessary because:
- Internal air pressure changes with temperature
- The actuator arm movements create pressure variations
- Air bearings require controlled airflow
Helium-Filled Drives:
Modern high-capacity drives (8TB+) often use helium instead of air inside the enclosure. Helium offers several advantages:
- Lower density — Reduced turbulence allows heads to fly closer to platters
- Less drag — Lower power consumption and heat generation
- More platters — Thinner gaps allow more platters in the same form factor
- Better stability — Reduced vibration improves read/write accuracy
- •Human hair diameter: ~75,000 nm
- •Fingerprint: ~600 nm
- •Smoke particle: ~250 nm
- •Red blood cell diameter: ~7,000 nm
- •Modern head flying height: ~3 nm
Never open a hard disk drive enclosure outside of a certified clean room. Even momentary exposure to normal air introduces particles that will eventually cause head crashes. Data recovery services use Class 100 clean rooms where there are fewer than 100 particles of 0.5 micrometers or larger per cubic foot of air.
Platter Construction and Materials
The platters are the actual storage medium—circular disks where magnetic patterns encode binary data. Understanding platter construction explains capacity limitations and reliability characteristics.
Platter Substrate:
The base material of a platter (the substrate) has evolved over time:
- Early drives (1950s-1990s): Aluminum alloy platters
- Modern drives: Glass or ceramic substrates
Glass/Ceramic Advantages:
- Superior surface smoothness (enabling smaller flying heights)
- Better thermal stability (less expansion/contraction with temperature)
- Higher rigidity (reduced flutter at high rotation speeds)
- Resistance to damage during manufacturing
The Magnetic Layer Stack:
On top of the substrate, several layers are deposited:
- Underlayer — Promotes adhesion and proper magnetic properties
- Magnetic Recording Layer — Where data is actually stored (typically cobalt-based alloys)
- Protective Overcoat — Carbon-based layer protecting against head contact
- Lubricant Layer — Ultra-thin lubrication (typically 1 nanometer thick)
| Layer | Typical Thickness | Material | Purpose |
|---|---|---|---|
| Lubricant | ~1 nm | Perfluoropolyether | Reduce friction if head contacts |
| Protective Overcoat | ~2-3 nm | Diamond-like carbon | Protect magnetic layer |
| Magnetic Layer | ~10-20 nm | CoCrPt alloy | Store magnetic patterns |
| Underlayer | ~10-50 nm | Chromium alloys | Control grain structure |
| Substrate | ~0.6-1.0 mm | Glass/ceramic or aluminum | Structural support |
Magnetic Recording Methods:
The orientation of magnetic domains on the platter determines the stored data. Modern drives use one of several recording technologies:
- Longitudinal Recording (legacy) — Magnetic domains aligned parallel to platter surface; limited density
- Perpendicular Magnetic Recording (PMR) — Domains aligned perpendicular to surface; higher density
- Shingled Magnetic Recording (SMR) — Overlapping tracks like roof shingles; highest density but complex write behavior
- Heat-Assisted Magnetic Recording (HAMR) — Uses laser heating to enable smaller magnetic grains; emerging technology
Shingled Magnetic Recording (SMR) drives offer higher capacity but have significant implications for database workloads. Because tracks overlap, random writes require rewriting adjacent tracks, causing severe performance degradation for write-heavy workloads. SMR drives are best suited for archival or read-heavy storage. Database administrators must verify drive type before deployment.
Physical Geometry and Dimensions
Hard disk drives come in standardized physical form factors that define their external dimensions and mounting configurations. Understanding these form factors is essential for system design and capacity planning.
Standard Form Factors:
- 3.5-inch — Desktop and enterprise storage; highest capacity; lower cost per GB
- 2.5-inch — Laptops and dense server arrays; lower power consumption
- 1.8-inch — Ultra-portable devices (largely obsolete, replaced by SSDs)
Key Dimensional Specifications:
The form factor name refers to the approximate diameter of the platters. The actual physical dimensions are standardized by industry specifications.
| Specification | 3.5-inch (Desktop/Enterprise) | 2.5-inch (Laptop/Server) |
|---|---|---|
| Physical Width | 101.6 mm (4 inches) | 69.85 mm (2.75 inches) |
| Physical Depth | 146 mm (5.75 inches) | 100 mm (3.94 inches) |
| Physical Height | 26.1 mm (1 inch) | 7-15 mm (0.28-0.59 inches) |
| Platter Diameter | ~95 mm | ~65 mm |
| Maximum Platters | 10+ (high-capacity enterprise) | 2-5 |
| Typical Capacity | Up to 24+ TB | Up to 5 TB |
| Rotation Speed | 5400-15000 RPM | 5400-10000 RPM |
Multi-Platter Configurations:
Modern high-capacity drives contain multiple platters stacked on a single spindle, each with two recording surfaces (top and bottom). The number of platters directly impacts:
- Total Capacity — More surfaces = more storage space
- Heat Generation — More platters = more heat from friction and motor work
- Reliability — More heads increase failure probability
- Access Complexity — Head switching occurs between surfaces
Example Configuration:
A 20TB enterprise drive might contain:
- 9 platters with 18 recording surfaces
- Each surface storing approximately 1.1TB
- 18 read/write heads (one per surface)
- Running at 7200 RPM
When designing database storage systems, consider that 3.5-inch drives offer the best capacity-per-dollar for bulk storage, while 2.5-inch drives provide better density per rack unit in data centers. The choice affects everything from power consumption to cooling requirements to rebuild times after drive failures.
The Spindle Assembly
The spindle assembly is the rotating core of the hard disk drive, responsible for spinning the platters at precise, constant speeds. The spindle motor's characteristics directly determine rotational latency—one of the key components of disk access time.
Spindle Motor Types:
Modern drives use brushless DC motors with either:
- Ball Bearing Motors — Traditional design; affordable but generates more noise and vibration
- Fluid Dynamic Bearing (FDB) Motors — Modern design using oil film instead of metal contact; quieter, more reliable, less vibration
Rotation Speeds (RPM):
The rotation speed is measured in Revolutions Per Minute (RPM) and is a critical performance specification:
- 5400 RPM — Energy efficient; quiet; lower performance; consumer-grade
- 7200 RPM — Standard desktop and enterprise drives; balanced performance
- 10000 RPM — High-performance enterprise; reduced latency
- 15000 RPM — Maximum performance; highest cost; used in mission-critical systems
| RPM | Time per Revolution | Average Rotational Latency | Typical Use Case |
|---|---|---|---|
| 5400 RPM | 11.11 ms | 5.56 ms | Archival, consumer NAS |
| 7200 RPM | 8.33 ms | 4.17 ms | Desktop, general enterprise |
| 10000 RPM | 6.00 ms | 3.00 ms | High-performance enterprise |
| 15000 RPM | 4.00 ms | 2.00 ms | Transaction processing, OLTP |
The Physics of Rotation:
The spindle motor must maintain precise rotational speed despite varying loads and environmental conditions. Key engineering challenges include:
- Speed Stability — Variations in RPM cause read/write errors; controllers use phase-locked loops to maintain exact speed
- Startup Time — Platters must reach operating speed before data access; enterprise drives typically spin up in 10-30 seconds
- Heat Management — Motor generates heat proportional to RPM²; higher speeds require better cooling
- Vibration Control — Unbalanced rotation causes resonance; precision manufacturing and active damping are essential
Linear Velocity Variation:
An important consequence of rotational motion is that the linear velocity of the platter surface varies with radius. The outer edge moves faster than the inner edge:
- At 7200 RPM, outer track linear velocity: ~120 km/h
- At 7200 RPM, inner track linear velocity: ~60 km/h
This velocity difference affects data density and is addressed by zone bit recording (discussed in subsequent pages).
For OLTP (Online Transaction Processing) workloads with many random I/O operations, the rotational latency component significantly impacts transaction throughput. A 15000 RPM drive can process approximately 2.5x more random I/O operations per second than a 5400 RPM drive (all else being equal), simply due to reduced rotational latency.
The Read/Write Assembly
The read/write assembly consists of the actuator arm (also called the head stack assembly), the read/write heads, and the voice coil motor that positions them. This assembly is responsible for seek time—typically the largest component of disk access latency.
The Actuator Arm:
The actuator arm is a precision-engineered boom that positions the read/write heads over the correct track. Key characteristics include:
- Pivoting Design — Rotates around a pivot point (like a tone arm on a record player)
- Rigid Construction — Must maintain precise positioning under acceleration
- Multiple Arms — One arm per platter surface, all mechanically connected
- Head Stack Assembly (HSA) — The complete assembly of arms and heads moving as one unit
Voice Coil Motor (VCM):
The actuator is positioned by a voice coil motor—the same technology used in loudspeakers. A coil of wire moves through a magnetic field, and current through the coil controls position:
- Proportional Control — Current magnitude controls acceleration
- Bidirectional — Polarity controls direction
- No Gears — Direct drive eliminates mechanical wear
- Microsecond Response — Enables rapid repositioning
- •Speed — Full stroke seek (inner to outer track) in ~12-15 ms for enterprise drives
- •Precision — Positioning accuracy of ~0.1 micrometers
- •Durability — No contact, no wear during normal operation
- •Silence — No gear noise; smooth acceleration profiles
- •Power Efficiency — Power consumption proportional to acceleration needed
The Read/Write Heads:
Modern read/write heads are thin-film inductive write / magnetoresistive read heads mounted on sliders that 'fly' above the platter surface on an air bearing:
- Air Bearing Surface (ABS) — Precisely machined surface that generates aerodynamic lift
- Flying Height — Gap between head and platter (approximately 3-5 nanometers)
- Giant Magnetoresistive (GMR) Read Element — Detects magnetic field changes as resistance changes
- Inductive Write Element — Creates magnetic fields to flip domain orientation
Head Positioning Servo System:
To maintain track positioning with nanometer-level accuracy, drives use a closed-loop servo system:
- Servo Data — Pre-written positioning information on every track
- Read Head — Reads servo patterns while seeking and tracking
- Controller — Calculates position error from servo signal
- Voice Coil Current — Adjusted in real-time to minimize error
This servo loop operates at sampling rates of 40,000+ times per second, constantly adjusting head position to stay centered on the track.
If the air bearing fails and the head contacts the platter surface at high speed, the result is a 'head crash'—catastrophic damage to both the head and the magnetic media. This can be triggered by shock/vibration, power failures (before heads park), manufacturing defects, or wear over time. Enterprise drives include additional shock protection and automatic head parking to mitigate this risk.
The Controller Electronics
The controller board (printed circuit board attached to the HDD enclosure) contains all the electronics that transform raw magnetic signals into usable data and manage disk operations. This 'brain' of the drive handles sophisticated signal processing, error correction, and caching.
Key Controller Components:
- •Host Interface Controller — Manages SATA/SAS/NVMe protocol communication with the host system
- •Microcontroller/DSP — Runs firmware; manages all disk operations and decision-making
- •Read/Write Channel — Analog-to-digital conversion; signal processing; timing recovery
- •Servo Controller — Manages head positioning; implements servo loop algorithms
- •Buffer Memory (Cache) — DRAM for caching frequently accessed data and staging writes
- •ECC Engine — Hardware error correction coding; detects and corrects read errors
- •Motor Driver — Controls spindle motor and voice coil motor
- •Power Management — Regulates voltages; implements power-saving modes
The Drive Cache (Buffer Memory):
Modern drives include 32-256+ MB of DRAM cache that dramatically improves performance:
- Read Caching — Recently read sectors are cached; re-reads served from memory
- Read-Ahead — Controller speculatively reads sectors following the requested location
- Write Caching — Writes are acknowledged before reaching magnetic media (risking data loss on power failure)
- Command Queueing — Multiple pending commands allow the drive to optimize seek order
Error Correction Coding (ECC):
Raw magnetic media has non-negligible error rates. The ECC engine adds redundancy and can recover from:
- Random Bit Errors — Transient reading errors from noise
- Burst Errors — Multiple consecutive bit errors from media defects
- Sector-Level Errors — Severe errors that require stronger correction
Modern drives use sophisticated codes like LDPC (Low-Density Parity-Check) that add approximately 5-10% overhead but provide extremely strong error correction.
Write caching can cause data loss on power failure—the drive reports write complete before data reaches non-volatile storage. For database integrity, either disable write cache, use battery-backed write cache (enterprise drives), or ensure the application uses write barriers (fsync/fdatasync). This is why database servers often use enterprise drives with power-loss protection.
KEEP LEARNING
There’s more to understand.
You’re reading the introduction. Create a free account to read the complete lesson, save notes and keep track of your progress.