Secondary Storage Devices Magnetic Disks Optical Disks Floppy

  • Slides: 41
Download presentation
Secondary Storage Devices: Magnetic Disks Optical Disks Floppy Disks Magnetic Tapes CENG 351 1

Secondary Storage Devices: Magnetic Disks Optical Disks Floppy Disks Magnetic Tapes CENG 351 1

Storage Definition • Storage: The computer process of retaining information for future use. •

Storage Definition • Storage: The computer process of retaining information for future use. • Secondary Storage/Auxiliary Storage: A storage medium that is external to the computer, but that can be read by the computer; a way of storing data and information outside of the computer itself.

Storage Characteristics • Reliable • Economical • Compact • Convenient

Storage Characteristics • Reliable • Economical • Compact • Convenient

Secondary Storage Devices Ø Two major types of secondary storage devices: 1. Direct Access

Secondary Storage Devices Ø Two major types of secondary storage devices: 1. Direct Access Storage Devices (DASDs) – – Magnetic Discs Hard disks (high capacity, low cost, fast) Floppy disks (low capacity, lower cost, slow) Optical Disks CD-ROM = (Compact disc, read-only memory 2. Serial Devices – Magnetic tapes (very fast sequential access) CENG 351 4

Storage and Files • • Storage has major implications for DBMS design! – READ:

Storage and Files • • Storage has major implications for DBMS design! – READ: transfer data from disk to main memory (RAM). – WRITE: transfer data from RAM to disk. – Both operations are high-cost operations, relative to in-memory operations, so DB must be planned carefully! Why Not Store Everything in Main Memory? – Costs too much: Cost of RAM about 100 times the cost of the same amount of disk space, so relatively small size. – Main memory is volatile. – Typical storage hierarchy: • Main memory (RAM) (primary storage) for currently used data. • Disk for the main database (secondary storage). • Tapes for archiving older versions of the data (tertiary storage). CENG 351 5

Storage Hierarchy • • Primary storage : random access memory (RAM) – typical capacity

Storage Hierarchy • • Primary storage : random access memory (RAM) – typical capacity a number of GB – cost per MB $2 -3. 00 – typical access time 5 ns to 60 ns Secondary storage: magnetic disk/ optical devices/ tape systems – typical capacity a number of 100 GB for fixed media; for removable – cost per MB $0. 01 for fixed media, more for removable – typical access time 8 ms to 12 ms for fixed media, larger for removable CENG 351 6

Units of Measurement Spatial units: o byte: 8 bits o kilobyte (KB): 1024 or

Units of Measurement Spatial units: o byte: 8 bits o kilobyte (KB): 1024 or 210 bytes o megabyte (MB): 1024 kilobytes or 220 bytes o gigabyte (GB): 1024 megabytes or 230 bytes Time units: o nanosecond (ns) one- billionth (10 -9 ) of a second o microsecond ( s) one- millionth (10 -6 ) of a second o millisecond (ms) one- thousandth (10 -3 ) of a second Primary versus Secondary Storage – Primary storage costs several hundred times as much per unit as secondary storage, but has access times that are 250, 000 to 1, 000 times faster than secondary storage. CENG 351 7

Memory Hierarchy – At the primary storage level, the memory hierarchy includes, at the

Memory Hierarchy – At the primary storage level, the memory hierarchy includes, at the most expensive end’ cache memory, which is a static RAM (Random Access Memory). – The next level of primary storage is DRAM (Dynamic RAM), The advantage of DRAM is its low cost, lower speed compared with static RAM. – Programs normally reside and execute in DRAM. – Now that personal computers and workstations have 10 s of gigabytes of data in DRA, in some cases, entire databases can be kept in the main memory (with a backup copy on magnetic disk), leading to main memory databases. CENG 351 8

Memory Hierarchy-flash memory – Flash memory, since 1988 it has become common, particularly because

Memory Hierarchy-flash memory – Flash memory, since 1988 it has become common, particularly because it is nonvolatile, using EEPROM (Electrically Erasable Programmable Read-Only Memory) technology. Its life is 10, 0001, 000 times erase… Read/write is fast, but erase is slow… – Therefore special arrangements are made for the file system, regarding file delete or update. – Capacities up to 128 GB has been realized todate. CENG 351 9

Magnetic Disks • Bits of data (0’s and 1’s) are stored on circular magnetic

Magnetic Disks • Bits of data (0’s and 1’s) are stored on circular magnetic platters called disks. • A disk rotates rapidly (& never stops). • A disk head reads and writes bits of data as they pass under the head. • Often, several platters are organized into a disk pack (or disk drive). CENG 351 10

Storage Magnetic Disk Storage

Storage Magnetic Disk Storage

A Disk Drive surfaces Boom Spindle Read/Write heads Disk drive with 4 platters and

A Disk Drive surfaces Boom Spindle Read/Write heads Disk drive with 4 platters and 8 surfaces and 8 RW heads CENG 351 12

Storage Hard Disk • Disk Storage Areas – Track: The area in which data

Storage Hard Disk • Disk Storage Areas – Track: The area in which data and information are stored on magnetic tape or disk. – Sector: A subdivision of a track on a magnetic disk; used to improve access to data or information. – Cylinder: A storage concept that refers to the same track location on each of the platters. – Head Crash: The situation that occurs when the read/write heads that normally float close to a magnetic disk’s surface actually touch the surface.

Looking at a surface tracks sector Surface of disk showing tracks and sectors CENG

Looking at a surface tracks sector Surface of disk showing tracks and sectors CENG 351 14

Storage Hard Disk (Continued)

Storage Hard Disk (Continued)

Storage Hard Disk (Continued)

Storage Hard Disk (Continued)

Cylinders • A cylinder is the set of tracks at a given radius of

Cylinders • A cylinder is the set of tracks at a given radius of a disk pack. – i. e. a cylinder is the set of tracks that can be accessed without moving the disk arm. • All the information on a cylinder can be accessed without moving the read/write arm. CENG 351 17

Cylinders CENG 351 18

Cylinders CENG 351 18

Estimating Capacities • • Track capacity = # of sectors/track * bytes/sector Cylinder capacity

Estimating Capacities • • Track capacity = # of sectors/track * bytes/sector Cylinder capacity = # of tracks/cylinder * track capacity Drive capacity = # of cylinders * cylinder capacity Number of cylinders = # of tracks in a surface CENG 351 19

Exercise • Store a file of 20000 records on a disk with the following

Exercise • Store a file of 20000 records on a disk with the following characteristics: # of bytes per sector = 512 # of sectors per track = 40 # of tracks per cylinder = 11 # of cylinders = 1331 Q 1. How many cylinders does the file require if each data record requires 256 bytes? Q 2. What is the total capacity of the disk? CENG 351 20

Organizing Tracks by sector 6 10 7 5 3 6 4 8 2 7

Organizing Tracks by sector 6 10 7 5 3 6 4 8 2 7 3 9 9 11 2 5 10 1 11 4 1 Physically adjacent sectors 8 Sectors with 3: 1 interleaving CENG 351 21

Exercise • Suppose we want to read consecutively the sectors of a track in

Exercise • Suppose we want to read consecutively the sectors of a track in order: sectors 1, 2, … 11. • Suppose two consecutive sectors cannot be read in non-interleaving case. • How many revolutions to read the disk? a) Without interleaving b) With 3: 1 interleaving • Note: nowadays most disk controllers are fast enough so interleaving is not common. . . CENG 351 22

