Presentation is loading. Please wait.

Presentation is loading. Please wait.

Storage and File structure COP 4720 Lecture 20 Lecture Notes.

Similar presentations


Presentation on theme: "Storage and File structure COP 4720 Lecture 20 Lecture Notes."— Presentation transcript:

1 Storage and File structure COP 4720 Lecture 20 Lecture Notes

2 Outline RAID levels Storage access File Organization Sec 10.3, 10.5, 10.6 Chapter 10: Storage and File Structures

3 RAID Levels Schemes to provide redundancy at lower cost by using disk striping combined with parity bits. Different RAID organizations (RAID levels) have differing cost, performances and reliability characteristics. Level 0: Striping at the level of blocks; non-redundant. Used in high performance applications where data loss is not critical. B1 B2B3B4 B5

4 RAID Levels Level 1: Mirrored disks; offers the best write performance. Popular for applications such as storing log files in a database system. Mirrored Disks

5 RAID Levels Level 2: Memory style Error-Correcting-Codes with bit stripping ECC bits Data disks bit striped Not used in practice

6 RAID Levels Level 3 : Bit-Interleaved Parity; a single parity bit can be used for error correction, not just detection. Parity bit disk Use the fact that the disk unit can detect error sectors

7 RAID Levels Level 4: Block interleaved parity. Uses block-level striping and keeps a parity block on a separate disk for corresponding blocks from N other disks. Block parity disk

8 RAID Levels Level 5: Block-Interleaved Distributed Parity; partitions data and parity among all N+1 disks. Data and Parity blocks Level 6: similar to level 5 but with ECC schemes

9 Storage Access A database file is partitioned into fixed-length storage units called blocks Database systems seek to minimize the number of block transfers between disk and memory. Buffer – portion of main memory available to store copies of disk blocks. Buffer manager – subsystem responsible for allocating buffer space in main memory.

10 Buffer Replacement Policies Most operating systems use LRU Not always the best strategy for queries join involves a repeated scan a mixed strategy with help from the query optimizer is often used pinned and toss-immediate

11 File Organization The database is stored as a collection of files one approach assume fixed record size each file has records of one particular type only different files are used for different relations

12 Fixed Length Records record i is stored starting at byte (i – 1) * n simple but may cross block boundaries deletion of a record i fill in the empty space with a shift left move last record to ith location keep a free space list.

13 Free Space List File header info about file and ptr to 1 st free location each free location points to the next free location

14 Variable Length Records Variable length records arise in database systems by: storage of multiple record type is a file record types that allow variable length fields record types that allow repeating fields can be represented by a byte string use special character to represent EOR difficulty with deletion difficulty with expansion

15 Variable Length Records: slotted page structure Header contains # of record entries end of free space in the block (after header) location & size of each record records can be moved around within the block update header pointers point to the entry position in the header

16 Variable Length Records: fixed length representation two techniques 1. reserved space -know the maximum length -short records are right filled with special character -best when most records have length near max

17 Variable Length Records: fixed length representation 2. Pointer method -pointers chain together block entries belonging to the same record -implemented with anchor block and an overflow block.


Download ppt "Storage and File structure COP 4720 Lecture 20 Lecture Notes."

Similar presentations


Ads by Google