0% found this document useful (0 votes)
11 views38 pages

CH 12

Chapter 12 discusses physical storage systems, categorizing storage media into volatile and non-volatile types, and outlining factors influencing media choice such as speed, cost, and reliability. It details the storage hierarchy, including primary, secondary, and tertiary storage, as well as the mechanisms and performance metrics of magnetic disks and solid-state disks (SSDs). The chapter also covers redundancy techniques for reliability and performance improvements through parallelism and RAID configurations.

Uploaded by

Aqeel Abbas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views38 pages

CH 12

Chapter 12 discusses physical storage systems, categorizing storage media into volatile and non-volatile types, and outlining factors influencing media choice such as speed, cost, and reliability. It details the storage hierarchy, including primary, secondary, and tertiary storage, as well as the mechanisms and performance metrics of magnetic disks and solid-state disks (SSDs). The chapter also covers redundancy techniques for reliability and performance improvements through parallelism and RAID configurations.

Uploaded by

Aqeel Abbas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 38

Chapter 12: Physical Storage Systems

Database System Concepts, 7th Ed.


©Silberschatz, Korth and Sudarshan
See www.db-book.com for conditions on re-use
Classification of Physical Storage Media

 Can differentiate storage into:


 Volatile storage: loses contents when power is switched off
 Non-volatile storage:
 Contents persist even when power is switched off.
 Includes secondary and tertiary storage, as well as battery-
backed up main-memory.
 Can lose it contents – why?
 Factors affecting choice of storage media include
 Speed with which data can be accessed
 Cost per unit of data
 Reliability

Database System Concepts - 7th Edition 12.2 ©Silberschatz, Korth and Sudarshan
Storage Hierarchy

Database System Concepts - 7th Edition 12.3 ©Silberschatz, Korth and Sudarshan
Storage Terminology

 Primary storage: Fastest media but volatile (cache, main memory).


 Secondary storage: next level in hierarchy, non-volatile, moderately fast
access time
• Disks
• Also called on-line storage
 Tertiary storage: lowest level in hierarchy, non-volatile, slow access
time. Used primarily for archival storage
• Magnetic tape
 Sequential access, 1 to 12 TB capacity
 A few drives with many tapes
 Juke boxes with petabytes (1000’s of TB) of storage

• Also called off-line storage

Database System Concepts - 7th Edition 12.4 ©Silberschatz, Korth and Sudarshan
Disks

 Two types of disks:


• Magnetic disk:
 Consists of several rotating platters magnetically coated
 Read-write head

• Solid state disks


 Data is stored on multiple flash storage devices
 Both types of disk consist of a number of disk block
 Disk block is a logical unit for storage allocation and retrieval
• Typically -- 4 to 16 kilobytes
• Smaller blocks: more transfers from disk
• Larger blocks: more space wasted due to partially filled blocks

Database System Concepts - 7th Edition 12.5 ©Silberschatz, Korth and Sudarshan
Magnetic Disks

 Surface of platter divided into circular tracks


• Over 50K-100K tracks per platter on typical hard disks
 Each track is divided into sectors.
• A sector is the smallest unit of data that can be read or written.
• Sector size typically 512 bytes
• Typical sectors per track: 500 to 1000 (on inner tracks) to 1000
to 2000 (on outer tracks)
 Read-write head. To read/write a sector
• Disk arm swings to position head on right track
• Platter spins continually; data is read/written as sector passes
under head
 Head-disk assemblies
• Multiple disk platters on a single spindle (1 to 5 usually)
• One head per platter, mounted on a common arm.

Database System Concepts - 7th Edition 12.6 ©Silberschatz, Korth and Sudarshan
Magnetic Hard Disk Mechanism

Schematic diagram of magnetic disk drive Photo of magnetic disk drive

Database System Concepts - 7th Edition 12.7 ©Silberschatz, Korth and Sudarshan
Magnetic Disk Drives

 Platters range from .85” to 14” (historically)


• Commonly 3.5”, 2.5”, and 1.8”
 Range from 30GB to 3TB per drive
 Performance
