Download presentation
Presentation is loading. Please wait.
1
Database Management System
Lecture - 34 © Virtual University of Pakistan
2
© Virtual University of Pakistan
Data Storage Concepts © Virtual University of Pakistan
3
Classification of Physical Storage Media
Media are classified according to three characteristics Speed of access Cost per unit of data Reliability © Virtual University of Pakistan
4
Classification of Physical Storage Media
We can also differentiate storage as either volatile storage non-volatile storage © Virtual University of Pakistan
5
Physical Storage Media
Typical media available are: Cache Main memory Flash Memory © Virtual University of Pakistan
6
Physical Storage Media
Magnetic disk Optical storage (CD or DVD) Tape storage © Virtual University of Pakistan
7
© Virtual University of Pakistan
Memory Hierarchy CACHE MAIN MEMORY FLASH MEMORY MAGNETIC DISK OPTICAL DISK MAGNETIC TAPES © Virtual University of Pakistan
8
RAID – Redundant Array of Inexpensive Disks
Many disk that look as a single disk to OS but have better performance and better reliability. © Virtual University of Pakistan
9
© Virtual University of Pakistan
RAID RAID have the property that the data are distributed over the drives to allow parallel operations. © Virtual University of Pakistan
10
© Virtual University of Pakistan
RAID 0 Simple Striping Virtual single disk is divided up into strips of k sectors each. RAID 0 writes consecutive stripes over the drives in round robin fashion. © Virtual University of Pakistan
11
RAID 0 1 5 9 2 6 10 3 7 11 4 8 12 Note: This example is a basic virtual drive where each element depicted as a disk is a physical disk © Virtual University of Pakistan
12
© Virtual University of Pakistan
RAID 0 Controller will break any disk command into k commands (one for ech of the disks) and will read/write in parallel. © Virtual University of Pakistan
13
© Virtual University of Pakistan
RAID 1 It duplicates all the disks. On write, every stripe is written twice. On a read, either copy can be used. © Virtual University of Pakistan
14
© Virtual University of Pakistan
RAID 1 Fault tolerance is excellent: if a drive crashes, the copy from the duplicated disk is simply used instead. © Virtual University of Pakistan
15
RAID 1 -Simple Mirroring
2 3 1’ 2’ 3’ © Virtual University of Pakistan
16
© Virtual University of Pakistan
RAID 1 Multi-Mirroring Three copies of all data 1 2 3 1’ 2’ 3’ 1’’ 2’’ 3’’ © Virtual University of Pakistan
17
© Virtual University of Pakistan
RAID 2-3 For reliability simple parity check code is used. Parity bit is stored on separate disk. © Virtual University of Pakistan
18
© Virtual University of Pakistan
RAID 3 Can correct single error. If a drive crashes, the controller just consider all its bits as 0. © Virtual University of Pakistan
19
© Virtual University of Pakistan
RAID 3 If no parity error, its bit is considered 0. If parity error, its bit is considered 1. Huge load of the parity disk. © Virtual University of Pakistan
20
© Virtual University of Pakistan
RAID 4 RAID 4 works with stripe again. Stripe-to-stripe parity written onto a extra drive. © Virtual University of Pakistan
21
© Virtual University of Pakistan
RAID 4 If each stripe is k bytes long, all the strips are EXORed together, resulting in a parity strip stored on parity disk © Virtual University of Pakistan
22
RAID 3 or RAID 4 – Non-Rotating Parity 0
Fixed parity on the first element of the virtual drive P 1 5 9 2 6 10 3 7 11 4 8 12 © Virtual University of Pakistan
23
© Virtual University of Pakistan
RAID 5 Eliminates the bottleneck of the heavy load on the parity drive by distributing the parity bits uniformly over all drives. © Virtual University of Pakistan
24
© Virtual University of Pakistan
RAID 5 Rotating Parity 0 with Data Restart Parity starts on the first element of the virtual drive © Virtual University of Pakistan
25
© Virtual University of Pakistan
RAID 5 P 5 9 1 P 10 2 6 P 3 7 11 4 8 12 © Virtual University of Pakistan
26
© Virtual University of Pakistan
File Organization The manner data records are stored and retrieved on physical devices The technique used to find and retrieve store records are called access methods. © Virtual University of Pakistan
27
Sequential File Organization
Records are arranged on storage devices in some sequence based on the value of some field, called sequence field. © Virtual University of Pakistan
28
Sequential File Organization
Sequence field is often the key field that identifies the record. Simple, easy to understand and manage, best for providing sequential access. © Virtual University of Pakistan
29
Sequential File Organization
Not feasible for direct or random access, inserting/deleting a record in/from the middle of the sequence involves cumbersome record searches and rewriting of the file. © Virtual University of Pakistan
30
Sequential File Organization- not shown
STUDENT stId stName prName cgpa S1020 Sohail Dar MCS 2.8 S1014 Shoaib Ali BCS 2.78 S1028 Tahira Ejaz 3.2 S1034 … S1048 © Virtual University of Pakistan
31
Database Management System
Lecture - 34 © Virtual University of Pakistan
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.