Flashcards
Chapter 12
Cards in this deck (65)
- 1Volatile StorageLoses contents when power off
- 2non-volatile storagecontents persist when power is off
includes secondary, tertiary storage as well as batter backed up main memory - 3Factors Affecting Choice of Storage MediaSpeed with which data can be accessed
Cost per unit of data
reliability - 4primary storagefastest media but volatile (cache, main memory)
- 5Secondary Storagenext level in hierarchy, non-volatile, moderately fast access time
Also called on-line storage
ex: flash memory, magnetic disks - 6tertiary storagelowest level in hierarchy, non-volatile, slow access time
Called off-line storage, used for archival storage, ex: magnetic tape, optical storage - 7Magnetic TapeSequential access, 1 - 12 TB capacity
A few drives with many tapes
Juke boxes with petabytes (1000's of TB) of storage - 8SATA (Serial ATA)SATA 3 supports data transfer of speeds up to 6gb/s
- 9SAS (Serial Attached SCSI)SAS V3 supports 12gb/sec
- 10NVMe (Non-volatile Memory Express) InterfaceWorks with PCIe connectors to support lower latency and higher transfer rates
Supports data transfer of 24gigs/sec - 11Storage Area Networks (SAN)A large number of disks are connected by a high-speed network to a number of servers
- 12Network Attached Storage (NAS)provides a file system interface using networked file system protocol, instead of providing a disk system interface
- 13Read-Write HeadSurface of platter divided into circular tracks
Over 50k-100k tracks per platter on typical hard disks - 14Sectorsthe smallest unit of data that can be written or read
Size typically 512 bytes
Typical Sectors per track: 500 - 1000 on inner tracks, 1000 - 2000 on outer tracks - 15How to read/write a sector?Disk arm swings to position head on track
Platter spins continually data is R/W as sector passes under head. - 16Head-Disk AsembeliesMultiple disk platters on a single spindle 1 - 5 usually
One head per platter, mounted on common arm - 17Disk ControllerInterfaces b/w the computer system and the disk hardware
Accepts high-lvl commands to read or write a sector
Initiates actions such as moving the disk arm to right track and reading or writing the data
Computers and attaches checksums to each sector to ensure data is read back correctly,
If data is corrupted, stored checksum wont match recomputed checksum
Ensures succesful of writing by reading back sector after writing it
Performs remapping of bad sectors - 18Access TimeTime it takes from when a read or write is requested to when data transfer begins
Consists of Seek Time, Rotational Latency - 19Seek TimeTime it takes to reposition arm over correct track
Avg Seek time is 1/2 worst case seek time
Would be 1/3 if all tracks had same number of sectors and we ignore the start/stop arm movement time
4 - 10 milliseconds on typical disk - 20Rotational latencyTime it takes for sector to be access to appear under the head
4 - 11 milliseconds on avg disk (5400 - 15000 RPM)
Average latency is 1/2 of above latency
Overall latency is 5 - 20 Msec depending on disk model - 21Data Transfer RateRate at which data can be retrieved or stored to disk
25 - 200 MB per second max rate, lower for inner tracks - 22Disk Blocklogical unit for storage allocation and retrieval
4 - 16 Kilobytes typically
Smaller Blocks: More transfers from disk
Larger Blocks: More space wasted due to partially filled blocks - 23Sequential Access PatternSuccessive requests are for successive disk blocks
Disk seek required only for first block - 24Random Access PatternSuccesive request for blocks that can be anywhere on disk
Each access requries a seek
Low transfer rates due to seeks - 25I/O Per Second (IOPS)Number of random block reads that a disk can support per second
50 - 200 IOPS current gen magentic disks - 26Mean Time to Failure (MTTF)Avg time disk is expected to run without any failure.
Typically 3 - 5 Years
Decreases as disk ages - 27NAND FlashWidely used for storage, cheaper than NOR
Requires Page at a time read ( page: 512 bytes - 4KB)
Not much difference b/w sequential and random read
Page can only be written once, must be erased to allow rewrite - 28Solid State Disks SSDStandard block oriented disk interfaces, but store data on multiple flash storage devices internally
Transfer rate of up to 500Mb/Sec using SATA
3GB/Sec using NVMe PCIe - 29How does erase happen?Happens in units of erase block
Takes 2-5 milliseconds
Typically 256Kb - 1MB (128 Pages - 256) - 30How to avoid waiting for erase?Remapping logical addresses to physical page addresses avoids waiting for erase
- 31Flash translation tabletracks mapping, also stored in a label field of flash page
remapping carried out by flash translation later - 32Wear Levelingafter 100k - 1 million erases, erase block becomes unreliable and cannot be used.
- 33Random Reads/Writes Per SecondTypical 4KB Reads: 10k / sec (10k IOPS)
Typical 4KB Write: 40k IOPS - 34SSD's Parrallel ReadsTypical 4KB Read: 100k IOPS with 32 Requests in parallel on SATA
350K IOPS with QD-32 on NVMe PCIe
Typical 4KB Writes:
100k IOPS with QB32, even higher on some models - 35Data Transfer Rate for Sequential Reads/Writes400MB/Sec for SATA3
2-3GB/Sec for NVMe PCIe - 36Hybrid DiskCombine small amount of flash cache with larger magnetic disk
- 37RAID: Redundant Arrays of Independent DisksDisk org technique that manges large numbers of disks providing aview of a single disk
- High capacity and high speed by using multiple disks in parralel
- High reliability by storing data redunatly, so data can be recovered if disk fails. - 38Mirroring or Shadowing ExampleDuplicate 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 would 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 - 39Mean time to data lossDepends on MTTF and MTTR (time to repair)
- 40Main goals of parallelism in disk system?Load balance multiple small accesses to increase throughput
Parallelize large accesses to reduce response time
Improve transfer rate by striping data across disks - 41Bit Level StrippingSplit bits of each byte across multiple disks
- In array of eight disks, write bit i of each byte to disk i
Each access can read data at 8x rate of single disk
Seek/Access time is worse than for single disk
This is not used much anymore - 42Block Level Stripping– 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 - 43Raid Level 0Block Striping, Non Redundant
Used in high performance apps where data loss is not critical - 44Raid Level 1Mirrored disks with block stripping
Offers best write performance
Popular for apps such as storing log files in a DB system - 45Parity BlocksParity block j stores XOR of bits from block j of each disk
• When writing data to a block j, parity block j 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 - 46Raid Level 5Block interleaved Distributed Parity: Partitions data and Partity among all N+1 Disks rather than storing data in N disks and Parity in 1 disk
- Block writes occur in parallel if the blocks and their parity blocks on different disks - 47Raid Level 6P+Q Redundancy Scheme
Similar to 5 but stores two error correct blocks (P,Q) instead of single parity block to guard against multiple disk failues
- Better reliability than Lvl 5 at higher cost
- Becoming more important as storage size increases - 48Raid Level 2:Not used in Practice
Memory Style Error Correcting Codes with Bit Striping - 49Raid Level 3Bit Interleaved Parity
- 50Raid Level 4Block 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 > Raid 4, since R4 w/h random writes, parity disk gets much higher write load than other disks and becomes a bottleneck - 51Factors for RAID LevelMonetary Cost
Perfomance: # of IOPS and Bandwith during normal operation
Performance during failure
Performance During rebuild of failed disk, including time taken to rebuild failed disk. - 52When is Raid 0 Used?When data safety is not important, data can be recovered quickly from elsewhere
- 53When to choose Level 1?Provides much better write performance than Lvl 5
As Lvl 5 requries at least 2 block reads and 2 block writes to write 1 block, Lvl 1 only needs 2 block writes.
Lvl 1 Had Higher Storage Cost than Lvl 5
Prefered for apps with Small / Random Updates - 54When Raid Level 5?Preferred for applications where writes are sequential and large (many blocks), and need large amounts of data storage
- 55When to choose Level 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 1 disk, coupled with failure of another disk can cause data loss in RAID 1 and 5 - 56Software RaidRAID implementations done entirely in software, with
no special hardware support - 57Hardware Raid:RAID implementations with special hardware
• Use non-volatile RAM to record writes that are being executed
• Beware: power failure during write can result in corrupted disk
E.g., failure after writing one block but before writing the second
in a mirrored system
- Such corrupted data must be detected when power is restored
• Recovery from corruption is similar to recovery from failed disk
• NV-RAM helps to efficiently detected potentially corrupted blocks
Otherwise all blocks of disk must be read and compared
with mirror/parity block - 58Latent Failures:data successfully written earlier gets damaged
• can result in data loss even if only one disk fails
Hardware Issue - 59Data Scrubbing:• continually scan for latent failures, and recover from copy/parity
- 60Hot Swappingreplacement of disk while system is running, without power
down
• Supported by some hardware RAID systems,
• reduces time to recovery, and improves availability greatly - 61How do Hardware Raid Systems ensure that single point of failure will not stop the system?Redundant power supplies with battery backup
• Multiple controllers and multiple interconnections to guard against
controller/interconnection failures - 62BufferingIn memory buffer to cache disk blocks
- 63Read AheadRead extra blocks from a track in anticipation that they will be requested soon
- 64Disk Arm SchedulingAlgorithms reorder block requests so that disk arm movement is minimized.
Like elevator algorithm. - 65File Organization for Optimization of Disk Block AccessAllocate blocks of a file in as contiguous a manner as possible
• Allocation in units of extents
• Files may get fragmented
E.g., if free blocks on disk are scattered, and newly created file has its blocks scattered over the disk
Sequential access to a fragmented file results in increased disk
arm movement
Some systems have utilities to defragment the file system, in
order to speed up file access
- Non-volatile write buffers
Information
- Description
- Uni Ch12 DB Flashcards on Chapter 12, created by Ali Raza Bhangu on 17/04/2023.
- Created by
- Ali Raza Bhangu · Apr 2023
- Updated
- Apr 17, 2023
- Views
- 9
- Tags
- Rating