• Transfer Rate – theoretical – 6 Gb/sec
• Effective Transfer Rate – real – 1Gb/sec
• Seek time from 3ms to 12ms – 9ms common for desktop drives
• Average seek time measured or calculated based on 1/3 of tracks
• Latency based on spindle speed
 1 / (RPM / 60) = 60 / RPM

• Average latency = ½ latency

Database System Concepts - 7th Edition 12.8 ©Silberschatz, Korth and Sudarshan
Magnetic Disk Performance

 Access Latency = Average access time = average seek time + average


latency
• For fastest disk 3ms + 2ms = 5ms
• For slow disk 9ms + 5.56ms = 14.56ms
 Average I/O time = average access time + (amount to transfer / transfer
rate) + controller overhead
 For example to transfer a 4KB block on a 7200 RPM disk with a 5ms
average seek time, 1Gb/sec transfer rate with a .1ms controller overhead =
• 5ms + 4.17ms + 0.1ms + transfer time =
• Transfer time = 4KB / 1Gb/s * 8Gb / GB * 1GB / 10242KB = 32 /
(10242) = 0.031 ms
• Average I/O time for 4KB block = 9.27ms + .031ms = 9.301ms

Database System Concepts - 7th Edition 12.9 ©Silberschatz, Korth and Sudarshan
The First Commercial Disk Drive

1956
IBM RAMDAC computer included
the IBM Model 350 disk storage
system

5M (7 bit) characters
50 x 24” platters
Access time = < 1 second

Database System Concepts - 7th Edition 12.10 ©Silberschatz, Korth and Sudarshan
Storage Interfaces

 Disk interface standards families


• SATA (Serial ATA)
 SATA 3 supports data transfer speeds of up to 6 gigabits/sec

• SAS (Serial Attached SCSI)


 SAS Version 3 supports 12 gigabits/sec

• NVMe (Non-Volatile Memory Express) interface


 Works with PCIe connectors to support lower latency and
higher transfer rates
 Supports data transfer rates of up to 24 gigabits/sec
 Disks usually connected directly to computer system

Database System Concepts - 7th Edition 12.11 ©Silberschatz, Korth and Sudarshan
Storage Attachment

 Computers access storage in three ways


• host-attached
• network-attached
• cloud
 Host attached access through local I/O ports, using one of several
technologies
• To attach many devices, use storage busses such as USB, firewire,
thunderbolt
• High-end systems use fibre channel (FC)
 High-speed serial architecture using fibre or copper cables
 Multiple hosts and storage devices can connect to the FC fabric

Database System Concepts - 7th Edition 12.12 ©Silberschatz, Korth and Sudarshan
Network-Attached Storage

 Network-attached storage (NAS) is storage made available over a


network rather than over a local connection (such as a bus)
 Remotely attaching to file systems
 NFS and CIFS are common protocols
 Implemented via remote procedure calls (RPCs) between host and
storage over typically TCP or UDP on IP network
 iSCSI protocol uses IP network to carry the SCSI protocol
 Remotely attaching to devices (blocks)

Database System Concepts - 7th Edition 12.13 ©Silberschatz, Korth and Sudarshan
Cloud Storage

 Similar to NAS, provides access to storage across a network


• Unlike NAS, accessed over the Internet or a WAN to remote data
center
 NAS presented as just another file system, while cloud storage is API
based, with programs using the APIs to provide access
• Examples include Dropbox, Amazon S3, Microsoft OneDrive,
Apple iCloud
• Use APIs because of latency and failure scenarios (NAS
protocols wouldn’t work well)

Database System Concepts - 7th Edition 12.14 ©Silberschatz, Korth and Sudarshan
Disk Controller

Interfaces between the computer system and the disk drive hardware
 Accepts high-level commands to read or write a sector
 Initiates actions such as moving the disk arm to the right track
and reading or writing the data
 Computes and attaches checksums to each sector to verify that
data is read back correctly
• If data is corrupted, with very high probability stored
checksum won’t match recomputed checksum
 Ensures successful writing by reading back sector after writing it
 Performs remapping of bad sectors

Database System Concepts - 7th Edition 12.15 ©Silberschatz, Korth and Sudarshan
Performance Measures of Disks

 Access time – the time it takes from when a read or write request is issued
