0
0
DBMS Theoryknowledge~6 mins

Disk structure and access time in DBMS Theory - Full Explanation

Choose your learning style9 modes available
Introduction
Imagine you want to quickly find a book in a huge library. The way the books are arranged and how fast you can reach them matters a lot. Similarly, computers store data on disks, and the structure of these disks affects how fast data can be accessed.
Explanation
Disk Components
A disk consists of several circular tracks arranged like rings on a target. Each track is divided into smaller parts called sectors, which hold the actual data. Multiple tracks stacked vertically form a cylinder, and disks have multiple platters to increase storage.
Data is stored in sectors on tracks, and multiple platters increase storage capacity.
Disk Access Mechanism
To read or write data, the disk's read/write head moves to the correct track (seek), waits for the right sector to spin under it (rotational latency), and then transfers the data. These steps together determine how fast data can be accessed.
Access time depends on seek time, rotational latency, and data transfer time.
Seek Time
Seek time is the duration the read/write head takes to move from its current track to the target track. It varies depending on how far the head must move, and it is usually the largest part of the access delay.
Seek time is the delay caused by moving the read/write head to the correct track.
Rotational Latency
After the head reaches the correct track, it waits for the disk to spin so that the desired sector aligns under the head. This waiting time is called rotational latency and depends on the disk's rotation speed.
Rotational latency is the waiting time for the disk to spin to the correct sector.
Data Transfer Time
Once the head is positioned over the correct sector, data is transferred between the disk and memory. This time depends on the amount of data and the speed of the disk's interface.
Data transfer time is the duration to move data once the head is correctly positioned.
Real World Analogy

Imagine a librarian finding a book in a large circular shelf. First, they walk to the right shelf (seek time), then wait for the shelf to rotate so the book faces them (rotational latency), and finally pick the book (data transfer).

Disk Components → The circular shelves divided into sections where books are stored
Disk Access Mechanism → The librarian's process of walking, waiting, and picking the book
Seek Time → The time the librarian takes to walk to the correct shelf
Rotational Latency → The time waiting for the shelf to rotate to the right section
Data Transfer Time → The time taken to pick the book from the shelf
Diagram
Diagram
┌─────────────────────────────┐
│          Disk Platters       │
│ ┌───────────────┐           │
│ │   Tracks      │           │
│ │  ┌─────────┐  │           │
│ │  │ Sectors │  │           │
│ │  └─────────┘  │           │
│ └───────────────┘           │
│                             │
│  Read/Write Head → Seek → Wait → Transfer  │
└─────────────────────────────┘
This diagram shows disk platters with tracks and sectors, and the sequence of read/write head movement, waiting for rotation, and data transfer.
Key Facts
TrackA circular path on the surface of a disk where data is recorded.
SectorA subdivision of a track that stores a fixed amount of data.
Seek TimeThe time taken for the disk's read/write head to move to the desired track.
Rotational LatencyThe delay waiting for the disk to rotate the correct sector under the read/write head.
Data Transfer TimeThe time required to transfer data once the read/write head is positioned.
Common Confusions
Believing data is accessed instantly once the disk is powered on.
Believing data is accessed instantly once the disk is powered on. Data access involves mechanical movements and waiting times, so it is never instantaneous.
Thinking seek time and rotational latency are the same.
Thinking seek time and rotational latency are the same. Seek time is moving the head to the track, while rotational latency is waiting for the sector to spin under the head.
Summary
Disk data is stored on circular tracks divided into sectors across multiple platters.
Accessing data involves moving the read/write head (seek time), waiting for the disk to spin (rotational latency), and transferring data.
Seek time and rotational latency are the main factors that affect how quickly data can be read or written.