storing data disks and
play

Storing Data: Disks and Database Management Systems need to: Files - PDF document

Storing and Retrieving Data Storing Data: Disks and Database Management Systems need to: Files Store large volumes of data Store data reliably (so that data is not lost!) Retrieve data efficiently Alternatives for storage


  1. Storing and Retrieving Data Storing Data: Disks and � Database Management Systems need to: Files � Store large volumes of data � Store data reliably (so that data is not lost!) � Retrieve data efficiently � Alternatives for storage � Main memory (From Chapter 9 of textbook) � Disks � Tape �������������������������������������������� ������������������� �������������������������������������������� ������������������� Why Not Store Everything in Main Why Not Store Everything in Tapes? Memory? � Costs too much . � No random access . � Main memory is volatile . � Slow! �������������������������������������������� ������������������� �������������������������������������������� ������������������� 1

  2. Solution 1: Techniques for Disks making disks faster � Secondary storage device of choice � Intelligent data layout on disk � Main problem? � Redundant Array of Inexpensive Disks (RAID) �������������������������������������������� ������������������� �������������������������������������������� ������������������� Solution 2: Buffer Management Outline � Keep “currently used” data in main memory � Disk technology and how to make disk read/writes faster � Buffer management � Typical (simplified) storage hierarchy: � Storing “database files” on disk �������������������������������������������� ������������������� �������������������������������������������� ������������������� 2

  3. Components of a Disk Accessing a Disk Page � Time to access (read/write) a disk block: Spindle � Seek time: 1 to 20msec Tracks Disk head Sector � Rotational delay: 0 to 10msec v �������������� �������������������� ��������� � Transfer rate: ~ 1msec per 4KB page v ����������� �������������������������� Platters Arm movement � Key to lower I/O cost: reduce seek/rotation ��� ������������ ���!�������"��#� delays! Arm assembly �������������������������������������������� ������������������� �������������������������������������������� ������������������� Arranging Pages on Disk In-Class Exercise � Consider a disk with: � ` Next ’ block concept: � average seek time of 15 milliseconds � average rotational delay of 6 milliseconds � transfer time of 0.5 milliseconds/page � Page size = 1024 bytes � Table: 200,000 rows of 100 bytes each, no row spans 2 pages � Blocks in a file should be arranged � Find: sequentially on disk (by `next’), to � Number of pages needed to store the table minimize seek and rotational delay. � Time to read all rows sequentially � Time to read all rows in some random order �������������������������������������������� ������������������� �������������������������������������������� ������������������� 3

  4. In-Class Exercise Solution RAID (Redundant Array of Independent Disks) � Disk Array: Arrangement of several disks that gives abstraction of a single, large disk. � Goals: Increase performance and reliability. � Two main techniques: � Data striping � Redundancy �������������������������������������������� ������������������� �������������������������������������������� ������������������� Parity RAID Levels � Add 1 redundant block for every n blocks � Level 0: No redundancy of data � Striping without parity � XOR of the n blocks � Level 1: Mirrored (two identical copies) � Example: D1, D2, D3, D4 are data blocks � Each disk has a mirror image (check disk) � Compute DP as D1 XOR D2 XOR D3 XOR � Parallel access: reduces positioning time, but D4 transfer only from one disk. � Store D1, D2, D3, D4, DP on different disks � Maximum transfer rate = transfer rate of one disk � Can recover any one of them from the other � Write involves two disks. four by XORing them �������������������������������������������� ������������������� �������������������������������������������� ������������������� 4

  5. RAID Levels (Contd.) RAID Levels (Contd.) � Level 3: Bit-Interleaved Parity � Level 0+1: Striping and Mirroring � Striping Unit: One bit. One check disk. � Parallel reads. � Each read and write request involves all disks; � Write involves two disks. disk array can process one request at a time. � Maximum transfer rate = aggregate bandwidth � Combines performance of RAID 0 with redundancy of RAID 1. � Example: 8 disks � Divide into two sets of 4 disks � Each set is a RAID 0 array � One set mirrors the other �������������������������������������������� ������������������� �������������������������������������������� ������������������� RAID Levels (Contd.) RAID Levels (Contd.) � Level 5: Block-Interleaved Distributed Parity � Level 4: Block-Interleaved Parity � Similar to RAID Level 4, but parity blocks are � Striping Unit: One disk block. One check disk. distributed over all disks � Parallel reads possible for small requests, � Eliminates check disk bottleneck, one more large requests can utilize full bandwidth disk for higher read parallelism � Writes involve modified block and check disk �������������������������������������������� ������������������� �������������������������������������������� ������������������� 5

  6. In-Class Exercise In-Class Exercise Solution � How does the striping granularity (size of a stripe) affect performance, e.g., RAID 3 vs. RAID 4? �������������������������������������������� ������������������� �������������������������������������������� ������������������� Which RAID to Choose? Which RAID to Choose? Corrected. � RAID 0: great performance at low cost, limited � RAID 0: great performance at low cost, reliability limited reliability � RAID 0+1 (better than 1): small storage � RAID 0+1 (better than 1): small storage subsytems (cost of mirroring limited), or when subsytems (cost of mirroring limited), or write performance matters when write performance matters � RAID 3 (better than 2): large transfer requests of � RAID 5 (better than 3, 4): good general- contiguous blocks, bad for small requests of purpose solution single blocks � RAID 5 (better than 4): good general-purpose solution �������������������������������������������� ������������������� �������������������������������������������� ������������������� 6

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend