File Organization
File Organization
Disadvantage
Secondary Storage
• Secondary storage devices are used to store data for
future use or as backup.
• Secondary storage includes memory devices that are
not a part of the CPU chipset or motherboard, for
example, magnetic disks, optical disks (DVD, CD, etc.),
hard disks, flash drives, and magnetic tapes
Tertiary Storage
• Tertiary storage is used to store huge volumes of
data.
• Since such storage devices are external to the
computer system, they are the slowest in speed.
• These storage devices are mostly used to take
the back up of an entire system.
• Optical disks and magnetic tapes are widely used
as tertiary storage.
Medias
• Cache
• Main Memory
• Flash Memory (also known as Electrically Erasable
Programmable Memory EEPROM): its reading
speed is as good as main memory but writing
takes time and complex also
• Magnetic-disk storage
• Optical Storage
• Tape Storage
Storage Device Hierarchy
Storage Device Hierarchy (Contd.)
CPU:
• They are fast
• Stores data in registers
• Processes the data values , evaluates the arithmetic
expressions , compute the addresses for data values etc.
Cache:
• RAM is 1000 times slower than CPU
• Hence intermediate storage is needed between RAM and
CPU called cache
• Fetch data from RAM in advance and gives illusion of having
faster main memory
• It is faster than RAM but slower than CPU
Storage Device Hierarchy (Contd.)
RAM:
• Stores frequently used program instructions to
increase the general speed of a system
• Uses optimistic approach of prefetching data
from disk drives
• It is faster than hard disk , but slower than
Cache
• The smallest storage unit is 1 byte
Storage Device Hierarchy (Contd.)
SSD:
• Uses as permanent storage for systems that need faster
storage access
• Offer 10 times faster speed compared to magnetic disks
• Costlier than RAM
• Used in In-memory databases and cloud based file system
Magnetic Disk Drives:
• Has rotating disks coated with magnetic material
• Cheaper and used for persistent data
• Read and write are in the volume of blocks
Disks: Physical Characteristics
Physical and operational characteristics that define
its performance
• Number of Platters Platters ∝ capacity
– The number of platters is directly proportional to the overall
capacity of the disk with each platter packing as much as 200
gigabytes of data.
• Track Density (TPI) number of tracks ∝ 1/Platter
– More platters mean more heads, which are very expensive. A typical
hard drive can have as many as 100,000 Tracks Per Inch (TPI.
• Linear Density (Bits per inch (BPI))
– The linear density of a disk refers to the total number of bits that can
be packed consecutively in one inch of a track.
– Currently used magnetic materials and read/write heads can support
up to 900,000 Bits Per Inch (BPI).
Disks: Physical Characteristics
• Seek Time (ms): Seek time is the time it takes the drive
to position the heads over the requested cylinder. It
can vary from 0 ms if the heads are already over the
right cylinder, and up to 15 to 20 ms.
• Rotational Speed (RPM): The rotational speed of the
spindle of a hard drive affect the latency time (is the
average time for the sector to rotate into position
under a head.)
• Internal Transfer Rate (Mb/s): The transfer rate of a
drive refers to the speed with which data is transferred
from the drive to main memory and vice-versa.
Fixed Length Records
• Fixed length record
– struct Person {
char name[50];
int citNo;
float salary;
};
• If 1 byte for each field the Total space used is 52
bytes
• Here we use first 52 bytes for first record next 52
for next record and so on
Fixed Record
• Problems
– Difficulty to manage deleted records
• Deleted space must be filled by other record
• Or we have to mark it as deleted
– Block size should be multiple of record size
otherwise it requires two block access to read or
write
Variable length records
– struct Person {
char name[50];
int citNo;
float salary;
Int Account_info[]
};
– Due to multiple record type
– Due to variable length for one or more field
– Due to repeating fields
Implementation:Variable length records