to when data transfer begins. Consists of:
 Seek time – time it takes to reposition the arm over the correct track.
 Average seek time is 1/2 the worst case seek time.
– Would be 1/3 if all tracks had the same number of sectors, and
we ignore the time to start and stop arm movement
 4 to 10 milliseconds on typical disks
 Rotational latency – time it takes for the sector to be accessed to
appear under the head.
 4 to 11 milliseconds on typical disks (5400 to 15000 r.p.m.)
 Average latency is 1/2 of the above latency.
 Overall latency is 5 to 20 msec depending on disk model
 Data-transfer rate – the rate at which data can be retrieved from or stored
to the disk.
 25 to 200 MB per second max rate, lower for inner tracks

Database System Concepts - 7th Edition 12.16 ©Silberschatz, Korth and Sudarshan
Mean Time to Failure (MTTF)

 The average time the disk is expected to run continuously


without any failure
 Typically -- 3 to 5 years
 Probability of failure of new disks is quite low, corresponding to
a “theoretical MTTF” of 500,000 to 1,200,000 hours for a new
disk
• E.g., an MTTF of 1,200,000 hours for a new disk means
that given 1000 relatively new disks, on an average one will
fail every 1200 hours
 MTTF decreases as disk ages

Database System Concepts - 7th Edition 12.17 ©Silberschatz, Korth and Sudarshan
Disk Access

 Sequential access pattern


• Successive requests are for successive disk blocks
• Disk seek required only for first block
 Random access pattern
• Successive requests are for blocks that can be anywhere on disk
• Each access requires a seek
• Transfer rates are low since a lot of time is wasted in seeks
 I/O operations per second (IOPS)
• Number of random block reads that a disk can support per second
• 50 to 200 IOPS on current generation magnetic disks

Database System Concepts - 7th Edition 12.18 ©Silberschatz, Korth and Sudarshan
Solid State Disks (SSD)

 Use standard block-oriented disk interfaces, but store data on


multiple flash storage devices internally
 Transfer rate of up to 500 MB/sec using SATA, and
up to 3 GB/sec using NVMe PCIe

Database System Concepts - 7th Edition 12.19 ©Silberschatz, Korth and Sudarshan
SSD Performance Metrics

 Random reads/writes per second


• Typical 4 KB reads: 10,000 reads per second (10,000 IOPS)
• Typical 4KB writes: 40,000 IOPS
• SSDs support parallel reads
 Typical 4KB reads:
• 100,000 IOPS with 32 requests in parallel (QD-32) on SATA
• 350,000 IOPS with QD-32 on NVMe PCIe
 Typical 4KB writes:
• 100,000 IOPS with QD-32, even higher on some models
 Data transfer rate for sequential reads/writes
• 400 MB/sec for SATA3, 2 to 3 GB/sec using NVMe PCIe
 Hybrid disks: combine small amount of flash cache with larger magnetic
disk

Database System Concepts - 7th Edition 12.20 ©Silberschatz, Korth and Sudarshan
Improvement of Reliability via Redundancy
 Redundancy – store extra information that can be used to rebuild
information lost in a disk failure
 Mirroring (or shadowing)
 Duplicate every disk. Logical disk consists of two physical disks.
 Every write is carried out on both disks
 Reads can take place from either disk
 If one disk in a pair fails, data still available in the other
 Data loss will occur only if a disk fails, and its mirror disk also fails
before the system is repaired
 Probability of combined event is very small
– Except for dependent failure modes such as fire or building
collapse or electrical power surges
 Mean time to data loss depends on mean time to failure,
and mean time to repair
 E.g., MTTF of 100,000 hours, mean time to repair of 10 hours gives
mean time to data loss of 500*106 hours (or 57,000 years) for a
mirrored pair of disks (ignoring dependent failure modes)

Database System Concepts - 7th Edition 12.21 ©Silberschatz, Korth and Sudarshan
Improvement in Performance via Parallelism

 Two main goals of parallelism in a disk system:


