An overview of storage systems in modern computers, discussing primary, secondary, and tertiary storage, their characteristics, and their roles in database management systems. Learn about volatile and non-volatile storage, cache, main memory, magnetic disks, optical disks, and tape.
Download Storage in Modern Computers: Understanding Primary, Secondary, and Tertiary Storage and more Slides Introduction to Database Management Systems in PDF only on Docsity!
Database Management Systems Design
Storage in Modern Computers
• Storage can be classified into two categories
Volatile
Non-Volatile
• Volatile is fast, expensive, limited in size and lost if
Computer is turned off
CPU Cache
Main Memory
• Non-volatile is cheaper, slower, with higher capacity
and persistent
Flash drives
Magnetic Disks
Optical Disks
Tape
Processing of Data by DBMS
CACHE
MAIN MEMORY
MAGNETIC DISK
TAPE OPTICAL DISK
CPU
Request for
Data
Response
Memory Hierarchy
CACHE
MAIN MEMORY
MAGNETIC DISK
TAPE
OPTICAL DISK
Price &
Speed
increases
Reliability
increases
Performance in DBMS
The performance of a DBMS depends on:
CPU usage
I/O usage
Network usage
We shall concentrate on I/O
Disk I/O performance can be defined in terms:
Resource usage time : time using the disk
Response time : wall-clock time to complete the query
Number of I/Os : number of times an I/O operation is performed
Parallel I/O – bringing data from various disk simultaneously
Response time <> Resource usage time
In this case usually Response time << Resource usage time
Single Disk Organization
Disk
Controller Bus
Controller
System Bus
CPU Memory
Few Notes on Disks
• Too expensive and inefficient to bring a few bytes from
disk
• You often bring one ore more disk blocks
• 1 block is the minimal amount of I/O done on disk
For a read or write operation (rw operation)
1 I/O = 1 block , for read and write
• 1 block consist of one or more disk sectors
Implementation of file system layer in DBMS defines this
• Few magic numbers for block sizes
512 bytes
1KB
4KB
Cost of performing I/O
• To access a single block the cost if defined as
– Cost = seek time + rotational delay + transfer time
• Seek Time
– Time for the arm to get into the right track (or
cylinder)
– Mechanical movement cost
• Rotational Delay
– Time before the target block gets underneath the
reading head
½ of time for 1 disk rotation
– Mechanical movement cost
Random I/O vs Sequential I/O
• Let B1, B2, …,Bn be a sequence of n blocks to
be read/written from disk
• Random I/O
– Blocks are read/written from difference regions on
the disk
– In worst case, one seek and delay per block.
Cost = n * (seek + delay + transfer time)
• Sequential I/O
– Blocks are read/written one after the other from
the same cylinder or adjacent cylinder (just a few
seeks and delays)
Example
• A disk has seek time of 8 ms, rotational delay
of 4ms, 12 MB/sec transfer rate, 4 double-
sized platter, 512 byte sector, block of 2
sectors, 50 sectors per track, and 2000 tracks
per surface:
– How much capacity this disk has?
– How much space does a cylinder has?
Notes on Disks
• Yet another nomenclature
– On-line storage: secondary storage
– Off-line storage: tertiary storage
• Many disk put memory buffer on the disk
– Allows this buffers to control the rate at which
data are exchanged with main memory
– Idea is to minimize amount of time waiting for
disk
– But, this has implication in terms of transactions
and recovery
Disks as performance bottlenecks
• Microprocessor speed increase 50% per year.
• Disk performance improvements
– Access time decreases 10% per year
– Transfer rate decreases 20% per year
• Disk crash results in data loss.
• Solution: Disk array
– Have several disk behave as a single, large and
very fast disk.
Parallel I/O Docsity.com
Disk Striping
• Disk Striping is a mechanism to divide the data
in a file into segments that are scattered over
the disks of the disk array.
• The minimum size of a segment is 1 bit, in
which case each data blocks must be read
from several disks to extract the appropriate
bits.
– The drawback of this approach is the overhead of