1 / 13

The Storage Hierarchy and Magnetic Disks

The Storage Hierarchy and Magnetic Disks. Storage Technology: Topic 1. The Storage Hierarchy. cache. main memory. price. speed. reliable memory. magnetic disk. optical disk. magnetic tape. What is the “speed” of storage?. Total response time is what counts

dalit
Download Presentation

The Storage Hierarchy and Magnetic Disks

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Storage HierarchyandMagnetic Disks Storage Technology: Topic 1

  2. The Storage Hierarchy cache main memory price speed reliable memory magnetic disk optical disk magnetic tape

  3. What is the “speed” of storage? • Total response time is what counts • Response time = Latency + Transfer time • Latency = Time till data starts getting transferred • Transfer time depends on bandwidth • Average vs worst-case response time (depends on access patterns) • Speed of memory channel also matters • Contention for memory also matters

  4. Main Memory and Cache • 32 MB L2 cache = = $500 • 32 MB memory = = $175 • Uniform access times for random accesses • Not quite true with virtual memory • Latency involved in VM translations

  5. Why Not Store Everything in Main Memory? • Costs too much. $1000 will buy you either 128MB of RAM or 9 GB of disk. • Main memory is volatile. We want data to be persistent. • Typical storage hierarchy: • Main memory for subset of data in use. • Disk for the main database (secondary) • Tapes for archiving older versions of the data (tertiary)

  6. Magnetic Disks • Secondary storage device of choice • Main advantage over tapes: random access, vs.sequential access. • Data is stored and retrieved in units called disk blocks or pages. Why? • Unlike RAM, time to retrieve a disk page varies depending upon location. • Implication?

  7. Spindle Tracks Disk head • The platters spin (7200rpm) Sector • The arm assembly is moved in or out to position a head on a desired track. Tracks under heads make a cylinder(imaginary!). Platters Arm movement • Only one head reads/writes at any one time. Arm assembly • Block size is a multiple of sector size (which is fixed). Components of a Disk

  8. Disk Interfaces • Disk controller : special processor at disk • Disk drive interface : links controller to host along computer bus • EIDE : used in PCs -- cheaper, lower performance • SCSI : used in Macs, workstations • Disk is viewed as an array of sectors (logical) • Request scheduling: elevator algorithm (location of smarts varies for SCSI and EIDE)

  9. Servicing a Disk Request • Time to access (read/write) a disk block: • seek time (moving arms to position disk head on track) • rotational delay (waiting for block to rotate under head) • transfer time (actually moving data to/from disk surface) • Seek time and rotational delay dominate. • Seek time : 1 to 20msec (components?) • Rotational delay : 0 to 10msec • Transfer rate : 1msec per 4KB block (based on rpm) • Key to lower I/O cost: reduce seek/rotation delays! Hardware vs. software solutions?

  10. Hardware Solutions • Disk buffer : 512K to 1024 K (volatile?) • Read-ahead in disk buffer • Zoned bit recording • Track skewing • Embedded servo positioning • Higher spin speeds (but more power and vibr) • Higher recording density

  11. Software Solutions • `Next’ block concept: • blocks on same track, followed by • blocks on same cylinder, followed by • blocks on adjacent cylinder • Blocks in a file should be arranged sequentially on disk (by `next’), to minimize seek and rotational delay. Why? --- locality! • For a sequential scan, pre-fetching several pages at a time is a big win!

  12. Disk Space Management • Lowest layer of DBMS software manages space on disk. • Higher levels call upon this layer to: • allocate/de-allocate a page • read/write a page • Request for a sequence of pages should be sequential on disk!

  13. Summary: • Today’s key idea: Principle of Locality • Most important principle of database systems

More Related