1. Load balance multiple small accesses to increase throughput
2. Parallelize large accesses to reduce response time.
 Improve transfer rate by striping data across multiple disks.
 Bit-level striping
 Block-level striping

Database System Concepts - 7th Edition 12.22 ©Silberschatz, Korth and Sudarshan
Improvement in Performance via Parallelism

 Bit-level striping – split the bits of each byte across multiple disks
 In an array of eight disks, write bit i of each byte to disk i.
 Each access can read data at eight times the rate of a single disk.
 But seek/access time worse than for a single disk
 Bit level striping is not used much any more
 Block-level striping – with n disks, block i of a file goes to disk (i
mod n) + 1
 Requests for different blocks can run in parallel if the blocks reside
on different disks
 A request for a long sequence of blocks can utilize all disks in
parallel

Database System Concepts - 7th Edition 12.23 ©Silberschatz, Korth and Sudarshan
Redundant Arrays of Independ Disks (RAID)

 Disk organization techniques that manage a large numbers of disks,


providing a view of a single disk of
 High capacity and high speed by using multiple disks in parallel,
 High reliability by storing data redundantly, so that data can be
recovered even if a disk fails
 The chance that some disk out of a set of N disks will fail is much higher
than the chance that a specific single disk will fail.
 E.g., a system with 100 disks, each with MTTF of 100,000 hours
(approx. 11 years), will have a system MTTF of 1000 hours (approx.
41 days)
 Techniques for using redundancy to avoid data loss are critical with
large numbers of disks

Database System Concepts - 7th Edition 12.24 ©Silberschatz, Korth and Sudarshan
RAID Levels

 Schemes to provide redundancy at lower cost by using disk striping combined


with parity bits
 Different RAID organizations, or RAID levels, have differing cost,
performance and reliability characteristics
 Various levels.
 Level 0
 Level 1
 Level 2 – not used in practice
 Level 3 – not used in practice
 Level 4 – not used in practice
 Level 5
 Level 6

Database System Concepts - 7th Edition 12.25 ©Silberschatz, Korth and Sudarshan
RAID Level 0

 Block striping; non-redundant.


 Used in high-performance applications where data loss is not critical.
 Example with 4 disks
 Figure

 For a file with 20 blocks. Block 1 goes to first disk, block 2 goes to
second disk,

Database System Concepts - 7th Edition 12.26 ©Silberschatz, Korth and Sudarshan
RAID Level 1

 Mirrored disks with block striping


 Offers best write performance.
 Popular for applications such as storing log files in a database system.
 Figure with 8 disks.
 4 with striping
 4 mirroring the other 4

Database System Concepts - 7th Edition 12.27 ©Silberschatz, Korth and Sudarshan
RAID Level 5

 Block-interleaved distributed parity. Uses parity bits to enhance


redundancy at a lower cost
 Blocks are partitioned into sets, For a given set of blocks, a parity block is
computed and stored on a disk
 Parity block i stores XOR of bits from block i of each disk
 When writing data to a block i, parity block i must also be computed and
written to disk
 Can be done by using old parity block, old value of current block and
new value of current block (2 block reads + 2 block writes)
 Or by recomputing the parity value using the new values of blocks
corresponding to the parity block
 More efficient for writing large amounts of data sequentially
 To recover data for a block, compute XOR of bits from all other blocks in
the set including the parity block

Database System Concepts - 7th Edition 12.28 ©Silberschatz, Korth and Sudarshan
RAID Level 5 (Cont.)

 Example with 5 disks


 Parity block for nth set of blocks is stored on disk (n mod 5) + 1, with the
data blocks stored on the other 4 disks.

 Block writes occur in parallel if the blocks and their parity blocks are on
different disks

Database System Concepts - 7th Edition 12.29 ©Silberschatz, Korth and Sudarshan
RAID Level 5 (Cont.)

 Example, with an array of five disks


 The parity block, labeled Pk, for logical blocks k is stored in disk k mod 5
 The corresponding blocks of the other four disks store the four data blocks
4k to 4k+3.
 The following table indicates how the first 20 blocks, numbered 0 to 19, and
their parity blocks are laid out.