Storage Hard Disk (Continued) • Disk Storage Areas – Disk Pack: A stack of

Storage Hard Disk (Continued) • Disk Storage Areas – Disk Pack: A stack of disks, enclosed in a protective plastic cover, that can be lifted onto or off a disk drive. – Random Access Storage/Direct Access Storage: The process of retrieving a particular record of information from any track directly.

Storage Magnetic Disk Storage • Disk Cartridge: The cartridge, a hard disk sealed in

Storage Magnetic Disk Storage • Disk Cartridge: The cartridge, a hard disk sealed in a protective package, is inserted into the disk drive for reading and writing data. • Extended Disk Storage Alternatives – Redundant Arrays of Independent Disks(RAID): A set of small disk drives that work together as a single unit. • Striping: A method of combining multiple physical drives into one logical storage unit. • Fault Tolerance: The capability for a computer application to continue processing even if a disk drive fails.

Storage Magnetic Disk Storage (Continued)

Storage Magnetic Disk Storage (Continued)

Storage Magnetic Disk Storage (Continued)

Storage Magnetic Disk Storage (Continued)

Storage Magnetic Disk Storage (Continued) • Extended Disk Storage Alternatives – Redundant Arrays of

Storage Magnetic Disk Storage (Continued) • Extended Disk Storage Alternatives – Redundant Arrays of Independent Disks(RAID) • Disk Mirroring: The most frequently used form of RAID; it uses pairs of drives within the array and duplicates the entire contents of a disk on a second disk. • Storage Area Network: A high-speed network or system that allows different kinds of storage devices, such as tape drives and disk arrays, to be shared by all users through network servers.

Storage Magnetic Disk Storage (Continued)

Storage Magnetic Disk Storage (Continued)

Clusters • Usually File manager, under the operating system, maintains the logical view of

Clusters • Usually File manager, under the operating system, maintains the logical view of a file. • File manager views the file as a series of clusters, each of a number of sectors. The clusters are ordered by their logical order. • Files can be seen in the form of logical sectors or blocks, which needs to be mapped to physical clusters. • File manager uses a file allocation table (FAT) to map logical sectors of the file to the physical clusters. CENG 351 29