Database System Concepts - 7th Edition 12.30 ©Silberschatz, Korth and Sudarshan
RAID Level 6

 P+Q Redundancy scheme


 Similar to Level 5, but stores two error correction blocks (P, Q)
instead of single parity block to guard against multiple disk failures.
 Better reliability than Level 5 at a higher cost
 Becoming more important as storage sizes increase
 Figure

Database System Concepts - 7th Edition 12.31 ©Silberschatz, Korth and Sudarshan
RAID Levels Not Used in Practice

 RAID Level 2: Memory-Style Error-Correcting-Codes (ECC) with bit


striping.
 RAID Level 3: Bit-Interleaved Parity
 RAID Level 4: Block-Interleaved Parity; uses block-level striping, and
keeps a parity block on a separate parity disk for corresponding blocks
from N other disks.
 RAID 5 is better than RAID 4, since with RAID 4 with random writes,
parity disk gets much higher write load than other disks and becomes
a bottleneck

Database System Concepts - 7th Edition 12.32 ©Silberschatz, Korth and Sudarshan
Factors in Choosing RAID level

 Monetary cost
 Performance: Number of I/O operations per second, and
bandwidth during normal operation
 Performance during failure
 Performance during rebuild of failed disk
 Including time taken to rebuild failed disk

Database System Concepts - 7th Edition 12.33 ©Silberschatz, Korth and Sudarshan
Choice of RAID Level

 RAID 0 is used only when data safety is not important


 E.g., data can be recovered quickly from other sources
 RAID 1 provides much better write performance than level 5
 Level 5 requires at least 2 block reads and 2 block writes to write a
single block, whereas Level 1 only requires 2 block writes
 RAID 1 has higher storage cost than level 5
 RAID 5 is preferred for applications where writes are sequential and large
(many blocks), and need large amounts of data storage
 RAID1 is preferred for applications with many random/small updates
 RIAD 6 gives better data protection than RAID 5 since it can tolerate two
disk (or disk block) failures
 Increasing in importance since latent block failures on one disk,
coupled with a failure of another disk can result in data loss with RAID
1 and RAID 5.

Database System Concepts - 7th Edition 12.34 ©Silberschatz, Korth and Sudarshan
Optimization of Disk-Block Access

 Buffering: in-memory buffer to cache disk blocks


 Read-ahead: Read extra blocks from a track in anticipation that they
will be requested soon
 Disk-arm-scheduling algorithms re-order block requests so that disk
arm movement is minimized
 elevator algorithm

Database System Concepts - 7th Edition 12.35 ©Silberschatz, Korth and Sudarshan
End of Chapter 12

Database System Concepts, 7th Ed.


©Silberschatz, Korth and Sudarshan
See www.db-book.com for conditions on re-use
RAID Level 5

 RAID level 5 uses parity bits to enhance redundancy at a lower cost


 Blocks in a RAID system are partitioned into sets, For a given set of blocks,
a parity block is computed and stored on disk;
 The ith bit of the parity block is computed as the exclusive or (XOR) of
the ith bits of the all blocks in the set.
 If the contents of any one of the blocks in a set is lost due to a failure, the
block contents can be recovered by computing the bitwise-XOR of the
remaining blocks in the set, along with the parity block.
 Whenever a block is written, the parity block for its set must be recomputed
and written to disk. The new value of the parity block can be computed by
either
 (i) reading all the other blocks in the set from disk and computing the
new parity block, or
 (ii) by computing the XOR of the old value of the parity block with the old
and new value of the updated block.

Database System Concepts - 7th Edition 12.37 ©Silberschatz, Korth and Sudarshan
RAID Level 5

 Parity blocks: Parity block i stores XOR of bits from block i of each disk
 When writing data to a block i, parity block i must also be computed
and written to disk
 Can be done by using old parity block, old value of current block
and new value of current block (2 block reads + 2 block writes)
 Or by recomputing the parity value using the new values of blocks
corresponding to the parity block
– More efficient for writing large amounts of data sequentially
 To recover data for a block, compute XOR of bits from all other blocks
in the set including the parity block

Database System Concepts - 7th Edition 12.38 ©Silberschatz, Korth and Sudarshan

You might also like