Storage Magnetic Disk Storage (Continued)

Storage Magnetic Disk Storage (Continued)

The Cost of a Disk Access Ø The time to access a sector in

The Cost of a Disk Access Ø The time to access a sector in a track on a surface is divided into 3 components: Time Component Action Seek Time to move the read/write arm to the correct cylinder Rotational delay (or latency) Time it takes for the disk to rotate so that the desired sector is under the read/write head Transfer time Once the read/write head is positioned over the data, this is the time it takes for transferring data CENG 351 31

Seek time • Seek time is the time required to move the arm to

Seek time • Seek time is the time required to move the arm to the correct cylinder. • Largest in cost. Typically: – 5 ms (miliseconds) to move from one track to the next (track-to-track) – 50 ms maximum (from inside track to outside track) – 30 ms average (from one random track to another random track) CENG 351 32

Average Seek Time (s)-1 • It is usually impossible to know exactly how many

Average Seek Time (s)-1 • It is usually impossible to know exactly how many tracks will be traversed in every seek, – we usually try to determine the average seek time (s) required for a particular file operation. • If the starting positions for each access are random, it turns out that the average seek traverses one third of the total number of cylinders. – Why? There are more ways to travel short distance than to travel long distance… • Manufacturer’s specifications for disk drives often list this figure as the average seek time for the drives. • Most hard disks today have s under 10 ms, and high-performance disks have s as low as 7. 5 ms. 33 CENG 351

Average Seek Time (s)-2 • Seek time depends only on the speed with which

Average Seek Time (s)-2 • Seek time depends only on the speed with which the head rack moves, and the number of tracks that the head must move across to reach its target. • Given the following (which are constant for a particular disk): – Hs = the time for the I/ O head to start moving – Ht = the time for the I/ O head to move from one track to the next • Then the time for the head to move n tracks is: • Seek(n)= Hs+ Ht*n CENG 351 34

Transfer Time-1 • Transfer time is the time for the read/write head to pass

Transfer Time-1 • Transfer time is the time for the read/write head to pass over a block. • The transfer time is given by the formula: Transfer time = number of sectors ----------------- x rotation time track capacity in number of sectors – e. g. if there are St sectors per track, the time to transfer one sector would be 1/ St of a revolution. CENG 351 35

Transfer Time-2 • The transfer time depends only on the speed at which the

Transfer Time-2 • The transfer time depends only on the speed at which the spindle rotates, and the number of sectors that must be read. • Given: – St = the total number of sectors per track – the transfer time for n contiguous sectors on the same track is: • Transfer Time =(n/St)*(1000/R), in ms CENG 351 36

Exercise Given the following disk: – 20 surfaces 800 tracks/surface 25 sectors/track 512 bytes/sector

Exercise Given the following disk: – 20 surfaces 800 tracks/surface 25 sectors/track 512 bytes/sector – 3600 rpm (revolutions per minute) – 7 ms track-to-track seek time 28 ms avg. seek time 50 ms max seek time. Find: a) Average latency b) Disk capacity c) Time to read the entire disk, one cylinder at a time CENG 351 37

Storage Other Magnetic Disk Storage Systems • USB Drives: Consisting of flash memory and

Storage Other Magnetic Disk Storage Systems • USB Drives: Consisting of flash memory and a USB connection, it can read and write data when connected to the computer’s USB port. • Zip Drive: A removable storage device that uses hard-shelled removable Zip disks, which can store up to 750 MB of information. • Super. Disk: A storage alternative developed by Imation (originally part of 3 M Corp. ) that has a capability of 120 MB.

Storage Optical Storage • CD-ROM Disk: Short for “compact disk-read only memory, ” an

Storage Optical Storage • CD-ROM Disk: Short for “compact disk-read only memory, ” an optical storage medium that permits storage of large amounts of information. CD-ROM disks can only be written to and cannot be erased. – Standard CD – Mini-CD – Business Card CD/Personal Compact CD (PCD): A variant on the mini-CD, it holds 20 to 60 MB, depending on the physical size of the CD.

Storage Optical Storage (Continued) • CD-ROMs have two formats – CD-R disks: A disk

Storage Optical Storage (Continued) • CD-ROMs have two formats – CD-R disks: A disk that allows users to write information to a disk only once but to read it many times (sometimes known as worm optical storage). – CD-RW disks: A disk that combines the eraseability and editing options of magnetic storage devices with the permanence, capacity, and reliability of optical storage. • CD Recorder: Also known as a CD writer or CD burner, this equipment is attached to a PC to create CDs.

Storage Optical Storage (Continued) • Digital Video Disk (DVD): The newest generation of optical

Storage Optical Storage (Continued) • Digital Video Disk (DVD): The newest generation of optical storage. It appears to operate the same way and has the same dimensions as a CD-ROM but has a much larger capacity. – DVD-RAM: A rewritable DVD form that can be used in PCs.